AeroLab Reading room

CS / Foundations

Bits, bytes and representation

A bit has two possible values. Binary place values are powers of two, allowing bit patterns to represent numbers; character and image encodings assign other meanings to those patterns.

Learning objectives

The big idea

A bit has two possible values. Binary place values are powers of two, allowing bit patterns to represent numbers; character and image encodings assign other meanings to those patterns.

Eight bits form a byte. A bit pattern has no unique meaning without its format: the same byte might represent an integer, a character code or part of a colour.

Equations and relationships

unsigned range with n bits = 0 to 2ⁿ−1

All bit patterns represent nonnegative values in this format.

Worked example

Convert binary 1101 to decimal.

Follow the solution

Use place values 8+4+0+1=13.

Investigate and explain

Predict the worked result before calculating. Change one input, record the new result, and explain which assumptions still hold.

Use the prediction activity below; a local model appears only where it supports this topic.

Open the interactive investigation

Check your understanding

1. How many distinct patterns do 3 bits provide?

  1. 3
  2. 6
  3. 8
Check the answer and reasoning

8

Each of three positions has two choices, giving 2³=8.

2. Convert binary 1101 to decimal.

  1. 13
  2. 11
  3. 1101
Check the answer and reasoning

13

Use place values 8+4+0+1=13.

3. Does one byte always mean one letter?

  1. Yes
  2. No
  3. Only on a phone
Check the answer and reasoning

No

Encodings differ; some characters require multiple bytes and some bytes are not text.