CSE 2317 W1 · Class 1 Diodes as gatekeepers
Sakeef Sani ↗ ↓ PDF

CSE 2317Week 1Class 1Saturday · 11:00 AM – 12:20 PM80 min

Diodes as gatekeepers

Diode-resistor logic (DRL): the simplest gates you can build, and exactly why they are not enough.

S present · L lecturer notes · → next step · F full screen · P presenter window
01 Cold open 0–5 min

Can two switches make a decision?

Your car beeps if you are seated AND the belt is unfastened, OR the door is open AND the key is in.

Beep=(Seated⋅Belt‾)+(Door⋅Key)\text{Beep} = (\text{Seated}\cdot\overline{\text{Belt}}) + (\text{Door}\cdot\text{Key})

Somebody had to build that decision out of electricity. What is the cheapest part that can do it?

Pop culture

Minecraft players build working calculators from redstone "gates". Same idea: a gate is anything that turns input levels into an output level by a fixed rule. Today's gate-builder is the cheapest decision-maker in electronics: the diode.

Think deeper

Before we start: which part of this beep rule do you think a handful of diodes cannot build?

Argue it in pairs for two minutes. There may be more than one defensible answer.

02 Live lab 5–12 min

Inside the diode: a hill you can flatten

Inside the diode: the PN junction Drag the bias. Watch the depletion region breathe and the barrier hill shrink.
P-TYPE · holes (+) are majorityN-TYPE · electrons (−) are majoritydepletion region 1.00×−+−+−+−+−+−+−+−+−+−+−+−+−+−+ELECTRON ENERGY · the hill to climb from N into P0.70 Velectrons wait here
Diode current0.00 pA
Barrier0.70 V
03 Concept 12–18 min

The diode, four ways

Every diode analysis starts by choosing a model. The real curve is Shockley's equation. For logic we almost always use the constant-drop model.

ID=IS(eVD/nVT−1),VT=kTq≈25.9 mVI_D = I_S\left(e^{V_D/nV_T}-1\right),\quad V_T=\tfrac{kT}{q}\approx 25.9\ \text{mV}
Gotcha

0.7 V is a model, not a law. Silicon turns on gradually around 0.6–0.7 V; germanium near 0.3 V; Schottky 0.2–0.4 V; LEDs 1.8–3.3 V depending on colour.

Diode model switcher Pick a model, slide VS. The dot is where the load line meets the diode curve.

Circuit: VS → 470 Ω → diode → ground.

DiodeON
VD0.700 V
ID2.77 mA
VR1.30 V
-11357911-1-0.6-0.20.20.610.7 VQDiode voltage (V)Diode current (mA)
Diode curveLoad line
04 Concept 18–22 min

Agreeing on what a “1” is

Valid 1V ≥ VIH = 2.0 V
Forbidden zone0.8 V < V < 2.0 V: the gate may read either, or oscillate
Valid 0V ≤ VIL = 0.8 V

A wire carries a voltage, not a bit. Logic families agree on bands. We use TTL-compatible thresholds all semester.

This is positive logic: higher voltage = 1. Negative logic flips the assignment, and the same circuit then performs the dual function.

Think deeper

Why not make VIL = VIH = 1.4 V and get rid of the forbidden zone altogether?

Argue it in pairs for two minutes. There may be more than one defensible answer.

05 Live lab 22–28 min

Diode OR: the highest input wins

Diode OR gate Click the switches to flip inputs between 0 V and 5 V.
R = 10 kΩA5 VDA onB0 VDB offY4.30 V
Output4.30 V
Current in R0.430 mA
Reads asLogic 1
Boolean OR1

Anodes at the inputs, cathodes joined, a resistor to ground.

Any 5 V input forward-biases its diode and lifts the output to

Vo=Vmax−VγV_o = V_{max} - V_\gamma

Diodes on lower inputs are reverse-biased and drop out.

Pro tip

Find the input combination where no current flows at all.

06 Live lab 28–33 min

Diode AND: the lowest input wins

Diode AND gate Click the switches to flip inputs between 0 V and 5 V.
+5 VR = 4.7 kΩA5 VDA offB0 VDB onY0.70 V
Output0.70 V
Current in R0.915 mA
Reads asLogic 0
Boolean AND0

Flip the diodes; move R to the supply. R pulls up, any 0 V input drags the node down to

Vo=Vmin+VγV_o = V_{min} + V_\gamma
Pro tip

Memory trick: the conducting diode is the one that argues with the resistor. R pulls down → highest input fights back (OR). R pulls up → lowest input fights back (AND).

07 Worked example 33–39 min

Worked example: a diode AND gate

Given

