A few weeks ago, we published an article, about storage, and how data was transferred from a storage space to a machine; we will focus today on the methods of transmission of this data.
For each and every data transfer, there is one truth: the emitter and the receiver have to use the same protocol. It allows them to have the same level of information and to know the transfer speed of the data, the signals announcing the beginning and the end of the communication, as well as the method used to check the integrity of the received data. There are numerous protocols, which we developped in our aforementionned article. However, all protocols rely on two transmission methods: parallel transmission and serial transmission.
In this article, discover the differences between these two methods in terms of concept and use!
Before getting into the heart of the matter, let us have a quick “vocabulary break” and focus on bits. A bit is the smallest unit used to code data, and it can take only two values: 0 or 1.
Let us take ASCII code as an example. It enables to code a character with a byte (a byte is equal to 8 bits). The letter A, in this case, is written 01000001 in ASCII code, or:
|Bit 1 : 0||Bit 2 : 1||Bit 3 : 0||Bit 4 : 0||Bit 5 : 0||Bit 6 : 0||Bit 7 : 0||Bit 8 : 1|
A three-letter word, such as “cat”, is thus coded with three bytes, thus 3×8 = 24 bits, etc.
The two data transmission methods we expose in this article are acting at the bit level.
This data transmission method consists in sending bits between an emitter and a receiver on several lines, simultaneously. For instance, by associating 8 buses (cables) and transmitting 1 bit per bus at the same time, one has the opportunity to go 8 times faster as by progressively sending the data: it is the biggest advantage of this method. Moreover, it can easily be implemented on a machine, since creating a parallel port to receive the additional buses is very easy. Its drawback is its price: having several cables is much more expensive than having only one, whic makes sense! It is however possible to make parallel data transmission through only one physical line, by dividing the bandwidth into several underlying lanes.
Parallel transmission can be used for data transfer on a short distance, for instance between components of a machine (PCI protocol). However, for great distances, serial transmission is preferred: using parallel transmission would require too much equipment. Moreover, the longer the cable, the bigger the probability to experience crosstalk: it is a phenomenon of electromagnetic induction where the signal transmitted by one cable creates an interference with a signal on another cable.
This data transmission method consists in sending succeeding bits through a single bus, between an emitter and a receiver. These bits thus reach the receiver one after the other, which can take time depending on the quantity of data to be sent.
In order to know when the transmission starts and when it ends, the sent data is organized in threads. A thread is made of a header, of data to transmit, and of a trailer (indicating the end of the transmission).
There are two serial transmission methods for these threads:
The emitter and the receiver are adjusted on the same clock, thanks to a synchronisation signal (a signal indicating the moment where the receiver can read data), for the reading frequency to match the sending frequency. Without this, the receiver is likely to read only one out of two bits, for instance, if its reading frequency is twice as slow as the receiving frequency.
For that, there are two solutions: either the signal is regular, in which case the receiver will synchronize its internal clock to the emmiter’s frequency, or it is not. In the later case, the synchonisation signal is sent through a second bus, whose goal is thus to synchronize transmissions, placed in parallel of the bus transmitting the data.
In both cases, data can be sent in an uninterrupted flow, since the receiver adjusts itself depending on the synchronisation signals.
With the asynchronous method, however, there has to be an inactivity interval inbetween two data transmissions. The data sending frequency does not count in this case. Indeed, within the general thread, the transmission of one single character is launched by a “starting” signal (or bit). Once the 8 bits of the character are transmitted, there is an “ending” bit indicating the end of the character transmission. The problem with this method is that 20% of the bandwidth is used by these framing bits. It is mainly used for small threads with a moderate pace.
This data division work, as well as the insertion of bits between a “starting” bit and an “ending” bit is made by the UART (Universal Asynchronous Receiver/Transmitter). To be able to send a character made of 8 bits, the emitter’s UART thus puts these between the framing bits. For each character, it thus has a shift register containing the character:
The UART starts by sending the starting bit, then shifts its register to the left.
The first bit is thus in the “sending” position: it is sent. It keeps going this way until the ending bit is sent.
At the receiver level, the principle is the same. The UART has an empty register, made of 10 cases. When it receives the starting bit, its register fills in this way:
The register then shifts to the left in order to receive the following bits, and thus obtain all the bits in the right order. In the end, the register is filled as such:
That is how the character is fully readable by the receiver.
In these two cases, one also has to check that all of the data has been transmitted. There are two ways to do this. The first one is to have a cyclic redundancy check: it is a software tool using the hashing method and enabling to spot transmission errors. The second one is to include, for each character, a parity bit. A parity bit takes the value 0 if the total of the other bits is an even number, and the value 1 if it is odd.
Serial transmission is mainly used for long distance (telecom, audiovisual media…). It can be found in the following protocols: optic fiber, USB, Ethernet, Fibre Channel, Serial Attached SCSI, PCI, SATA…
Use of these methods today
At the beginning of IT, data transmission was serial; then, the use of parallel transmission grew since it offered better performances. But in 2005, with the improvement of the electronics, serial transmission became comptetitive again: it now offers good performances, sometimes even better ones than parallel transmission, and it is less expensive since it needs less equipment. That is why we use USB disks rather than IEEE 1284, SATA rather than PATA…
Parallel transmission remains used in radio communication, where it is resurfacing, or even inside machines on short distances (with the PCI protocol for instance).