Chapter 17. Standard Digital Codes

Computers process information in digital form. Characters are assigned a 7 or 8 bit code to indicate its character. This 7 or 8 bit code becomes a number (usually hexadecimal) that the computer can work with. The characters stored in a computer include the following:

Lower case letters:a - z
Upper case letters:A - Z
Digits:0 - 9
Punctuation Marks:. , ; : ! ? etc...
Unit Symbols:# $ % & * etc...
Control Codes:EOF, etc..

There are 2 major codes existing today: ASCII (pronounced ah-skee) and EBCDIC (pronounced eb-ce-dic).

EBCDIC - Extended Binary Coded Decimal Interchange Code

EBCDIC is used mainly by IBM mainframes and compatibles. It is not common in the PC LAN world unless you are connecting to the IBM mainframe world. In order to connect, you would require either an IBM 3270 terminal emulation program or a device called a gateway.

Table 18-1 shows the EBCDIC translation table. Computers speak in the binary code of 1s and 0s: they do not recognize the letter "A." Instead, they refer to the letter "A" as the binary number 1100 0001. It is not easy for humans to remember binary numbers such as 1100 0001, but it is easier to remember the hexadecimal number C1. The hexadecimal number C1 is equal to the binary number 1100 0001.

The hexadecimal number C1 is equal to the decimal number 193. Table 18-1 shows both the decimal (dec) number and the hexadecimal (hex) number for the capital letter "A". Lower case "a" is represented by the EBCDIC decimal code 129 (or, hexadecimal code 81).

Besides character codes like the previous letter "A", the EBCDIC code also defines control characters. These are characters that have special meaning. For example, the control character FF stands for Form Feed, and is used by printers to either advance a page or to eject a page. The decimal code for FF is 12 and the hexadecimal code is C.

Both hexadecimal and decimal codes are indicated, because in many instances, a program or interface will report the EBCDIC code in one of the formats. You may have to use Table 18-1 to translate from the numerical code to the actual character.

Note: Some EBCDIC codes are not defined--and have no name.

