Basic Character Encoding : ASCII

Students should know from memory the basic layout of the ASCII character encoding table. What region of the table contains unprintable control characters? What is the ASCII value of a space? the letters "a" and "A"? What is the lowest standard-ASCII (7-bit) character's name and bit pattern? What is the highest standard-ASCII (7-bit) character's name and bit pattern?


A 7-bit code would provide enough different patterns to permit a coding scheme for all the characters found on a standard English language keyboard (and allow for both upper and lower case letters). The ASCII coding scheme was developed as such a 7-bit code. In most cases, ASCII encoding is normally used in 8-bit bytes now; but only those codes with the left-most bit set to 0 and the remaining 7-bits in the original coding scheme are standard.

A vast majority of ASCII encoding/decoding can be performed by knowing a few "base" codes: the blank, the letter "A", the digit "0", the carriage-return, and the line-feed.

ASCII encoded files are usually composed of variable length "lines" terminated with "carriage-return"'s (Macintosh) or "line-feed"'s (Unix) or with "carriage-return"-"line-feed" pairs (MS-DOS/Windows).


Minimal Sizes for Codes Representing Characters

The Major ASCII Codes and Rules

The Full ASCII Table

Low\Hi

Nybbles

0 1 2 3 4 5 6 7
0 NUL DLE SPACE 0 @ P ` p
1 SOH DC1 ! 1 A Q a q
2 STX DC2 " 2 B R b r
3 ETX DC3 # 3 C S c s
4 EOT DC4 $ 4 D T d t
5 ENQ NAK % 5 E U e u
6 ACK SYNC & 6 F V f v
7 BEL ETB ' 7 G W g w
8 BS CAN ( 8 H X h x
9 HT EM ) 9 I Y i y
A LF SUB * : J Z j z
B VT ESC + ; K [ k {
C FF FS ' < L \ l |
D CR GS - = M ] m }
E SO RS . > N ^ n ~
F SI US / ? O _ o DEL

ASCII Files

Example of ASCII File Decoding



Basic Character Encoding : EBCDIC

EBCDIC material does not need to be memorized

You may need to decode/encode EBCDIC in an assignment


Character encoded data on IBM mainframe computers is normally based on a scheme called EBCDIC. The EBCDIC character encoding preceded the ASCII encoding. EBCDIC was developed from a basis the involved the computer punched card and has features that, to be properly understood, require a knowledge of that historical medium.

EBDIC encoded files normally contain fixed-length records.


The Punched Card and Hollerith Codes

EBCDIC Codes (Basic Codes)

Standard EBCDIC Files

EBCDIC vs. ASCII Character Sequences

For a side-by-side comparison, see: http://www.natural-innovations.com/computing/asciiebcdic.html

Q: If you examine an EBCDIC text file copied byte-for-byte onto an ASCII system such as Unix/Linux or DOS/Windows/Macintosh, what will you see on your ASCII screen? (Hints: [1] Do the EBCDIC letters and numbers match any printable 7-bit ASCII characters? [2] Do EBCDIC sentence punctuation and space characters match any printable ASCII characters?)