Two-input diode AND, VCC = 5 V, R = 4.7 kΩ, silicon diodes (Vγ = 0.7 V). Inputs A = 0 V, B = 5 V.

Find

Vo, each diode's state, the current in R, and the logic level.

Method: assume–solve–verify, as in Boylestad Ch. 2 and Millman & Taub's diode-logic sections

Solution

Predict the answer first. Then reveal one step at a time.

08 Worked example 39–44 min

Worked example: three inputs, messy voltages

Given

Three-input diode OR, R = 10 kΩ, Vγ = 0.7 V. A = 5 V, B = 3 V, C = 0 V.

Find

Vo, the diode states and IR.

Solution

Predict the answer first. Then reveal one step at a time.

09 Live lab 44–50 min

Why nobody builds a CPU from diodes

Three fatal flaws: no inversion (not functionally complete), no power gain (every stage weakens the signal), and a Vγ tax at every gate.

Cascade meltdown Chain diode gates and watch a clean logic level walk into the forbidden zone.
Input 5.0V Logic 1
Gate 1 4.3V Logic 1
Gate 2 3.6V Logic 1
Gate 3 2.9V Logic 1
VALID 1FORBIDDENVALID 00.01.02.03.04.05.00123456Gate numberSignal level (V)

Still valid after 3 gates. Add more stages.

Unloaded gates assumed. Real cascades are worse: each following gate's resistor also loads the node.

10 Your turn 50–55 min

Your turn · 1: a “zero” that isn’t

03:00
1 Exam CQ

A three-input diode AND gate: VCC = 5 V, R = 10 kΩ, Vγ = 0.7 V.

Inputs: A = 5 V, B = 5 V, C = 0.3 V.

Find Vo, which diodes conduct, IR, and the logic level.

Work it out first.
Press Solve when the class has an answer.

11 Your turn 55–61 min

Your turn · 2: the loading trap

04:00
2 Trap

A diode OR gate (R1 = 10 kΩ to ground) has both inputs at 0 V. Its output X feeds one input of a diode AND gate (R2 = 10 kΩ to +5 V); the AND's other input is 5 V.

Find VX. Is the OR gate's output still a 0?

Work it out first.
Press Solve when the class has an answer.

12 Think deeper 61–65 min

Critical thinking · design a two-level diode circuit

3 Design

Using only diodes and 10 kΩ resistors (Vγ = 0.7 V, VCC = 5 V), build

Y=(A⋅B)+CY = (A\cdot B) + C

Find Y for (A, B, C) = (5, 5, 0), (0, 0, 5) and (5, 0, 0) V. Does every output land in a valid band? How would you improve it?

Work it out first.
Press Solve when the class has an answer.

13 Think deeper 65–68 min

Critical thinking · three short arguments

Think deeper

Input A comes from a sensor with 1 kΩ internal resistance (open-circuit 5 V) into a diode OR with R = 10 kΩ. Is the output still 4.3 V?

Argue it in pairs for two minutes. There may be more than one defensible answer.

Think deeper

A classmate says: “Use germanium diodes (Vγ = 0.3 V) and diode logic becomes cascadable.” Agree or disagree?

Argue it in pairs for two minutes. There may be more than one defensible answer.

14 Real world 68–72 min

Diode OR still ships everywhere: power ORing

Nobody builds logic from diodes today, but the diode OR lives inside every device that must never lose power. Feed a mains adapter and a battery to the load through two diodes: whichever voltage is higher supplies the load, and the other diode blocks backflow. No software, no switch, no delay.

At home: the IPS that keeps your fan running during load-shedding makes the same “whichever source is available” decision with relays and electronics.

BME corner

A bedside monitor or infusion pump cannot reboot when someone trips over the plug. Hospital equipment uses exactly this diode-OR, often with Schottky diodes or “ideal diode” MOSFET controllers to cut the 0.7 V loss. The same trick joins several bed call-buttons into one nurse-station lamp.

15 Pop quiz 72–78 min

Pop quiz

Score 0

Question 1 / 5

A two-input diode OR gate (Vγ = 0.7 V) has inputs 0 V and 5 V. The output is:

16 Recap 78–80 min

Three things to remember

01

Diode OR: highest input wins, Vmax − Vγ. Diode AND: lowest input wins, Vmin + Vγ.

02

Diode logic cannot invert, has no gain, loses 0.7 V per stage and loads its neighbours. It does not cascade.

03

The fix is a transistor that restores levels and inverts. Next class: RTL, DTL, and a moon computer built from one gate.

HW Before next class

Diode OR, R = 5 kΩ, Vγ = 0.6 V, inputs A = 4 V, B = 4.5 V. Find Vo, each diode's state and current. (Careful with DA!)

Work it out first.
Press Solve when the class has an answer.