๐ ASCII Table Study Guide
๐ What is ASCII?
ASCII (American Standard Code for Information Interchange) is a character encoding standard used to represent text in computers and other devices that use text.
- Assigns a numeric value (0โ127) to letters, digits, symbols, and control characters.
- Used widely in programming, data transmission, and system design.
๐ง Key Concepts to Learn
1. ASCII Range
Range | Characters | Example |
0โ31 | Control Characters | \n (newline), \t (tab) |
32โ47 | Punctuation | !, ", #, $, %, & |
48โ57 | Digits | 0 to 9 |
65โ90 | Uppercase Letters | A to Z |
97โ122 | Lowercase Letters | a to z |
127 | Delete | (DEL) |
2. Control Characters
Code | Name | Description |
0 | NUL | Null |
7 | BEL | Bell (alert) |
8 | BS | Backspace |
9 | TAB | Horizontal Tab |
10 | LF | Line Feed (newline) |
13 | CR | Carriage Return |
๐ก ASCII Code Examples
Character: A
ASCII Decimal: 65
ASCII Binary: 01000001
ASCII Hex: 41
Character: 1
ASCII Decimal: 49
ASCII Binary: 00110001
ASCII Hex: 31
๐ก Helpful Tips
- ASCII values are case-sensitive: 'A' โ 'a'
- Digits '0' to '9' start at ASCII 48
- Common functions:
ord('A')
โ 65
chr(65)
โ 'A'
๐ ๏ธ Practice Exercises
- What is the ASCII value of 'Z'?
- What character does ASCII 97 represent?
- Write the ASCII values of the string "Hi!".
- What is the binary representation of 'C'?
- Match the following:
- 65 โ ___
- 98 โ ___
- 33 โ ___
- 10 โ ___
Click to see the answers, read and record.
Your file name will be PX_lastname_Practice1.mp3
Be sure to drop off your file into google classroom.
๐งช Programming Example (Python)
# Convert text to ASCII
text = "Code"
ascii_values = [ord(c) for c in text]
print(ascii_values) # Output: [67, 111, 100, 101]
# Convert ASCII to text
codes = [72, 105]
characters = ''.join([chr(code) for code in codes])
print(characters) # Output: Hi
๐ Summary Chart
Char | Dec | Hex | Bin |
A | 65 | 41 | 01000001 |
B | 66 | 42 | 01000010 |
a | 97 | 61 | 01100001 |
0 | 48 | 30 | 00110000 |
! | 33 | 21 | 00100001 |
Space | 32 | 20 | 00100000 |
โ
Review Questions
- What is the difference between ASCII and Unicode?
- Why are ASCII values helpful in sorting text?
- How are ASCII codes used in network protocols?
Click to see the answers, read and record.
Your file name will be PX_lastname_Review1.mp3
Be sure to drop off your file into google classroom.
In summary, you will be dropping off 3 files into google classroom.
PX_lastname_ASCII.mp3
PX_lastname_Practice1.mp3
PX_lastname_Review1.mp3