The Digital Abstraction: Bits, Logic Levels and Noise Margins
See how a gate turns a noisy voltage into a clean 0 or 1, and compute noise margins from four levels.
You Will Be Able To
- Explain why a chain of gates does not collect noise.
- Read VOH, VOL, VIH and VIL from a transfer curve.
- Compute the low and the high noise margin.
- State the static discipline and the two logic conventions.
- Lesson
- G2.1
- Time
- 20 min
- Runs on
- Your browser
- Check
- 5 questions
A 0 V signal is copied through ten stages. Each wire adds a little noise, never more than 0.30 V. With ten plain amplifiers the 0 V arrives as 1.30 V, which looks like a 1. With ten logic buffers it arrives as 0.00 V.
- Cycle 0
Stage 1 gets 0 V plus 0.25 V of noise. The amplifier passes 0.25 V on. The buffer sends a clean 0.00 V.
- Cycle 2
After three stages the amplifier chain holds 0.45 V. Each stage adds its noise to the noise before it.
- Cycle 5
After six stages the amplifier chain holds 0.80 V. The buffer chain still holds 0.00 V.
- Cycle 9
After ten stages the amplifier chain holds 1.30 V. A receiver would read that as a 1. The buffer chain is still at 0.00 V.
Measured with ngspice 42 on SKY130 at 1.8 V. A buffer removes the noise before the next wire adds more.
Why Digital: Every Gate Restores the Level
A bit has two values, 0 and 1. A wire carries a bit as a voltage. Here a low voltage means 0 and a high voltage means 1.
A logic gate does not copy its input voltage. It decides whether the input is a 0 or a 1, and then sends a fresh, full voltage.
- I/O
- Source
- Interconnect
- Data
- The sender sends a 0
The sender's output for a 0 is at most 0.07 V. This level is called VOL.
Follow the calls, values and waits
- data 0.07 V: Sender → Wire
- The wire adds noise
Noise of 0.30 V lifts the voltage to 0.37 V. The value on the wire is no longer clean.
Follow the calls, values and waits
- data +0.30 V: Noise → Wire
- The receiver decides
The receiver accepts anything up to 0.70 V as a 0. So 0.37 V is still a 0, with room to spare.
Follow the calls, values and waits
- data 0.37 V: Wire → Receiver
- The level is restored
The receiver sends a full level of its own. The noise of this hop is gone before the next hop starts.
Follow the calls, values and waits
- data full level: Receiver → Next wire
Read the diagram as text
- Sender: sends 0.07 V for a 0
- Noise: up to 0.30 V here
- Wire: voltage plus noise
- Receiver: accepts up to 0.70 V as 0
- Next wire: a clean level again
- Sender → Wire: sent
- Noise → Wire: added
- Wire → Receiver: received
- Receiver → Next wire: restored
Noise is removed at every gate. That is why a billion gates in a row still compute the right answer.
The amplifier chain in the trace above has no such step. Its noise adds up from stage to stage. This is the main reason that computers are digital.
Four Levels on the Transfer Curve
The transfer curve of a gate plots its output voltage against its input voltage. This one is an inverter, so a low input gives a high output.
- v(out)
- v(in)
- Input voltage v(in) 300 mVv(out) = 1.8 V · v(in) = 300 mV
A low input gives a flat, high output. Small changes of the input do not reach the output here.
- Input voltage v(in) 703.5 mVv(out) = 1.751 V · v(in) = 703.5 mV
At 0.703 V the slope reaches −1. This input is VIL, the highest valid 0. The output here is VOH, 1.751 V.
- Input voltage v(in) 837 mVv(out) = 837.1 mV · v(in) = 837 mV
Between the two points the curve is steep. A small change of the input makes a large change of the output.
- Input voltage v(in) 939.5 mVv(out) = 69.24 mV · v(in) = 939.5 mV
At 0.939 V the slope is −1 again. This input is VIH, the lowest valid 1. The output here is VOL, 0.069 V.
- Input voltage v(in) 1.5 Vv(out) = 28.28 µV · v(in) = 1.5 V
A high input gives a flat, low output. Noise on the input is again not passed on.
Read the plot as a table
| Input voltage v(in) | v(out) | v(in) |
|---|---|---|
| 0 V | 1.8 V | 0 V |
| 200 mV | 1.8 V | 200 mV |
| 300 mV | 1.8 V | 300 mV |
| 400 mV | 1.8 V | 400 mV |
| 600 mV | 1.795 V | 600 mV |
| 703.5 mV | 1.751 V | 703.5 mV |
| 800 mV | 1.32 V | 800 mV |
| 837 mV | 837.1 mV | 837 mV |
| 939.5 mV | 69.24 mV | 939.5 mV |
| 1 V | 32.74 mV | 1 V |
| 1.2 V | 3.085 mV | 1.2 V |
| 1.4 V | 133.3 µV | 1.4 V |
| 1.5 V | 28.28 µV | 1.5 V |
| 1.6 V | 6.412 µV | 1.6 V |
| 1.8 V | 260.6 nV | 1.8 V |
Measured with ngspice 42 on SKY130, 1.8 V, both transistors 1 µm wide (400 of 1801 points).
Where the curve is flat, the gate hides input noise. Where it is steep, the gate makes noise larger. The two points with slope −1 are the borders.
| Level | Value | Meaning |
|---|---|---|
| VOH | 1.751 V | output high: the lowest voltage the gate sends for a 1 |
| VOL | 0.069 V | output low: the highest voltage the gate sends for a 0 |
| VIH | 0.939 V | input high: the lowest voltage the gate accepts as a 1 |
| VIL | 0.703 V | input low: the highest voltage the gate accepts as a 0 |
Measured on the curve above. Lesson G9.1 shows the transistors that make this curve.
Noise Margins and the Forbidden Zone
A sender is better than the receiver needs. The gap between the two is the noise margin: the noise a signal can collect and still be valid.
| Margin | Formula | This inverter |
|---|---|---|
| Low, NM_L | VIL − VOL | 703 − 69 = 634 mV |
| High, NM_H | VOH − VIH | 1751 − 939 = 812 mV |
Computed by the lab below from the measured levels, rounded to 1 mV.
The noise in the chain above was at most 300 mV. That is under both margins, so every buffer saw a valid level.
Inputs between VIL and VIH form the forbidden zone, from 0.703 V to 0.939 V here. A gate makes no promise about its output for such an input.
The Static Discipline
The static discipline is a promise each gate makes. Given valid input levels, it produces valid output levels.
Gates can talk to each other only when their levels fit. The sender's VOL must be below the receiver's VIL. The sender's VOH must be above the receiver's VIH.
| Sender | Receiver | Low margin | High margin |
|---|---|---|---|
| inverter, 1 µm PMOS | the same inverter | 703 − 69 = 634 mV | 1751 − 939 = 812 mV |
| inverter, 1 µm PMOS | inverter, 2 µm PMOS | 742 − 69 = 673 mV | 1751 − 989 = 762 mV |
Measured on SKY130. The receiver with the wider PMOS accepts 0s up to 742 mV, but needs 989 mV for a 1.
Both margins are positive in both rows, so these gates obey the discipline together. A negative margin would mean that a clean output is already invalid at the next input.
A set of gates that share supply and levels is a logic family. Inside one family you can connect any output to any input.
Positive and Negative Logic
Which voltage is the 1 is a choice. Positive logic calls the high voltage 1. Negative logic calls the low voltage 1.
| Voltage in | Voltage out | Positive logic reads | Negative logic reads |
|---|---|---|---|
| low, low | low | 0 0 → 0 | 1 1 → 1 |
| low, high | low | 0 1 → 0 | 1 0 → 1 |
| high, low | low | 1 0 → 0 | 0 1 → 1 |
| high, high | high | 1 1 → 1 | 0 0 → 0 |
One physical gate. In positive logic it is an AND gate. In negative logic the same gate is an OR gate.
This course uses positive logic. Negative logic returns in G2.5 as active-low signals, whose names end in _n.
Asked in interviews
What is a noise margin?
It is the noise a signal can collect between two gates and still be read correctly. The low margin is VIL − VOL. The high margin is VOH − VIH. The sender gives the output levels and the receiver the input levels.
Why are digital circuits more robust than analog ones?
Each gate restores its output to a full level, so noise does not pass from stage to stage. In an analog chain the noise of every stage adds up. The price is that each wire carries only one bit.
How are VIL and VIH defined on a transfer curve?
They are the two input voltages where the slope of the curve is −1. Outside them the gain is below one, so noise shrinks. Between them the gain is above one, so noise grows.
Try It
The four constants are the levels from the figure, in millivolts. The program prints both margins. Then it adds more and more noise to a 0.
Up to 600 mV the 0 stays at or below VIL. At 800 mV it lands at 869 mV, between VIL and VIH.
Change the receiver: set VIH = 989 and VIL = 742, the inverter with the 2 µm PMOS. The low margin becomes 673 mV and the high margin 762 mV.
Add a second loop for a 1: it leaves at VOH, and noise pulls it down. It stays valid while VOH - noise >= VIH.
NML = 634 mV NMH = 812 mV noise 200 mV: arrives at 269 mV, a valid 0 noise 400 mV: arrives at 469 mV, a valid 0 noise 600 mV: arrives at 669 mV, a valid 0 noise 800 mV: arrives at 869 mV, in the forbidden zoneCheck Yourself
Common Mistakes
Wrong Take half the supply as the line between 0 and 1.
There are two lines with a gap between them. This inverter needs 0.703 V or less for a 0 and 0.939 V or more for a 1.
Fix Use VIL and VIH of the receiving gate. A voltage between them is no valid level.
Wrong Subtract the wrong pair: VIH − VOL, or VOH − VIL.
A margin compares what is sent with what is accepted for the same logic value.
Fix Low margin: VIL − VOL. High margin: VOH − VIH.
NML = VIH - VOL; // 870 mV: too good to be trueNML = VIL - VOL; // 634 mV
NMH = VOH - VIH; // 812 mVWrong Read the output levels of one gate and the input levels of the same gate, when another gate receives.
The margin belongs to a pair: the sender's output levels and the receiver's input levels.
Fix Take VOH and VOL from the sender, and VIH and VIL from the receiver.
Wrong Assume a 1 always means the high voltage.
That is positive logic. In negative logic the low voltage is the 1, and the same gate has another name.
Fix Check the convention. An AND gate in positive logic is an OR gate in negative logic.
Remember
- A gate restores its output to a full level, so noise does not add up along a chain.
- VOH and VOL are what a gate sends. VIH and VIL are what it accepts.
- NM_L = VIL − VOL and NM_H = VOH − VIH: 634 mV and 812 mV for this inverter.
- Inputs between VIL and VIH are in the forbidden zone.
- Static discipline: valid inputs give valid outputs. Positive logic calls the high voltage 1.