| Return to main text |

ASCII, Parity and Teletypes.

ASCII - The "American Standard Code for Information Interchange"

Computers can only handle numbers and so to represent text, each text character has to be converted into a number. In this context, a printed number is also counted as a text character. It does not really matter what number represents a particular character, but it would be helpful if most people used the same number to represent a particular character. (Doesn't that seen a good idea?)

Out of the many initial variants, ASCII, the "American Standard Code for Information Interchange" became a generally accepted standard. It isn't an absolute standard, because all those who implement it are convinced they know best and make their own changes. At the present, some control characters and the text characters from 32 to 126 seem to have become accepted and standardised.

The implementation of ASCII on the teletype uses 7 bits for the data, from 0000000 to 1111111, ie from 0 to 127. Table 1 below, lists all the 128 possible codes. Codes 0 to 31 are the so called control codes, given with their mnemonics (as current in 1968). Many of these now have little meaning, as in their original form they were used for the direct transmission of text messages. Some have been hi-jacked and put to different (trivial) use in recent years.

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

Control Characters

On a teletype, control characters are generated by pressing the control key (labelled CTRL), in combination with an alphabetical key. The control key suppresses the transmission of bit 7, which effectively subtracts 64 from the ASCII code. So the A key, which would normally transmit the code 65, transmits a 1 when pressed in conjunction with the control key (CTRL/A).

Table 2 shows a few control characters with their mnemonics, functions and the key combination used to produce them.

Table 2: ASCII control codes and their function
CODE NAME KEY
COMBINATION
FUNCTION
0 NULL CTRL/@ Does nothing - effectively a slight pause
1 SOH CTRL/A Start Of Header
2 STX CTRL/B Start of TeXt
3 ETX CTRL/C End of TeXt
4 EOT CTRL/D End Of Transmission
. ... ...  
9 HT CTRL/I Horizontal Tab. Now called TAB.
10 LF CTRL/J Line Feed - it still is.
. ... ...  
13 CR CTRL/M Carriage Return. Although the teletype does not have a movable carriage, the type wheel assembly is fairly massive and this returns to the left with a resoundingly heavy clunk! Carriage Return is now generally referred to as "Enter" - nothing like as heroic.
. ... ...  
17 DC1 CTRL/Q Device Control 1. Used to be called X-ON.
18 DC2 CTRL/R Device Control 2. Used to be called TAPE ON or AUX ON. On a teletype, this character would turn the punch on.
19 DC3 CTRL/S Device Control 3. Used to be called X-OFF.
20 DC4 CTRL/T Device Control 4. Used to be called TAPE OFF or AUX OFF. This could turn the tape punch off.

Parity

Parity was an early method of error checking. The eighth bit of the teletype code was referred to as the Parity Bit and was used for error checking rather than for encoding information. Parity could be either Even (the usual) or Odd. It was also possible to set the eighth bit as always on or always off, but this had no error checking effect.

Even Parity

Even parity requires that the number of ones transmitted in the eight binary bits of a given character should always be EVEN. If the seven data bits have an ODD number of ones, then the eighth bit, the parity bit, is set to a one, so that the total number of ones becomes EVEN. Table 3, below, illustrates this for the characters A - H



Table 3: Parity settings for characters A - H
CHAR CODE RAW
BINARY
(7 bits)
ODD
or EVEN?
BINARY
& PARITY
(8 bits)
ODD
or EVEN?
A 65 1000001 E 0 1000001 E
B 66 1000010 E 0 1000010 E
C 67 1000011 O 1 1000011 E
D 68 1000100 E 0 1000100 E
E 69 1000101 O 1 1000101 E
F 70 1000110 O 1 1000110 E
G 71 1000111 E 0 1000111 E
H 72 1001000 E 0 1001000 E

At the receiving end, the parity could be checked, if the parity was correct, then no error was assumed to have occurred. The system worked because the most likely error was the gain or loss of one bit and parity would detect this. Parity would not detect two errors in a character when one error gained a bit and the other error lost a bit. This was much less likely to occur.

Teletype printing

The teletype type wheel was not large enough to print all the printable characters listed in the table above. The wheel could only hold 4 rows of characters with 16 characters in each row. A typical array is given below.

Teletype Type wheel Character Arrangement
' & % $ # " !   ( ) * + , - . /
G F E D C B A @ H I J K L M N O
7 6 5 4 3 2 1 0 8 9 : ; < = > ?
W V U T S R Q P X Y Z [ \ ]

NOTICE, IN PARTICULAR, THAT THE TELETYPE DOES NOT PRINT lower case CHARACTERS.

| Return to main text | Go to Top |

28-Jan-2002
Text Copyright © 2002 A. Audsley, All Rights Reserved