ASCII and its bits per character

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

ASCII and its bits per character

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. How many bits does standard ASCII use for each character's code?
A 7 bits
B 16 bits
2. How many different characters can standard 7-bit ASCII represent?
A 128
B 256
3. What does ASCII stand for?
A Advanced System Code for Internet Interaction
B American Standard Code for Information Interchange
4. Extended ASCII uses 8 bits per character. How many characters can it represent?
A 256 characters
B 512 characters
5. Which set of characters does ASCII cover?
A Letters from every world language and emoji
B English letters, digits and punctuation

Match the Pairs

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

Left columnRight column
12^7 = 128 AStandard ASCII uses 7 bits for 128 characters. 8 bits would give 256, which is extended ASCII.
22^8 = 256 BThe number of characters that extended ASCII (8 bits) can represent
3Standard ASCII gives every character a 7-bit code, but it is usually stored in 8 bits with a leading 0 CASCII stands for American Standard Code for Information Interchange.
4ASCII covers only English letters, digits and punctuation, so it cannot hold characters from other languages DA = 01000001
5Standard ASCII uses 8 bits to give 128 characters EASCII: A b 7 ! ? (no Chinese characters)
6ASCII stands for All Standard Character Information Index FThe number of characters that standard 7-bit ASCII can represent

Definitions

ASCII

Fill in the Blanks

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

1.
American Standard Code for Information Interchange = _____
2.
Original ASCII uses _ bits per character
3.
7 bits give 2^7 = ___ different codes
4.
Extended ASCII: _ bits = 256 characters
5.
ASCII covers only _______ letters, digits, and punctuation

Spot the Error

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

Question 1
A bits = 7
B chars = 2 * bits
C print(chars)
Question 2
A char = 'A'
B code = chr(char)
C print(code) # 65
Question 3
A word = 'HELLO'
B bits = 8
C n = len(word)
D total = n + bits
Question 4
A ascii_chars = 2 ** 8
B extended_chars = 2 ** 8
C print(ascii_chars)
Question 5
A bits = 8
B values = 2 ** bits
C print('Extended:', bits)

Answer Key

ASCII and its bits per character
Section A: Quick Questions
Q1
A — 7 bits
Q2
A — 128
Q3
B — American Standard Code for Information Interchange
Q4
A — 256 characters
Q5
B — English letters, digits and punctuation
Section B: Match the Pairs
Q1
2^7 = 128 → The number of characters that standard 7-bit ASCII can represent
Q2
2^8 = 256 → The number of characters that extended ASCII (8 bits) can represent
Q3
Standard ASCII gives every character a 7-bit code, but it is usually stored in 8 bits with a leading 0 → A = 01000001
Q4
ASCII covers only English letters, digits and punctuation, so it cannot hold characters from other languages → ASCII: A b 7 ! ? (no Chinese characters)
Q5
Standard ASCII uses 8 bits to give 128 characters → Standard ASCII uses 7 bits for 128 characters. 8 bits would give 256, which is extended ASCII.
Q6
ASCII stands for All Standard Character Information Index → ASCII stands for American Standard Code for Information Interchange.
Section C: Definitions
Q1
ASCII — A character set that gives each character a 7-bit code (128 characters), usually stored in 8 bits. Extended ASCII uses 8 bits for 256 characters.
Section D: Fill in the Blanks
Q1
American Standard Code for Information Interchange = ASCII
Q2
Original ASCII uses 7 bits per character
Q3
7 bits give 2^7 = 128 different codes
Q4
Extended ASCII: 8 bits = 256 characters
Q5
ASCII covers only English letters, digits, and punctuation
Section E: Spot the Error
Q1
B — The number of different codes is 2 to the power of the bits, so it must be 2 ** bits. 2 ** 7 = 128 characters. 2 * bits gives 14, which is wrong.
Q2
B — To get the ASCII number for a character you use ord(). chr() goes the other way (number to character) and would cause an error here. It should be code = ord(char).
Q3
D — Each character is stored in 8 bits, so the total is the number of characters multiplied by the bits per character: n * bits (5 x 8 = 40 bits), not added.
Q4
A — Standard ASCII uses 7 bits, giving 2 ** 7 = 128 characters. 2 ** 8 = 256 is the size of extended ASCII, which has its own variable on the next line.
Q5
C — The label says how many characters extended ASCII holds, which is stored in values (256). Printing bits would only show 8. It should print values.