Standard Digital Codes

Previously, the physical characteristics of the media were discussed and how digital logic levels are represented on the media. This chapter looks at how information that we, as human beings, understand such as alphanumeric characters are represented digitally.

Computers understand numbers, plain and simply. They process information in binary using only the numbers 1 and 0. Unfortunately, humans do not work in binary but in alpha-numberics (numbers and alphabets). Characters such as numbers and the letters of the alphabet are assigned a 7 or 8 bit code to identify each character. This 7 or 8 bit code is a number that the computer can work with. The types of characters stored in a computer include:

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 translation codes (called character sets) that exist today:

  1. ASCII (pronounced ah-skee)
  2. EBCDIC (pronounced eb-ce-dic)

The job of these character sets is to translate from the human world (where we use alpha-numeric characters) to the computer world (which uses binary numbers 1s and 0s).

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 binary code which is 1s and 0s. The computers do not know what the letter "A" is. Instead they speak of 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 where C = 1100 in binary and 1 = 0001 in binary.

In addition the hexadecimal number C1 is equal to the decimal number 193. The 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 such as 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 advance one 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 many times, a program or interface will report the EBCDIC code in one or the other 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.

Dec Hex Name Dec Hex Name Dec Hex Name Dec Hex Name
0 0 NUL 32 20 DS64 40 RSP 96 60 -
1 1 SOH 33 21 SOS 65 41 97 61 /
2 2 STX 34 22 FS 66 42 98 62
3 3 ETX 35 23 WUS 67 43 99 63
4 4 SEL 36 24 BYP 68 44 100 64
5 5 HT 37 25 LF 69 45 101 65
6 6 RNL 38 26 ETB 70 46 102 66
7 7 DEL 39 27 ESC 71 47 103 67
8 8 GE 40 28 SA 72 48 104 68
9 9 SPS 41 29 SFE 73 49 105 69
10 A RPT 42 2A SM 74 4A ? 106 6A |
11 B VT 43 2B CSP 75 4B . 107 6B ,
12 C FF 44 2C MFA 76 4C < 108 6C %
13 D CR 45 2D ENQ 77 4D ( 109 6D -
14 E SO 46 2E ACK 78 4E + 110 6E >
15 F SI 47 2F BEL 79 4F ? 111 6F ?
16 10 DLE 48 30 80 50 & 112 70
17 11 DC1 49 31 81 51 113 71
18 12 DC2 50 32 SYN 82 52 114 72
19 13 DC3 51 33 IR 83 53 115 73
20 14 RES 52 34 PP 84 54 116 74
21 15 NL 53 35 TRN 85 55 117 75
22 16 BS 54 36 NBS 86 56 118 76
23 17 POC 55 37 EOT 87 57 119 77
24 18 CAN 56 38 SBS 88 58 120 78
25 19 EM 57 39 IT 89 59 121 79 `
26 1A UBS 58 3A RFF 90 5A ! 122 7A :
27 1B CU1 59 3B CU3 91 5B $ 123 7B #
28 1C IFS 60 3C NAK 92 5C * 124 7C @
29 1D IGS 61 3D 93 5D ) 125 7D '
30 1E IRS 62 3E SUB 94 5E ; 126 7E =
31 1F IUS 63 3F SP 95 5F ? 127 7F "

Table 18-1 EBCDIC code

Dec Hex Name Dec Hex Name Dec Hex Name Dec Hex Name
128 80 160 A0 192 C0 { 224 E0 \
129 81 a 161 A1 ~ 193 C1 A 225 E1 NSP
130 82 b 162 A2 s 194 C2 B 226 E2 S
131 83 c 163 A3 t 195 C3 C 227 E3 T
132 84 d 164 A4 u 196 C4 D 228 E4 U
133 85 e 165 A5 v 197 C5 E 229 E5 V
134 86 f 166 A6 w 198 C6 F 230 E6 W
135 87 g 167 A7 x 199 C7 G 231 E7 X
136 88 h 168 A8 y 200 C8 H 232 E8 Y
137 89 i 169 A9 z 201 C9 I 233 E9 Z
138 8A 170 AA 202 CA SHY 234 EA
139 8B 171 AB 203 CB 235 EB
140 8C 172 AC 204 CC 236 EC
141 8D 173 AD 205 CD 237 ED
142 8E 174 AE 206 CE 238 EE
143 8F 175 AF 207 CF 239 EF
144 90 176 B0 208 D0 } 240 F0 0
145 91 j 177 B1 209 D1 J 241 F1 1
146 92 k 178 B2 210 D2 K 242 F2 2
147 93 l 179 B3 211 D3 L 243 F3 3
148 94 m 180 B4 212 D4 M 244 F4 4
149 95 n 181 B5 213 D5 N 245 F5 5
150 96 o 182 B6 214 D6 O 246 F6 6
151 97 p 183 B7 215 D7 P 247 F7 7
152 98 q 184 B8 216 D8 Q 248 F8 8
153 99 r 185 B9 217 D9 R 249 F9 9
154 9A 186 BA 218 DA 250 FA
155 9B 187 BB 219 DB 251 FB
156 9C 188 BC 220 DC 252 FC
157 9D 189 BD 221 DD 253 FD
158 9E 190 BE 222 DE 254 FE
159 9F 191 BF 223 DF 255 FF EO

Table 18-1 EBCDIC code (cont'd)

ASCII - American Standard Code for Information Interchange

ASCII is the most popular code and is used by the majority of the computing world. ASCII itself is a 7 bit code which 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:

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. They are used in "handshaking".

STX Start of Text
ETXEnd of Text
EOT End of Transmission
ENQEnd of Inquiry
ACK Acknowledge
NAK Negative Acknowledge
EXTInterrupt
SYNSynchronous idle
ETB End of Block
EOFEnd of File

Information Separators

Information separators are used to separate database enquiries and files (in a PC - used as cursor arrows: Right, Left, Up, Down):

FS File Separator
GS Group Separator
RS Record Separator
US Unit Separator

Additional Control Codes

Of the remaining codes used by the computer, the most important ones are:

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

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

Displaying ASCII codes directly to the screen

You can type in the ASCII codes directly to the screen on IBM capatible 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, 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. On releasing the ALT key, the letter A will appear on the screen.

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.

Non Displayable ASCII characters

The first 32 (0 - 31) characters of the ASCII code are non displayable characters. Sometimes depending on the font used, they will display as special characters such as a black or white heart, black or white face, etc.. To use these characters if you do not have a numeric keypad, you use the control key (CTRL) designated by the ^ symbol as follows:

00  Null ^@    08  BS  ^H    16  DLE  ^P    24  CAN  ^X
01  SOH  ^A    09  HT  ^I    17  DC1  ^Q    25  EM  ^Y
02  STX  ^B    10  LF  ^J    18  DC2  ^R    26  SUB  ^Z
03  ETX  ^C    11  VT  ^K    19  DC3  ^S    27  ESC  ^[
04  EOT  ^D    12  FF  ^L    20  DC4  ^T    28  FS  ^\
05  ENQ  ^E    13  CR  ^M    21  NAK  ^U    29  GS  ^]
06  ACK  ^F    14  SO  ^N    22  SYN  ^V    30  RS  ^^
07  BEL  ^G    15  SI  ^O    23  ETB  ^W    31  US  ^_

Dec Hex Name Dec Hex Name Dec Hex Name Dec Hex Name
0 0 NUL 32 20 Space 64 40 @ 96 60 `
1 1 SOH 33 21 ! 65 41 A 97 61 a
2 2 STX 34 22 " 66 42 B 98 62 b
3 3 ETX 35 23 # 67 43 C 99 63 c
4 4 EOT 36 24 $ 68 44 D 100 64 d
5 5 ENQ 37 25 % 69 45 E 101 65 e
6 6 ACK 38 26 & 70 46 F 102 66 f
7 7 BEL 39 27 ? 71 47 G 103 67 g
8 8 BS 40 28 ( 72 48 H 104 68 h
9 9 HT 41 29 ) 73 49 I 105 69 i
10 A LF 42 2A * 74 4A J 106 6A j
11 B VT 43 2B + 75 4B K 107 6B k
12 C FF 44 2C , 76 4C L 108 6C l
13 D CR 45 2D - 77 4D M 109 6D m
14 E S0 46 2E . 78 4E N 110 6E n
15 F S1 47 2F / 79 4F O 111 6F o
16 10 DLE 48 30 0 80 50 P 112 70 p
17 11 DC1 49 31 1 81 51 Q 113 71 q
18 12 DC2 50 32 2 82 52 R 114 72 r
19 13 DC3 51 33 3 83 53 S 115 73 s
20 14 DC4 52 34 4 84 54 T 116 74 t
21 15 NAK 53 35 5 85 55 U 117 75 u
22 16 SYN 54 36 6 86 56 V 118 76 v
23 17 ETB 55 37 7 87 57 W 119 77 w
24 18 CAN 56 38 8 88 58 X 120 78 x
25 19 EM 57 39 9 89 59 Y 121 79 y
26 1A SUB 58 3A : 90 5A Z 122 7A z
27 1B ESC 59 3B ; 91 5B [ 123 7B {
28 1C FS 60 3C < 92 5C \ 124 7C |
29 1D GS 61 3D = 93 5D ] 125 7D }
30 1E RS 62 3E > 94 5E ^ 126 7E ~
31 1F US 63 3F ? 95 5F _ 127 7F DEL

Table 18-2 ASCII code

If this page has helped you, please consider donating $1.00 to support the cost of hosting this site, thanks.

Return to

TelecomWorld 101

Copyright July 2013 Eugene Blanchard