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.

Ten Copies of a 0 V Signal, with Noise Before Each StageOne stage per step. The amplifier copies its input exactly. The buffer is two SKY130 inverters in a row. Both chains get the same noise.
0123456789stage12345678910noise added (V)+0.25−0.10+0.30+0.20−0.15+0.30+0.10+0.25−0.05+0.20amplifier output (V)0.250.150.450.650.500.800.901.151.101.30buffer output (V)0.00analog 1.30 V, digital 0.00 V
Scroll horizontally ↔
  1. 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.

  2. Cycle 2

    After three stages the amplifier chain holds 0.45 V. Each stage adds its noise to the noise before it.

  3. Cycle 5

    After six stages the amplifier chain holds 0.80 V. The buffer chain still holds 0.00 V.

  4. 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.

One Hop: Sender, Wire, ReceiverArrows show the signal. The sender puts a voltage on the wire. Noise changes it. The receiver decides which bit it is and sends a clean voltage.
  • I/O
  • Source
  • Interconnect
  • Data
CallValueReturnWaiting
One hop: sender, wire, receiverArrows show the signal. The sender puts a voltage on the wire. Noise changes it. The receiver decides which bit it is and sends a clean voltage. io Sender sends 0.07 V for a 0 source Noise up to 0.30 V here interconnect Wire voltage plus noise io Receiver accepts up to 0.70 Vas 0 interconnect Next wire a clean level again sentaddedreceivedrestored
  1. io Sendersends 0.07 V for a 0
    • sent → Wire
  2. interconnect Wirevoltage plus noise
    • received → Receiver
  3. source Noiseup to 0.30 V here
    • added → Wire
  4. io Receiveraccepts up to 0.70 V as 0
    • restored → Next wire
  5. interconnect Next wirea clean level again
  1. 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
    1. data 0.07 V: Sender → Wire
  2. 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
    1. data +0.30 V: Noise → Wire
  3. 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
    1. data 0.37 V: Wire → Receiver
  4. 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
    1. 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.

DC sweepThe Inverter Transfer Curve with Its Four Levels, MeasuredThe input goes slowly from 0 V to 1.8 V. The marked points are the two places where the slope of the curve is −1.
  • v(out)
  • v(in)
00.5 V1.0 V1.5 V2.0 VVoltage00.2 V0.4 V0.6 V0.8 V1.0 V1.2 V1.4 V1.6 V1.8 VInput voltage v(in)input 0.703 V (V_IL), output 1.751 V (V_OH)input 0.939 V (V_IH), output 0.069 V (V_OL)00.5 V1.0 V1.5 V2.0 VVoltage00.5 V1.0 V1.5 VInput voltage v(in)input 0.703 V (V_IL), output 1.751 V (V_OH)input 0.939 V (V_IH), output 0.069 V (V_OL)
  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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 V1.8 V0 V
200 mV1.8 V200 mV
300 mV1.8 V300 mV
400 mV1.8 V400 mV
600 mV1.795 V600 mV
703.5 mV1.751 V703.5 mV
800 mV1.32 V800 mV
837 mV837.1 mV837 mV
939.5 mV69.24 mV939.5 mV
1 V32.74 mV1 V
1.2 V3.085 mV1.2 V
1.4 V133.3 µV1.4 V
1.5 V28.28 µV1.5 V
1.6 V6.412 µV1.6 V
1.8 V260.6 nV1.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.

LevelValueMeaning
VOH1.751 Voutput high: the lowest voltage the gate sends for a 1
VOL0.069 Voutput low: the highest voltage the gate sends for a 0
VIH0.939 Vinput high: the lowest voltage the gate accepts as a 1
VIL0.703 Vinput 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.

MarginFormulaThis inverter
Low, NM_LVIL − VOL703 − 69 = 634 mV
High, NM_HVOH − VIH1751 − 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.

SenderReceiverLow marginHigh margin
inverter, 1 µm PMOSthe same inverter703 − 69 = 634 mV1751 − 939 = 812 mV
inverter, 1 µm PMOSinverter, 2 µm PMOS742 − 69 = 673 mV1751 − 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 inVoltage outPositive logic readsNegative logic reads
low, lowlow0 0 → 01 1 → 1
low, highlow0 1 → 01 0 → 1
high, lowlow1 0 → 00 1 → 1
high, highhigh1 1 → 10 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
  1. 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.

  2. 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.

  3. 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.

RUNIcarus Verilog · in your browser
Edit the code, then run it
Expected: 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 zone

Check Yourself

Predict the outputA logic family has the levels in this program, in millivolts. It prints the low margin and then the high margin. Predict the exact line.
module tb;
  localparam int VOH = 2400, VOL = 400;
  localparam int VIH = 2000, VIL = 800;
  initial $display("%0d %0d", VIL - VOL, VOH - VIH);
endmodule
ConceptWhy does a chain of logic buffers deliver a clean level after many noisy wires?
ConceptOn a transfer curve, which input voltages form the forbidden zone?
ConceptA sender has VOH = 2.4 V. A receiver from another family has VIH = 3.5 V. What follows?
ConceptA physical gate gives a high output only when both inputs are high. What is it in negative logic?

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.

Before
NML = VIH - VOL;   // 870 mV: too good to be true
After
NML = VIL - VOL;   // 634 mV
NMH = VOH - VIH;   // 812 mV

Wrong 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.

Practice

Report a problem with this page