Basic Character Encoding : ASCII


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 null DEL blank 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 bell ETB ' 7 G W g w
8 backsp CAN ( 8 H X h x
9 tab 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


ASCII Files



Example of ASCII File Decoding




Basic Character Encoding : EBCDIC


Character encoded data on IBM mainframe computers is normally based on a scheme called EBCDIC. 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