Which type of encoding is used in USB?
Which type of encoding is used in USB? Correct Answer NRZI with bit stuffing
NRZI (Non-Return to Zero Inversion):
- The USB employs the NRZI (Non-Return to Zero Inversion) encoding mechanism to encode the data on the bus.
- In NRZI encoding, a ‘1’ is represented by no change in level while a ‘0’ is represented by change in level. Together with NRZI encoding, bit stiffing and SYNC field is used for synchronization between host and device.
- When a long series of zeros are transmitted using NRZI, it causes a transition in the levels. But when a long series of 1’s is transmitted, no transition takes place as per the NRZI encoding scheme. No transition in levels for a long time can confuse the receiver and makes it desynchronized.
[ alt="71" src="//storage.googleapis.com/tb-img/production/20/08/71.png" style="width: 510px; height: 132px;">
Bit stiffing:
- Bit-stiffing is a process in which a zero is inserted in raw data after every six consecutive ones.
- The inserting of zero causes transition in level. The receiver must recognize the stuffed bits and discard them after decoding the NRZI data.
- In case if no transition takes place in the NRZI signal after six consecutive 1’s, then the receiver decides that bit stiffing has not been done and discards the data received.
[ alt="72" src="//storage.googleapis.com/tb-img/production/20/08/72.png" style="width: 339px; height: 203px;">
SYNC field:
- The bit stiffing alone is not enough to take care of the synchronization between transmitter and receiver.
- To keep transmitter and receiver synchronized, the SYNC field is used.
- In this mechanism, each packet begins with a SYNC field which enables the receiver to synchronize the clock
[ alt="26 June 1" src="//storage.googleapis.com/tb-img/production/19/08/26%20June_1.png" style="width: 160px; height: 46px;">
Manchester encoding:
In Manchester encoding, the duration of the bit is divided into two halves.
The voltage remains at one level during the first half and moves to other levels in the second half.
Manchester codes share the property that the voltage level necessarily changes in the middle of a bit interval.
1) The transition from high to low in the middle of interval = 1
2) The transition from low to high in the middle of interval = 0
NRZ coding:
The level of voltage determines the level value of a bit.
NRZ suffers from a synchronization problem
Non-return to zero (NRZ) codes share the property that the voltage level is constant during a bit interval.
1) High-level voltage = bit 1
2) Low-level voltage = bit 0.
.
[ alt="RRB JE CS 87 13Q Networking CT 2(Hindi) - Final 1" src="//storage.googleapis.com/tb-img/production/19/04/RRB_JE_CS_87_13Q_Networking_CT_2%28Hindi%29%20-%20Final%201.PNG" style="width: 432px; height: 153px;">
Note:
In Manchester, the modulation rate is always twice that of NRZ and bandwidth correspondingly greater. Therefore, for sending the same bit sequence, NRZ encoding requires half the clock frequency as that of Manchester encoding.