How NRZI Encodes Binary Data Using Transitions
Non-Return-to-Zero-Inverted (NRZI) is a line-coding method that maps
binary data to physical signal changes rather than static voltage
levels. In contrast to traditional Non-Return-to-Zero-Level (NRZ-L)
encoding—where a high or low voltage directly corresponds to a binary
1 or 0—NRZI interprets the presence or absence
of a voltage transition at the beginning of a clock cycle to determine
the bit value. This article explains the mechanics of transition-based
encoding, demonstrates how binary streams are processed, and outlines
the practical advantages of using signal edges instead of fixed
levels.
The Mechanism of Transition-Based Encoding
In binary transmission, conventional systems use fixed voltage states
(e.g., +5V for 1 and 0V for 0). NRZI shifts
the focus from the absolute voltage level to signal dynamics
(edges).
In the standard NRZI convention (widely used in protocols like USB):
* Binary 0: Triggers a transition. The
signal flips from high to low or from low to high. * Binary
1: Causes no transition. The signal stays at its
current voltage level for the duration of the bit period.
(Note: Some protocols, such as Fast Ethernet over FDDI, invert
this convention so that a binary 1 causes a transition and
a binary 0 causes none. The underlying operational
principle remains identical.)
Because the receiver only monitors whether the signal state changed relative to the previous bit interval, the absolute polarity of the voltage does not define the data.
Step-by-Step Example
Consider the transmission of the binary sequence
0 1 0 0 1, assuming the physical line
starts at a Low voltage state:
- First bit (
0): A transition is required. The signal switches from Low to High. - Second bit (
1): No transition. The signal remains High. - Third bit (
0): A transition is required. The signal switches from High to Low. - Fourth bit (
0): A transition is required. The signal switches from Low to High. - Fifth bit (
1): No transition. The signal remains High.
The receiving hardware samples the line at each clock cycle, compares the current state to the state of the preceding cycle, and decodes the stream based solely on the presence or absence of a voltage shift.
Advantages of Transition-Based Encoding
- Clock Synchronization: Regular transitions provide timing edges that allow the receiver’s phase-locked loop (PLL) to stay synchronized with the sender’s clock without requiring a dedicated clock line.
- Polarity Insensitivity: Because decoding depends on state changes rather than absolute voltage values, the data stream is immune to accidental wire-reversals in differential signaling setups.
- Compatibility with Bit Stuffing: To prevent long
sequences of non-transitioning bits (such as consecutive
1s) from causing clock drift, protocols implement bit stuffing, inserting an artificial0after a set number of consecutive static bits to force a synchronization edge.