Computers and Serial Communication

Back to the Index

1. The Electric Telegraph

All communication is serial in some sense; one word follows another, sentence follows sentence, idea follows idea. And the idea of coding communications is not new, we all remember "one if by land and two if by sea", and Indian smoke signals had to be coded somehow, so the message could be understood.

But in the 1840s Samuel Morse faced a specific problem. The electric telegraph, like smoke signals, could only transmit two states: on or off, current or no current, open circuit or closed, no matter how you looked at it, there were only two possible conditions for the telegraph line. At the end of the telegraph line the electromagnet either had current flowing in it or it didn't. So Morse devised a code. It was not clear to anyone that the code could be interpreted by people as it was received, so an elaborate machine called a "telegraph register" was designed that used the electromagnet to emboss a strip of paper that was pulled past it with a clockwork mechanism. So if the current was flowing, the stylus was marking the paper, and when current was absent, there were spaces between the marks.

Engraving of Morse Register
Engraving of Morse Register, from
The Modern Practice of the Electric Telegraph,
by Frank Pope

So the condition of current flowing became known as "marking", and no current was called "spacing". Well over a hundred years later these terms were still being used to describe the state of a teletype circuit.

To overcome the resistance of long telegraph lines, series connections of many battery cells were used, with more cells being used for longer lines. In early telegraph systems, the battery cells were jars full of liquid chemicals (usually poisonous) and metal plates.

The code that Morse devised consisted of short marks, called dots, and long ones called dashes. It was soon discovered that a trained telegraph operator could indeed read the signals as they were received, since the electromagnet made a slightly different noise when it was actuated than when it was released. Later electromagnets had sounding boxes to make the noise louder and further differentiate the noises. But the code was a serial code: the dots and dashes and the spaces between had to follow each other in a specific manner for the message to be understood, and many of the concepts of serial communication can trace their roots back to the telegraph.

The International Morse Code
The International Morse Code

Telegraph lines are expensive. There is mile after mile of wire, strung up on expensive wooden poles, and the circuits must be constantly maintained. Almost as soon as the telegraph was established as a method of communication, there were efforts to increase the capacity of the lines.

So operator speed was at a premium, as was the stamina necessary to work long hours to get the most out of the lines. But people worked on technical solutions as well, such as trying to get two separate telegraph signals on the same line, or at the very least three signals on two lines. It was always difficult to find trained operators, and there were many machines invented to mechanize the encoding and decoding of messages.

One method tried was to transmit tones on the telegraph line, with different tones being used for different circuits. It was just this sort of scheme that led Alexander Graham Bell to invent the telephone, which eliminated the need to encode and decode messages entirely. Another method perfected by Emile Baudot sent several different telegraph signals in a timed sequence, with machinery at each end sequencing (or multiplexing) and separating (or demultiplexing) the signals.

But on the poorer quality lines and submarine cables, and over great distances, the telegraph could operate where telephones could not. And of the machines that encoded and decoded messages, the most enduring was the Teletype, or teleprinter. Like the telegraph register, it left a tangible record of the message, so could be used by unskilled operators or be left unattended. And at the same time teletypewriters were being developed, the marvelous writing machine called the typewriter was entering its golden age. So a teletype could be thought of as a typewriter that just happened to print somewhere else.

But teletypes did not use Morse's code. It was just too difficult for mechanical gadgets to distinguish between a dot and a dash, and to time the spaces in between to separate the letters. It was much easier to simply specify a fixed time in which either a mark or a space was transmitted, then another time interval for the next bit, and so on. Since 'bit' is short for "binary digit", this suggests that a binary code was used. Although Morse code works on an on/off circuit, it is not really a binary code. The elements are dots and dashes and the space between letters, which is at least three elements, if we ignore the space between dots and dashes within a letter. Morse's code also had different lengths for each letter, with the often used 'e' being a single dot, and less used letters like 'c' having more elements (dash-dot-dash-dot).

The easiest was to build a machine is to have it typing at a fixed rate, with each new character typed on a precise schedule. This makes the use of Morse Code impossible. However a binary code with a fixed number of binary digits was attractive, since if each bit took the same amount of time, and there were always the same number of bits in each letter, then each character could be typed on schedule.

The first widely used teletype code is called the Baudot code. The time division multiplex system of telegraphy allowed five operators to share a single telegraph line. The equipment used in multiplex telegraphy was pretty close to what was needed for teletype operation, as we shall see. Baudot's name also survives in the term Baud, which is used as the unit of speed in serial communication systems.

To represent all of the letters of the alphabet, at least 26 combinations are required. With five bits 32 combinations are possible, so this is the minimum number of bits required for a serial teletype system that can print all of the letters of the alphabet. This only leaves six unused codes, so it is not possible to have numbers, or very many symbols such as quotes or commas. Machines can be made to shift gears, however, and the clever solution was to define one of the codes as a shift, which would cause part of the machine to change position so an entirely different character set would be printed. Another code was defined as unshift, and using these codes, numbers and quite a few symbols could be printed, but the letters were all uppercase.

The code of all zeros or "spaces" was special, since it represents an interrupted or broken circuit. When this happens it is desirable not to print anything at all, since nothing useful is being communicated.

The Baudot Teletypewriter Code
The Baudot Teletypewriter Code

Normally, current is flowing in the line, and the line is said to be "marking", and the machine is sitting there with motor running waiting for a character to arrive. To prepare the machine to receive a character, a special zero bit is sent, called the start bit. This bit starts the wheels of the machine turning, and the machine counts and records each of the five bits as they arrive on their fixed schedule. When all five bits have arrived, the bits are used to position a print head or piece of type, which strikes the paper through an inked ribbon, marking the character on the page. After the last bit has arrived, the line is kept in the one state (marking) long enough for the decoding mechanism to reset. In Baudot teleprinters this was 1.42 times as long as the bit time, and became known as the stop bit, although it was required at the end of each character and really did not stop anything.

With the start bit, five data bits, and 1.42 stop bits, the Baudot code took 7.42 bit times to print each character. Although the speed of different machines varied, a common standard was for a bit time to be .022 second, for a rate (in Baud) of 45.5 bit times per second. At this rate, a teleprinter could print just over six characters every second, so if you are printing five letter words with spaces in between, that is just over 60 words every minute, a very respectable typing speed, and faster than almost all telegraph operators.

On to the next section, Serial Communication and Radio
Back to the Index
feedback to the author