Anda di halaman 1dari 1

34

Character ASCII 40 6 3 41 A 42 B 43 C 44 D E 45 F 46 G 47 H 48 I 49 4A J K 4B L 4C 4D M 4E N 4F 0 50 P 51 Q R 52 S 53 T 54 55 U V 56 w 57 X 58 Y 59 Z 5A 5B [ \ 5c 5D 1 A 5E 5F -

Fundamentals of Digital Logic and Microcomputer Design


EBCDIC Jharacter ASCII EBCDIC 60 c1 61 81 a 62 82 C2 b 63 83 C c3 c4 64 84 d 65 85 e c5 f C6 66 86 67 87 c7 g 68 88 h C8 69 89 1 c9 D1 6A 91 j k D2 6B 92 I D3 6C 93 D4 6D 94 m D5 6E 95 n D6 6F 96 0 D7 70 97 P D8 71 98 q r D9 72 99 A2 E2 73 S 74 A3 E3 t 75 A4 E4 U V 76 A5 E5 77 A6 E6 W X 78 A7 E7 E8 79 A8 Y 7A A9 E9 2 7B { 7C 4F I 7D 1 7E DEL 7F 07 6D
I

TABLE 2.6 ASCII and EBCDIC Codes in Hex.


:haracter ASCII 20 blank ! 21 22 23 # 24 $ 25 Yo 26 & 27 28 ( 29 ) * 2A + 2B 2C 2D 2E 2F I 30 0 31 1 32 2 3 33 34 4 35 5 36 6 37 7 38 8 9 39 3A 3B < 3c 3D > 3E 3F ? EBCDI( 40 5A 7F 7B 5B 6C 50 7D 4D 5D 5C 4E 6B 60 4B 61 F O F1 F2 F3 F4 F5 F6 F7 F8 F9 5E 4c 7E 6E 6F :haracter ASCII NUL 00 SOH 01 STX 02 ETX 03 EOT 04 05 ENQ ACK 06 BEL 07 BS 08 HT 09 LF O A VT OB FF oc O D CR so O E SI OF DLE 10 DC 1 11 DC2 12 DC3 13 DC4 14 NAK 15 SYN 16 ETB 17 CAN 18 EM 19 SUB 1A ESC 1B FS 1c GS 1D RS 1E us IF EBCDIC

37

16 05 25 15

in thevmemory. To print the digit 5 on the EBCDIC printer, a program must be written that will convert the ASCII code 3516 for 5 to its EBCDIC code F5,,. The output of this program is F5,,. This will be input to the EBCDIC printer. Because the printer only understands EBCDIC codes, it inputs the EBCDIC code F5,6and prints the digit 5. Let us now discuss packed and unpacked BCD codes in more detail. For example, in order to enter 24 in decimal into a computer, the two keys ( 2 and 4) will be pushed on the ASCII keyboard. This will generate 32 and 34 (32 and 34 are ASCII codes in hexadecimal for 2 and 4 respectively) inside the computer. A program can be written to convert these ASCII codes into unpacked BCD 02 and 04, and then convert to packed BCD 24 or to binary inside the computer to perform the desired operation.

2.3.3 Excess-3 Code The excess-3 representation of a decimal digit d can be obtained by adding 3 to its value. All decimal digits and their excess-3 representations are listed in Table 2.7. The excess-3 code is an unweighted code because its value is obtained by adding three to the corresponding binary value. The excess-3 code is self-complementing. For example, decimal digit 0 in excess-3 (00 1 1) is ones complement of 9 in excess three (1 100). Similarly, decimal digit 1 is ones complement of 8, and so on. This is why some older computers used