Wednesday, November 28, 2018

Converting Data into Signals (1) - Curt M. White

Converting Data into Signals

Like signals, data can be analog or digital. Often, analog signals convey analog data, and digital signals convey digital data. However, you can use analog signals to convey digital data and digital signals to convey analog data. The decision about whether to use analog or digital signals often depends on the transmission equipment and the environment in which the signals must travel. Recall that certain electronic equipment is capable of supporting only analog signals, while other types of equipment support only digital signals. For example, the telephone system was created to transmit human voice, which is analog data. Thus, the telephone system was originally designed to transmit analog signals. Although telephone wiring is capable of carrying either analog or digital signals, the electronic equipment used to amplify and remove noise from many of the lines can accept only analog signals. Therefore, to transmit digital data from a computer over these telephone lines, it is common to use analog signals. Transmitting analog data with digital signals is also fairly common. Originally, cable television companies transmitted analog television channels using analog signals. More recently, the analog television channels are converted to digital signals in order to provide clearer images and higher definition signals. As we saw in the chapter introduction, broadcast television is now transmitting using digital signals. As you can see from these examples, there are four main combinations of data and signals: 
  • Analog data transmitted using analog signals
  • Digital data transmitted using digital signals
  • Digital data transmitted using discrete analog signals 
  • Analog data transmitted using digital signals

Let us examine each of these in turn.

A. Transmitting analog data with analog signals 

Of the four combinations of data and signals, the analog data-to-analog signal conversion is probably the simplest to comprehend. This is because the data is an analog waveform that is simply being transformed to another analog waveform, the signal, for transmission. The basic operation performed is modulation. Modulation is the process of sending data over a signal by varying either its amplitude,frequency, or phase. Land-line telephones, AM radio, FM radio, and pre-June 2009 broadcast television are the most common examples of analog data-to-analog signal conversion. Consider Figure 2-11, which shows AM radio as an example. The audio data generated by the radio station might appear like the first sine wave shown in the figure. To convey this analog data, the station uses a carrier wave signal, like that shown in Figure 2-11(b). In the modulation process, the original audio waveform and the carrier wave are essentially added together to produce the third waveform. Note how the dotted lines superimposed over the third waveform follow the same outline as the original audio waveform. Here, the original audio data has been modulated onto a particular carrier frequency (the frequency at which you set the dial to tune in a station) using amplitude modulation—hence, the name AM radio. Frequency modulation also can be used in similar ways to modulate analog data onto an analog signal, and it yields FM radio.

an audio waveform modulated onto a carrier frequency using amplitude modulation

B. Transmitting digital data with digital signals: Digital encoding schemes

To transmit digital data using digital signals, the 1s and 0s of the digital data must be converted to the proper physical form that can be transmitted over a wire or airwave. Thus, if you wish to transmit a data value of 1, you could do this by transmitting a positive voltage on the medium. If you wish to transmit a data value of 0, you could transmit a zero voltage. You could also use the opposite scheme: a data value of 0 is positive voltage, and a data value of 1 is a zero voltage. Digital encoding schemes like this are used to convert the 0s and 1s of digital data into the appropriate transmission form. We will examine six digital encoding schemes that are representative of most digital encoding schemes: NRZ-L, NRZI, Manchester, differential Manchester, bipolar-AMI,and 4B/5B.

1. Nonreturn to Zero Digital Encoding Schemes

The nonreturn to zero-level (NRZ-L) digital encoding scheme transmits 1s as zero voltages and 0s as positive voltages. The NRZ-L encoding scheme is simple to generate and inexpensive to implement in hardware. Figure 2-12(a) shows an example of the NRZ-L scheme.
example of the NRZ-L scheme.

