• Aucun résultat trouvé

Non-Return to Zero (NRZ) Coding

Chapter 2. A Review of Digital Transmission Technology

2.2 Electrical Transmission

2.2.1 Non-Return to Zero (NRZ) Coding

If the bit stream is to be sent as changes of voltage on a wire then the simplest coding possible is NRZ.

Bit Values 1 El 1 1 El El El 1 1 1 El

I I I I I I I I I I

Signal

:m I I Lf

Value

Bit

Startpoints~

Figure 1. NRZ Coding

5 Strictly, the word "modulation" means imposing changes onto a "carrier" signal in order to transmit information. In baseband transmission there is no carrier signal to be modulated, the digital bit stream is placed directly on the wire (or fibre).

Nevertheless, most authors use the term modulation to describe the coding of a baseband digital signal.

Chapter 2. A Review of Digital Transmission Technology 13

Here a "1" bit is represented as a

+

voltage (or current in one direction) and a

"0" bit is represented as a - voltage (or current in the opposite direction).6 This method of coding is used for short distance digital links such as between a data terminal device and a modem (the RS.232 or V.24 interface uses NRZ coding).

If a transmitter places a stream of bits on a wire using the NRZ coding technique, how can it be received? This is the core of the problem.

Transmission is easy, recreating the original bit stream at a receiver can be quite difficult.

On the surface it looks simple. All the receiver has to do is look at its input stream at the middle of every bit time and the state of the voltage on the line will determine whether the bit is a zero or a one.

But there are two important problems:

1. There is no timing information presented to the receiver to say just where the middle of each bit is.

The receiver must determine where a bit starts and then use its own

oscillator (clock) to work out where to sample the input bit stream. But there is no economical way of ensuring that the receiver clock is running at exactly the same rate as the transmitter clock. That is, oscillators can be routinely manufactured to a tolerance of .0050/0 but this is not close enough.

2. The signal will be changed (distorted) during its passage over the wire. See Figure 14 on page 33.

The signal will have started off as a sharp "square wave" at the transmitter and will be decidedly fuzzy when it gets to the receiver. The signal will no longer be just a positive or negative voltage. Instead, the voltage will change from one state to the other "slowly" passing through every intermediate voltage state on the way.

The receiver must now do two things:

1. Decide what line state is a zero and what state is a one.

A simple receiver might just say "any positive voltage represents a one and any negative voltage a zero. This will be adequate in many situations, but this is by no means adequate in all situations as will be seen later.

2. Decide where bits begin and end.

As a zero bit changes to a one bit the voltage will rise (perhaps quite slowly) from one state to the other. Where does one bit end and the next begin.

3. Decide where a new bit begins and an old one ends even if the line state does not change!

When one bit is the same as the one before then the receiver must decide when one bit has finished and another begun. Of course, in data, it is very common for long strings of ones and zeros to appear, so the receiver must

6 In fact, there is a simpler way of representing the information. A 1 bit might be the presence of a voltage and a zero bit the absence of a voltage. (Early morse code systems did use the absence of a voltage to delimit the start and end of each "dot"

or "dash".) This technique is not used in modern digital signaling techniques because it is "unbalanced". The need for direct current (DC) balancing in digital codes is discussed later.

be able to distinguish between bits even when the line state hasn't changed for many bit times.

With simple NRZ coding this is impossible and something must be done to the bit string to ensure that long strings of zeros or ones can't occur.

A simple receiver might operate in the following way:

1. Sample the line at defined intervals faster than the known bit rate on the line (say seven times for every bit).

When there is no data being sent, the line is usually kept in the one state.

2. When a state change is detected, this could be the start of a bit. Start a timer (usually a counter) to wait for half a bit time.

3. When the timer expires, look at the line. If it is the same as before then receive the bit. If not then the previous state change detected was noise -go back to 1 (looking for the start of a bit).

4. Set the timer for one full bit time.

5. Monitor the line for a change of state. If a change is detected before the timer expires then go back to step 2.

6. When the timer expires receive the bit.

7. Go to step 4

In the jargon the above algorithm is called a "Digital Phase Locked Loop"

(DPLL). Consider what's happening here:

• The receiver is using the change of state from one bit to another to define the beginning of a bit (and the end of the last).

• When there are no changes, the receiver's clock is used to decide where the bits are.

• Whenever there is a state change, the receiver re-aligns its notion of where the bits are.

Successful operation is clearly dependent on:

• How good the receiver is at deciding when a state change on the line has occurred. (Since this is often gradual voltage change rather than an abrupt one, this is a judgement call on the part of the receiver.)

• How accurate the receiver's clock is in relation to the transmitters.

• How many times per bit the stream is sampled.

Some practical systems in the past have used as few as five samples per bit time. The IBM 3705 communications controller (when receiving bits without an accompanying timing signal) sampled the stream 64 times per bit.

Today's systems, using a dedicated chip for each line, often sample the line at the full clock frequency of the chip. The more frequent the sampling, the more accurate will be the result.

The above technique (the DPLL) is very simple and can be implemented very economically in hardware. But it is also very rough.

Notice here that the bit stream has been recovered successfully but the exact timing of the received bit stream has not. This doesn't matter to the example since the objective was to transfer a stream of bits, not synchronise timing.

Later however, there will be situations where accurate recovered timing is critical to system operation.

Chapter 2. A Review of Digital Transmission Technology 15

Frequent state transitions are needed within the bit stream for the algorithm to operate successfully. The maximum number of bits without a transition is determined by the quality of the transmission line and the complexity of the receiver. Typical values for the maximum length of strings of ones or zeros in practical systems are between three and six bits.