Decoding ASCII binary back into text

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

Decoding ASCII binary back into text

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. When decoding an ASCII binary message, how many bits go in each group?
A 8 bits (one byte)
B 4 bits
2. A message has 24 bits. How many ASCII characters does it hold?
A 24 characters
B 3 characters
3. What is the correct order for decoding one byte?
A Letter, then decimal code, then binary
B Binary, then decimal code, then letter
4. What is the first step to decode 0100100001101001?
A Split it into 01001000 and 01101001
B Add up all 16 bits as one big number
5. Decode the byte 01000001. Its decimal value is 64 + 1 = 65. Which letter is it?
A A
B B

Match the Pairs

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

Left columnRight column
101001000 01101001 AThe decimal conversion is right, but the table lookup is wrong. ASCII code 65 is the letter A, not B.
201001000 -> 72 -> H B01000011 01000001 01010100
3Decoding step 1: split a long string of bits into bytes of 8 bits each CConvert the byte to decimal, then look up that code in the ASCII table to get the letter
4Decoding step 3: use the decimal code to look up the character in the ASCII table DGroups of 4 bits are too small. ASCII characters are stored in bytes of 8 bits, so the message should be split into groups of 8.
50100100001101001 -> split into groups of 4 bits E67 -> C
601000001 = 65 = B FTwo bytes: split the message into groups of 8 bits before decoding

Definitions

01001000 -> 72 -> H

Fill in the Blanks

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

1.
01001000 -> __ -> H
2.
groups = split(bits, _)
3.
01000010 -> 66 -> _
4.
=____(72)
5.
24 bits / 8 = _ letters

Spot the Error

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

Question 1
A message = 0100100001101001
B split into groups of 4 bits
C group 1 = 01001000
D group 2 = 01101001
Question 2
A byte = 01000001
B decimal = 32 + 1
C letter = ASCII[65]
Question 3
A byte = 01000011
B decimal = 64 + 2 + 1
C code = 67
D letter = ASCII[76]
E print(letter)
Question 4
A byte = 01010100
B decimal = 64 + 16 + 4
C code = 94
D print(ASCII[code])
E # 84 is the letter T
Question 5
A byte = 01001000
B decimal = 72
C letter = ASCII[byte]
D print(letter)

Answer Key

Decoding ASCII binary back into text
Section A: Quick Questions
Q1
A — 8 bits (one byte)
Q2
B — 3 characters
Q3
B — Binary, then decimal code, then letter
Q4
A — Split it into 01001000 and 01101001
Q5
A — A
Section B: Match the Pairs
Q1
01001000 01101001 → Two bytes: split the message into groups of 8 bits before decoding
Q2
01001000 -> 72 -> H → Convert the byte to decimal, then look up that code in the ASCII table to get the letter
Q3
Decoding step 1: split a long string of bits into bytes of 8 bits each → 01000011 01000001 01010100
Q4
Decoding step 3: use the decimal code to look up the character in the ASCII table → 67 -> C
Q5
0100100001101001 -> split into groups of 4 bits → Groups of 4 bits are too small. ASCII characters are stored in bytes of 8 bits, so the message should be split into groups of 8.
Q6
01000001 = 65 = B → The decimal conversion is right, but the table lookup is wrong. ASCII code 65 is the letter A, not B.
Section C: Definitions
Q1
01001000 -> 72 -> H — To decode ASCII binary, split the bits into groups of 8 (bytes), convert each byte to a decimal code, then look up that code in the ASCII table to find the letter.
Section D: Fill in the Blanks
Q1
01001000 -> 72 -> H
Q2
groups = split(bits, 8)
Q3
01000010 -> 66 -> B
Q4
=CHAR(72)
Q5
24 bits / 8 = 3 letters
Section E: Spot the Error
Q1
B — ASCII characters are stored in bytes, so the message must be split into groups of 8 bits, not 4. It should say: split into groups of 8 bits.
Q2
B — In 01000001 the 1s are in the 64 and 1 place values, so the decimal is 64 + 1 = 65. It should be: decimal = 64 + 1.
Q3
D — The decimal code is 67, so the lookup must use 67 (the letter C). 76 is a different character (L). It should be: letter = ASCII[67].
Q4
C — 64 + 16 + 4 adds up to 84, not 94. The code must match the sum. It should be: code = 84.
Q5
C — The ASCII table is looked up using the decimal code, not the binary byte. It should be: letter = ASCII[decimal].