The second digital encoding scheme, shown in Figure 2-12(b), is nonreturn to zero inverted (NRZI). This encoding scheme has a voltage change at the beginning of a 1 and no voltage change at the beginning of a 0. A fundamental difference exists between NRZ-L and NRZI. With NRZ-L, the receiver has to check the voltage level for each bit to determine whether the bit is a 0 or a 1. With NRZI, the receiver has to check whether there is a change at the beginning of the bit to determine if it is a 0 or a 1. Look again at Figure 2-12 to see this difference between the two NRZ schemes.
An inherent problem with the NRZ-L and NRZI digital encoding schemes is that long sequences of 0s in the data produce a signal that never changes. Often the receiver looks for signal changes so that it can synchronize its reading of the data with the actual data pattern. If a long string of 0s is transmitted and the signal does not change, how can the receiver tell when one bit ends and the next bit begins? (Imagine how hard it would be to dance to a song that has no regular beat, or worse, no beat at all.) One potential solution is to install in the receiver an internal clock that knows when to look for each successive bit. But what if the receiver has a different clock from the one the transmitter used to generate the signals? Who is to say that these two clocks keep the same time? A more accurate system would generate a signal that has a change for each and every bit. If the receiver could count on each bit having some form of signal change, then it could stay synchronized with the incoming data stream.

2. Manchester Digital Encoding Schemes

The Manchester class of digital encoding schemes ensures that each bit has some type of signal change, and thus solves the synchronization problem. Shown in Figure 2-12(c), the Manchester encoding scheme has the following properties: to transmit a 1, the signal changes from low to high in the middle of the interval; to transmit a 0, the signal changes from high to low in the middle of the interval. Note that the transition is always in the middle, a 1 is a low-to-high transition, and a 0 is a high-to-low transition. Thus, if the signal is currently low and the next bit to transmit is a 0, the signal has to move from low to high at the beginning of the interval so that it can do the high-to-low transition in the middle. Manchester encoding is used in most local area networks for transmitting digital data over a local area network cable.

The differential Manchester digital encoding scheme, which is also used in some local area networks for transmitting digital data over a local area network cable, is similar to the Manchester scheme in that there is always a transition in the middle of the interval. But unlike the Manchester code, the direction of this transition in the middle does not differentiate between a 0 or a 1. Instead, if there is a transition at the beginning of the interval, then a 0 is being transmitted. If there is no transition at the beginning of the interval, then a 1 is being transmitted. Because the receiver must watch the beginning of the interval to determine the value of the bit, the differential Manchester is similar to the NRZI scheme (in this one respect). Figure 2-12(d) shows an example of differential Manchester encoding.
The Manchester schemes have an advantage over the NRZ schemes: In the Manchester schemes, there is always a transition in the middle of a bit. Thus, the receiver can expect a signal change at regular intervals and can synchronize itself with the incoming bit stream. The Manchester encoding schemes are called self-clocking, because the occurrence of a regular transition is similar to seconds ticking on a clock. As you will see in Chapter Four, it is very important for a receiver to stay synchronized with the incoming bit stream, and the Manchester codes allow a receiver to achieve this synchronization.

The big disadvantage of the Manchester schemes is that roughly half the time there will be two transitions during each bit. For example, if the differential Manchester encoding scheme is used to transmit a series of 0s, then the signal has to change at the beginning of each bit, as well as change in the middle of each bit. Thus, for each data value 0, the signal changes twice. The number of times a signal changes value per second is called the baud rate, or simply baud. In Figure 2-13, a series of binary 0s is transmitted using the differential Manchester encoding scheme. Note that the signal changes twice for each bit. After one second, the signal has changed 10 times. Therefore, the baud rate is 10. During that same time period, only 5 bits were transmitted. The data rate, measured in bits per second (bps), is 5, which in this case is one-half the baud rate. Many individuals mistakenly equate baud rate to bps (or data rate). Under some circumstances, the baud rate may equal the bps, such as in the NRZ-L or NRZI encoding schemes shown in Figure 2-12. In these, there is at most one signal change for each bit transmitted. But with schemes such as the Manchester codes, the baud rate is not equal to the bps.


