Vocademy

Input and output transmission

Serial transmission

Serial transmission sends one bit at a time from one circuit to another. A non-computer example of serial transmission is Morse code. For example, when Naval ships in formation communicate, it is often by blinker light and Morse code. Morse code is a binary code where the signal light is held on for a long or short period, each pulse carrying one bit of information. These pulses are sent one at a time using the blinker light. Samuel Morse's telegraph attempted to use electromechanical devices to send and receive messages. However, it turned out that telegraph operators could use the code more efficiently by tapping the code on a switch (the telegraph key) and listening to the clicks of the receiving relay.

The IEEE RS232 system is a serial transmission system used by Teleprinters and computers for many years. RS232 uses two voltages as a basis for a binary code. Nominally these voltages are +12V and -12V. However, the system can work on levels from 3 to 15 volts.

Clocking

One crucial aspect of any data transmission system is indicating when the data is valid. With Morse code, this depends on the relative lengths of the pulses. The person receiving the code can discern the dots from dashes by their relative length. The Morse code is independent of any set timing intervals, so the transmitter and receiver do not need to agree beforehand on what speed to send the signals.

Computers will use various signaling methods when a bit or other block of data is valid so that the receiving device knows when to accept the data.

Asynchronous signaling

RS232 depends on a strict agreement on how fast to send the bits. Clocks in the sending and receiving circuits must be synchronized frequently for the system to work. Since the transmitter and receiver have separate clocks, RS232 is said to be asynchronous (a synchronous system depends on a master clock signal sent from the transmitter to the receiver). To synchronize the clocks, RS232 pauses in the low state (nominally -12V) between each byte of data. The clocks are synchronized when the voltage goes high (nominally +12V). Then the transmitter waits for the time it takes to send one bit, then sends a byte of data, one bit for each clock pulse. A logical 1 is represented by -12V, and a logical 0 is represented by +12V. The time spent at logical 0 before the first bit of valid data is called the start bit. Once the byte is sent, the signal goes to logical 1 and pauses there before the next byte. This pause at logical 1 is called the stop bit.


One byte using RS232 signaling

The UART

A Universal Asynchronous Receiver/Transmitter (UART) is the heart of an RS232 serial port. The UART contains a parallel-in-serial-out/serial-in-parallel-out shift register. It can receive one bit at a time from the serial port and shift those bits until one or more whole bytes are stored in the register. Then the entire block (8 to 32 bits) can be sent to the processor in parallel. It can also receive a block of data (8 to 32 bits) and shift it out the serial port one bit at a time.

Let's say your UART has an 8-bit register. The processor can load the register with eight bits of data in one move. To move the 8 bits to another computer, the receiving computer's UART and the transmitting computer's UART are connected to become a single 16-bit shift register. This shift register is sent eight clock pulses that move the data across a single wire until the data has been moved to the receiving UART. The start bits and stop bits are handled in such a way as to synchronize the two clocks in the separate computers so that they operate as a single clock.

Synchronous Signaling

Synchronous transmission could occur using a separate wire to carry the master clock signal. This is often done with parallel transmission but not so often with serial transmission. Synchronous serial transmission is often facilitated by sending on and off pulses so that there is a transition (on to off or off to on) every time a bit is sent. Another method uses codes that ensures transitions are frequent enough to extract the data's clock information.

Manchester Code

One example of how this is done is the Manchester Code. This scheme sends a pulse for every bit. If the pulse goes from high to low, it is a logical 0; if it goes from low to high, it is a logical 1 (IEEE version). This presents a problem if two 1s or two 0s are sent in a row. How do you go from low to high, then from low to high again? To send two 1s in a row, the voltage must transition back to the low state halfway between the bits. This results in two transitions for each bit if multiple 1s or multiple 0s are sent in a row, but only one transition for each bit of alternating 1s and 0s is sent.

The same byte as above encoded with the Manchester Code.

SMPTE Code

The Society of Motion Picture and Television Engineers (SMPTE) Code looks similar to the Manchester Code but works on a different principle. The Manchester Code sends a transition for every bit. The SMPTE Code sends a transition between bits. Data is represented by the presence or absence of a transition during the time allocated for a bit of data. To represent a logical 1, there is a transition between the bits and a transition during the bit time. To represent a logical 0, there is a transition between the bits but no transition during the bit time. The result is that for each 0, a single transition is sent (low-to-high or high-to-low, it doesn't matter), and for each 1, two transitions are sent.

The same byte as above encoded with the SMPTE Code.

USB code

The Universal Serial Bus (USB) encodes a 0 with the presence of a transition but encodes a 1 by the absence of a transition. Therefore, a string of 0s is a series of transitions, and a string of 1s has no transitions. An extra 0 is inserted whenever there are six consecutive 1s (this is called bit stuffing) to ensure enough transitions to keep the clocks synchronized.

The same byte as above encoded with the USB code.

The same byte as above encoded with the USB code.

RLL code

Another method of clocking uses a Run-Length Limited (RLL) code. This type of code limits the number of 0s that can be sent in a row. This is used for hard disks and floppy disks where the nature of magnetic recording dictates a code where a 1 is represented by a transition and an 0 is represented by no transition. The problem is that the sending and receiving clock can become unsynchronized if there are too many 0s in a row. The RLL code shown here uses five bits to encode every four bits of data but ensures there are never more than two 0s in a row.

This is 00001111, using an RLL code. This uses five signal bits to encode every four data bits but will never have more than two adjacent 0s.

This is 00001111, using an RLL code. This uses five signal bits to encode every four data bits but will never have more than two adjacent 0s.

This RLL code uses signaling similar to the USB code. The main difference is that USB uses bit stuffing to ensure enough transitions for clock recovery, whereas RLL uses a particular encoding scheme to ensure enough transitions for clock recovery. In the above example, 0000 is encoded as 11001, and 1111 is encoded as 01111. The system essentially uses look-up tables to convert binary to RLL encoding.

Parallel transmission

You have already seen the basics of parallel transmission because that is how the microprocessor communicates with the memory subsystem. Multiple wires carry multiple bits in parallel.

Parallel transmission is typically synchronous with a separate wire carrying the master clock signal. A byte (or more) of data is presented on the data wires, and a clock signal from the transmitter signals when the data is good. Typically, the clock goes from high to low. This triggers the receiver to accept the data.

Traditionally, parallel transmission was faster than serial transmission. This makes sense because multiple bits are sent simultaneously in the time serial transmission sends a single bit. However, with very high data speeds, this is not true. This is because information travels along the wires at different speeds (due to imperfections in the wire and insulation). As a result, the receiver must wait for all bits to arrive before accepting them. This phenomenon was once called jitter but is now called skew.

Due to skew problems, parallel transmission has been largely abandoned in favor of serial transmission for high-speed data transfer. One example is the replacement of Parallel ATA (PATA) hard drives with Serial ATA (SATA) hard drives. Other systems where parallel transmission was formerly used now use a hybrid system. Parallel data is broken up into 4-bit or 8-bit parallel "lanes" that are transmitted independently. Sending fewer bits at a time lessens the skew problem. The lanes may be multiplexed over a single channel, for example, 64 bits sent 8 bits at a time, or over multiple channels where 64 bits are sent over eight separate 8-bit channels.

Generally, all communication to the CPU is in parallel over the data bus. However, either serial or parallel signaling may be used to communicate with peripheral hardware. Internally, such as with memory and the expansion bus, communication is often in parallel but only a few bits wide through multiple channels.

Vocademy