D N O → L0 0 0 → 00 0 1 → 10 1 0 → 00 1 1 → 11 0 0 → 01 0 1 → 11 1 0 → 11 1 1 → 1DN00011110O=0O=1L is on whenthe door is openAND it is dark,OR override is onL = D'N'O + D'N O + D N'O + D N O' + D N OA · A' = 0A + A' = 1A + A·B = AA·B + A·B' = AD'N'O + D'N O = D'OD N'O + D N O = D OL = D'O + DO + DNO'D'O + DO = OL = O + DNO'O + O'·DN = O + DNL = DN + Orow of four → Opair → DNL = DN + O9 gates → 2 gates58 → 12 transistorsL = DN + O?ANDANDANDANDORANDANDANDANDORANDORANDOR01010101DNOL11111
Lit wire with moving dashes: it carries a 1Lamps: a glowing lamp shows 1, a dark one 0Gate blocks: symbol on top, name on the frontK-map loops: groups of neighbouring 1sThe truth table lists all 8 input rows; writing one AND term for each row that gives 1 and ORing them builds a correct but large circuit. Boolean rules, or circling neighbouring 1s on the K-map, shrink it to L = DN + O. Transistor counts are for static CMOS: NOT 2, a k-input NAND or NOR 2k, and a k-input AND or OR 2k + 2 (a NAND or NOR plus a NOT). From the table: 3 × 2 + 5 × 8 + 12 = 58. Simplified: 6 + 6 = 12. Maurice Karnaugh published the map method in 1953. Its columns follow Gray code, 00, 01, 11, 10, so cells side by side, and the two end columns, differ in one input; groups are rectangles of 1, 2, 4 or 8 cells.

From rule to formula

  1. A porch light L should turn on when the door is open (D) and it is dark (N), or when the override switch (O) is on. Each input is a bit: 1 means yes, 0 means no.

Simplify with algebra

Simplify with a K-map

Why it matters

The working

;; step 1/11 · the-problem
;; about: Door open (D), Dark (N), Override (O), Light (L), Formula
D  door is open      1 yes · 0 no
N  it is dark (night) 1 yes · 0 no
O  override is on     1 yes · 0 no
L  light is on        (the output)

The rule in words:
(door open AND dark) OR override

Lamps show bits: a glowing lamp is 1, a dark one 0. A lit wire with moving dashes carries a 1. The rules used here: A·A' = 0 and A + A' = 1 (complements), A + A·B = A (absorption, also called covering) and A·B + A·B' = A (combining). Each can be checked with a 4-row truth table.