Why does it matter that some encoding schemes have a baud rate twice the bps? Because the Manchester codes have a baud rate that is twice the bps, and the NRZ-L and NRZI codes have a baud rate that is equal to the bps, hardware that generates a Manchester-encoded signal has to work twice as fast as hardware that generates a NRZ-encoded signal. If 100 million 0s per second are transmitted using differential Manchester encoding, the signal has to change 200 million times per second (as opposed to 100 million times per second with NRZ encoding). As with most things in life, you do not get something for nothing. Hardware or software that handles the Manchester encoding schemes is more elaborate and more costly than the hardware or software that handles the NRZ encoding schemes. More importantly, as we shall soon see, signals that change at a higher rate of speed are more susceptible to noise and errors.

3. Bipolar-AMI Encoding Scheme

The bipolar-AMI encoding scheme is unique among all the encoding schemes seen thus far because it uses three voltage levels. When a device transmits a binary 0, a zero voltage is transmitted. When the device transmits a binary 1, either a positive voltage or a negative voltage is transmitted. Which of these is transmitted depends on the binary 1 value that was last transmitted. For example, if the last binary 1 transmitted a positive voltage, then the next binary 1 will transmit a negative voltage. Likewise, if the last binary 1 transmitted a negative voltage, then the next binary 1 will transmit a positive voltage (Figure 2-12).
The bipolar scheme has two obvious disadvantages. First, as you can see in Figure 2-12(e), we have the long-string-of-0s synchronization problem again, as we had with the NRZ schemes. Second, the hardware must now be capable of generating and recognizing negative voltages as well as positive voltages. On the other hand, the primary advantage of a bipolar scheme is that when all the voltages are added together after a long transmission, there should be a total voltage of zero. That is, the positive and negative voltages essentially cancel each other out. This type of zero voltage sum can be useful in certain types of electronic systems (the question of why this is useful is beyond the scope of this text).

4. 4B/5B Digital Encoding Scheme

The Manchester encoding schemes solve the synchronization problem but are relatively inefficient because they have a baud rate that is twice the bps. The 4B/5B scheme tries to satisfy the synchronization problem and avoid the “baud equals two times the bps” problem. The 4B/5B encoding scheme takes 4 bits of data, converts the 4 bits into a unique 5-bit sequence, and encodes the 5 bits using NRZI.
The first step the hardware performs in generating the 4B/5B code is to convert 4-bit quantities of the original data into new 5-bit quantities. Using 5 bits (or five 0s and 1s) to represent one value yields 32 potential combinations (2 = 32). Of these possibilities, only 16 combinations are used, so that no code has three or more consecutive 0s. This way, if the transmitting device transmits the 5-bit quantities using NRZI encoding, there will never be more than two 0s in a row transmitted (unless one 5-bit character ends with 00, and the next 5-bit character begins with a 0). If you never transmit more than two 0s in a row using NRZI encoding, then you will never have a long period in which there is no signal transition. Figure 2-14 shows the 4B/5B code in detail.

the 4B/5B digital encoding scheme

How does the 4B/5B code work? Let us say, for example, that the next 4 bits in a data stream to be transmitted are 0000, which, you can see, has a string of consecutive zeros and therefore would create a signal that does not change. Looking at the first column in Figure 2-14, we see that 4B/5B encoding replaces 0000 with 11110. Note that 11110, like all the 5-bit codes in the second column of Figure 2-14, does not have more than two consecutive zeros. Having replaced 0000 with 11110, the hardware will now transmit 11110. Because this 5-bit code is transmitted using NRZI, the baud rate equals the bps and thus is more efficient. Unfortunately, converting a 4-bit code to a 5-bit code creates a 20 percent overhead (one extra bit). Compare that to a Manchester code, in which the baud rate can be twice the bps and thus yield a 100 percent overhead. Clearly, a 20 percent overhead is better than a 100 percent overhead. Many of the newer digital encoding systems that use fiber-optic cable also use techniques that are quite similar to 4B/5B. Thus, an understanding of the simpler 4B/5B can lead to an understanding of some of the newer digital encoding techniques

No comments:

Post a Comment