Chapter 2 - Serial
Serial connections, at their most basic, only require exactly what a telegraph requires. Just a loop of wire between the two computers. Sometimes just a single wire not even a loop if you're desparate. Modern serial interfaces like RS232 usually include a few extra wires that help to signal when computers want to talk to each other instead of blindly emitting data at each other, but those are by no means necessary. Many computer systems still use what's effectively a fancier Baudot code called UART.
For UART, two computer systems have to know these things in advance:
- What voltage level will be used to signal on/off. If you get this wrong, you fry the physical circuitry. With a telegraph, the worse you could do here is burn out a lightbulb or a buzzer, but with fancy computer systems you burn out your vacuum tubes or transistors.
- What will the synchronization rate be. Today, we call this the Baud Rate, short for Baudot modulation rate
- Data bits size (the original Baudot code used 5-bit data)
- Stop bits size (like the Morse code rest period between letter signals)
- Some kind of flow control agreement to prevent a computer from sending data faster than the receiving computer can process it.
Here is an example UART serial message with 8 data bits:
The "pulse" line is synchronized between the two computers, either by them literally sharing an extra wire with a single clock on it, or by the receiving computer resetting its own internal clock when a serial message starts. The important part is that both sides need to have the same pulse frequency (typically, 9600 baud aka 9600 bits per second) so that they will send and sample at the right times to be understood.
Here, there are two "stop bits". During stop bits, the line is kept electrified "high". So while nothing is sending, the line is high all the time. The receiving computer knows it will begin receiving a message when it sees a "start" bit where the line goes "low" and no longer has voltage on it.
So it goes low for one 9600th of a second to signal the message will begin. Then, because the data bits size here is 8, it will send the data for the next eight 9600ths of a second by either apply or removing voltage from the line in time with the pulse. Then it will set the line back high with voltage for at least two 9600ths of a second because the stop bits size is 2 in this example, and then it will stay high until the next message.
If the baud rate was low enough you could do this manually with a telegraph key. "High" would mean the key is pressed.
So, by this UART method or some similar serial interface, two computers can send little data payloads to each other. I want to stress here, ASCII is a 7-bit standard and it was very common for these serial interfaces to be configured to have 7-bit payloads that match up 1:1 with ASCII encoding. The standard of eight bits to the byte wasn't set until 1975 when Intel's microprocessors like the 8080 and 8086 took off.
It wasn't always ASCII though. IBM had their own text encodings called BCDIC which used 6 bits per character, and then later EBCDIC which used 8 bits per character. These were fairly popular at the time too.