DecHexNameDecHexNameDecHexNameDecHexName
00NUL3220DS6440RSP9660-
11SOH3321SOS65419761/ 
22STX3422FS66429862  
33ETX3523WUS67439963  
44SEL3624BYP684410064  
55HT3725LF694510165  
66RNL3826ETB704610266  
77DEL3927ESC714710367  
88GE4028SA724810468  
99SPS4129SFE734910569  
10ARPT422ASM744A¢1066A|
11BVT432BCSP754B.1076B,
12CFF442CMFA764C1086C% 
13DCR452DENQ774D(1096D-
14ESO462EACK784E+1106E>
15FSI472FBEL794Fê1116F?
1610DLE48308050&11270  
1711DC14931815111371   
1812DC25032SYN825211472  
1913DC35133IR835311573  
2014RES5234PP845411674  
2115NL5335TRN855511775  
2216BS5436NBS865611876  
2317POC5537EOT875711977  
2418CAN5638SBS885812078  
2519EM5739IT895912179` 
261AUBS583ARFF905A!1227A:
271BCU1593BCU3915B$1237B#
281CIFS603CNAK925C*1247C@
291DIGS613D935D)1257D' 
301EIRS623ESUB945E;1267E=
311FIUS633FSP955Fù1277F"

Table 18-1 EBCDIC code

DecHexNameDecHexNameDecHexNameDecHexName
12880160A0192C0{224E0\  
12981a161A1~193C1A225E1NSP
13082b162A2s194C2B226E2S
13183c163A3t195C3C227E3T
13284d164A4u196C4D228E4U
13385e165A5v197C5E229E5V
13486f166A6w198C6F230E6W
13587g167A7x199C7G231E7X
13688h168A8y200C8H232E8Y
13789i169A9z201C9I233E9Z
1388A170AA202CASHY234EA   
1398B171AB203CB235EB    
1408C172AC204CC236EC    
1418D173AD205CD237ED    
1428E174AE206CE238EE    
1438F175AF207CF239EF    
14490176B0208D0}240F00  
14591j177B1209D1J241F11 
14692k178B2210D2K242F22 
14793l179B3211D3L243F33 
14894m180B4212D4M244F44 
14995n181B5213D5N245F55 
15096o182B6214D6O246F66 
15197p183B7215D7P247F77 
15298q184B8216D8Q248F88 
15399r185B9217D9R249F99 
1549A186BA218DA250FA    
1559B187BB219DB251FB    
1569C188BC220DC252FC    
1579D189BD221DD253FD    
1589E190BE222DE254FE    
1599F191BF223DF255FFEO   

Table 18-1 EBCDIC code (cont'd)

ASCII - American Standard Code for Information Interchange

ASCII is the most popular code and it is used by the majority of the computing world. ASCII itself is a 7 bit code that allows only 128 characters (27). Most applications follow IBM's Extended ASCII code, which uses 8 bits and allows an addition 128 graphic characters for a total of 256 characters (28). We will be concentrating on 7 bit ASCII codes.

Format effectors

Format effectors control the movement of the cursor on the screen and the print head in a printer. The format effectors are shown below.

BSBackspace
HTHorizontal Tab
LFLine Feed
CRCarriage Return
FFForm Feed
VTVertical Tab

Communication Controls

Communication Controls are used in controlling data transmission over a communication network. They are used in both Asynchronous and Synchronous Transmissions, and are used in "handshaking".

STXStart of Text
ETXEnd of Text
EOTEnd of Transmission
ENQEnd of Inquiry
ACKAcknowledge
NAKNegative Acknowledge
EXTInterrupt
SYNSynchronous idle
ETBEnd of Block
EOFEnd of File

Information Separators

Information separators are used to separate database enquiries and files as follows:

FSFile Separator(in a PC - used as cursor R, L, U, D)
GSGroup Separator
RSRecord Separator
USUnit Separator

Additional Control Codes

Of the remaining codes used by the computer, the most important ones are shown below.

NULNothing character
BEL Rings the bell!
DC1 - 4 Device Control 1 - 4
ESCEscape - used for formatting printers & terminals
DELDelete - deletes characters under cursor

DC1 & DC2 are used in the Xon/Xoff software handshaking to control data transfer.

Displaying ASCII codes directly to the screen

You can type the ASCII codes directly to the screen on IBM compatible computers: you press the "ALT" key and a 3 digit number on the numeric keypad. The 3 digit number is the ASCII decimal code for the character. You must use the numeric keypad because the QWERTY numbers will NOT work.

For example, the character "A" corresponds to the ASCII decimal code 65. To access the ASCII code directly, hold down the ALT key and type in 065 on the numeric keypad. The letter A will appear on the screen when you release the ALT key.

Table 18-2 shows the ASCII codes according to decimal numbers and hexadecimal numbers. If a network sniffer or analyzer is used it will show raw data in decimal or hexadecimal formats. You may have to perform a manual translation using Table 18-2.

Introduction to Data Communications

PreviousASCII - American Standard Code for Information Interchange (cont'd)Next DecHexNameDecHexNameDecHexNameDecHexName
00NUL3220Space6440@9660`  
11SOH3321!6541A9761a  
22STX3422"6642B9862b  
33ETX3523#6743C9963c  
44EOT3624$6844D10064d  
55ENQ3725%6945E10165e  
66ACK3826&7046F10266f  
77BEL3927¢7147G10367g  
88BS4028(7248H10468h  
99HT4129)7349I10569i  
10ALF422A*744AJ1066Aj  
11BVT432B+754BK1076Bk  
12CFF442C,764CL1086Cl  
13DCR452D-774DM1096Dm  
14ES0462E.784EN1106En  
15FS1472F/794FO1116Fo  
1610DLE483008050P11270p  
111DC1493118151Q11371q  
1812DC2503228252R11472r  
1913DC3513338353S11573s  
2014DC4523448454T11674t  
2115NAK533558555U11775u  
2216SYN543668656V11876v  
2317ETB553778757W11977w  
2418CAN563888858X12078x  
2519EM573998959Y12179y  
261ASUB583A:905AZ1227Az  
271BESC593B;915B[1237B{  
281CFS603C925C\1247C|   
291DGS613D=935D]1257D}  
301ERS623E>945E^1267E~  
311FUS633F?955F_1277FDEL  

Table 18-2 ASCII code

If this section was helpful, why not donate to further development?

Donate $1.25.

Donate $2.50.

Donate $5.00.