Converting bits to bytes and bytes to bits

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Converting bits to bytes and bytes to bits

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How do you convert 32 bits into bytes?
A 32 x 8 = 256 bytes
B 32 / 8 = 4 bytes
2. How do you convert 6 bytes into bits?
A 6 / 8 = 0.75 bits
B 6 x 8 = 48 bits
3. Which statement is correct?
A Bits to bytes: divide by 8
B Bits to bytes: multiply by 8
4. Which statement is correct?
A Bytes to bits: multiply by 8
B Bytes to bits: divide by 8
5. How many bits are in 2 nibbles?
A 8 bits, because 2 x 4 = 8
B 16 bits, because 2 x 8 = 16

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1bytes = bits / 8 Abytes = 6 / 2
2bits = bytes * 8 BDivide the number of bits by 8 to find how many bytes they make
3A nibble is 4 bits, so 3 nibbles contain 12 bits CMultiply the number of bytes by 8 to find how many bits they contain
42 nibbles make 1 byte, so 6 nibbles are 3 bytes DMultiplied instead of dividing. Going from bits to bytes means dividing by 8, so it should be bytes = 32 / 8 = 4.
5bytes = 32 * 8 Ebits = 3 * 4
6bits = 5 / 8 FDivided instead of multiplying. Going from bytes to bits means multiplying by 8, so it should be bits = 5 * 8 = 40.

Definitions

bytes = bits / 8

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
bits = 24 bytes = bits / _
2.
bytes = 5 bits = bytes _ 8
3.
nibbles = 3 bits = nibbles * _
4.
bits = 40 bytes = bits _ 8
5.
nibbles = 6 bytes = nibbles / _

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A byte_count = 24 * 8
B print(byte_count)
C print('bytes')
Question 2
A byte_count = 5
B bit_count = byte_count / 8
C print(bit_count)
Question 3
A nibbles = 6
B bits = nibbles * 4
C bytes_total = bits / 4
D print(bytes_total)
Question 4
A file_bytes = 12
B print('Size in bits:')
C print(file_bytes / 8)
Question 5
A nibbles = 10
B bits = nibbles * 4
C bytes_total = bits * 8
D print(bytes_total)

Answer Key

Converting bits to bytes and bytes to bits
Section A: Quick Questions
Q1
B — 32 / 8 = 4 bytes
Q2
B — 6 x 8 = 48 bits
Q3
A — Bits to bytes: divide by 8
Q4
A — Bytes to bits: multiply by 8
Q5
A — 8 bits, because 2 x 4 = 8
Section B: Match the Pairs
Q1
bytes = bits / 8 → Divide the number of bits by 8 to find how many bytes they make
Q2
bits = bytes * 8 → Multiply the number of bytes by 8 to find how many bits they contain
Q3
A nibble is 4 bits, so 3 nibbles contain 12 bits → bits = 3 * 4
Q4
2 nibbles make 1 byte, so 6 nibbles are 3 bytes → bytes = 6 / 2
Q5
bytes = 32 * 8 → Multiplied instead of dividing. Going from bits to bytes means dividing by 8, so it should be bytes = 32 / 8 = 4.
Q6
bits = 5 / 8 → Divided instead of multiplying. Going from bytes to bits means multiplying by 8, so it should be bits = 5 * 8 = 40.
Section C: Definitions
Q1
bytes = bits / 8 — Divide bits by 8 to get bytes. Multiply bytes by 8 to get bits. A nibble is 4 bits, so 2 nibbles make 1 byte. Example: 24 bits / 8 = 3 bytes, and 5 bytes x 8 = 40 bits.
Section D: Fill in the Blanks
Q1
bits = 24 bytes = bits / 8
Q2
bytes = 5 bits = bytes * 8
Q3
nibbles = 3 bits = nibbles * 4
Q4
bits = 40 bytes = bits / 8
Q5
nibbles = 6 bytes = nibbles / 2
Section E: Spot the Error
Q1
A — To convert bits to bytes you divide by 8, not multiply. It should be byte_count = 24 / 8, which gives 3 bytes.
Q2
B — To convert bytes to bits you multiply by 8, not divide. It should be bit_count = byte_count * 8, which gives 40 bits.
Q3
C — There are 8 bits in a byte, so bits are divided by 8 (4 is the number of bits in a nibble). It should be bytes_total = bits / 8, which gives 3 bytes.
Q4
C — The program prints the size in bits, so the bytes must be multiplied by 8, not divided. It should be print(file_bytes * 8), which gives 96 bits.
Q5
C — To go from bits to bytes you divide by 8, not multiply. 10 nibbles are 40 bits, so it should be bytes_total = bits / 8, which gives 5 bytes.