class: center, middle, inverse, title-slide .title[ # Demo Day, and the Great Chip Count ] .subtitle[ ## Programmable Electronics — Unit 2 ] .date[ ### Class 20 ] --- # Learning Targets .lt-box[ - Debug a multi-chip circuit using the Debug Ladder, and explain a failure in terms of **which block** it was in. - Demonstrate a working traffic-light controller and document it so another student could rebuild it. - Estimate the transistor count of a circuit by reasoning down through its layers of abstraction — block, gate, transistor. - Answer the unit's essential question — *what does an integrated circuit hide, and what do you gain by letting it?* — with reference to a circuit you built yourself. ] .eu-label[Essential Understanding:] You have spent this unit climbing: transistors to gates, gates to blocks, blocks to a working machine. Today you climb back down one time, deliberately, and count what is under your hands. The number is the answer to the question this unit has been asking since Class 16 — and it is the reason the next unit exists. --- # Agenda .agenda-box[ 1. Finish and debug — first part of the period 2. Demos 3. The Great Chip Count 4. What it cost, what it bought 5. Where Unit 3 picks up ] --- class: center, middle # Finish and debug Boards out. If yours runs, help the bench next to you — then go and make it brighter, or give it a pedestrian button. --- class: small-font # Debugging this particular circuit **Find the block first, then the wire.** A probe on the boundary between two blocks cuts the problem in half — Debug Ladder rung 4, and on a three-chip board it beats everything else. | What you see | Block | Most likely | |---|---|---| | Nothing at all, anywhere | power | Rail not 6 V. Measure *at the far chip*, not the battery. | | No blink on the 555's own LED | clock | TRG not tied to THR; RST floating; electrolytic backwards. | | Clock blinks, lamps never change | clock → counter | The one wire, OUT (3) → CLK (14). Or INH floating, not grounded. | | One lamp on solid, forever | counter | MR tied HIGH, or fed from the wrong output — Q6 is **pin 5**. | | Cycle runs with a long dead gap | counter | MR still grounded — Q6 never got connected. | | Right lamps, wrong steps | output logic | An OR input on the wrong Q. The 4017's pins are **not** in order. | | Every lamp very dim | power / craft | Missing decoupling cap, tired cells, or the 74HC's 4 mA limit. | | One lamp never lights | output logic | LED backwards, or you wired the gate's *input* to the LED. | --- class: small-font # Demos Bring the board up front, running. Two minutes, and you will be asked three things: 1. **Show it cycle.** Red, green, yellow, back to red, at least twice around. 2. **Point at one lamp and trace it backwards.** "Green is lit because Q3 or Q4 is high, which is the counter on step 3 or 4, which is three or four ticks after reset, which is the 555 at about 0.7 Hz." All the way back to the battery, out loud. 3. **Tell me about one thing that went wrong.** What you expected, what you measured, which block it was in, what fixed it. If nothing went wrong, tell me what you checked to be sure. .emphasis[ Point 2 is the one worth practising with your partner before you come up. You are being asked whether the board is still transparent to you — whether it is a machine you understand or a machine that happens to work. ] --- class: center, middle # The Great Chip Count Your board has three chips on it. **How many transistors did you actually just use?** --- class: small-font # What a gate costs, in transistors Class 11 you built gates from transistors and resistors. Inside a 74HC chip there are **no resistors** — it's CMOS, which uses transistors in complementary pairs and nothing else: | Gate | Transistors (CMOS) | Yours in Class 11 | |---|---|---| | NOT | 2 | 1 + resistors | | NAND | 4 | 2 + resistors | | NOR | 4 | 2 + resistors | | AND | 6 *(NAND + NOT)* | 3 + resistors | | OR | 6 *(NOR + NOT)* | 3 + resistors | | XOR | 12 | ~8, combined from three gates | **Look at that carefully — CMOS uses *more* transistors per gate than your version did.** More parts, and yet it is smaller, faster, cheaper, and runs cooler than the board you built in Class 11. .font-small[ Why: on silicon a transistor is nearly free and a resistor is expensive, slow, and hot. Your Class 11 gates burned current continuously through their pull-up resistors. A CMOS gate that isn't switching draws **almost nothing**. That trade — spend transistors to stop spending current — is most of why modern logic works at all. ] --- class: small-font # Count your own board Fill this in with your partner. The last row is the interesting one — **estimate** it, and be able to defend the estimate: | Chip | What's inside | Transistors | |---|---|---| | **555** | two comparators, a latch, a divider, an output stage | **25** *(counted from the die — it's a famous number)* | | **74HC32** | four 2-input OR gates, at 6 each | **24** *(plus input protection and output buffers — the real die is bigger)* | | **4017** | a 5-stage counter that remembers, plus 10 decoding gates, plus 10 output buffers | **?** | .pull-left.w48[ **Estimating the 4017.** Don't look it up — reason it out: - It remembers 5 things. A CMOS memory cell that holds one bit is roughly **20** transistors. - It decodes those 5 into 10 outputs. Call each decoder a small gate — **6** each. - Each output needs a buffer strong enough to drive a pin — call it **4** each. ] .pull-right.w48[ `$$5(20) + 10(6) + 10(4) = 200$$` So the board is roughly `$$25 + 24 + 200 \approx \mathbf{250}\ \textbf{transistors}$$` and you placed **three parts**. ] --- # What that would have cost you In Class 11 you built six gates out of about **13 transistors**, and it took most of a period — call it **three minutes per transistor**, including the wiring, the mistakes, and the re-checking. .pull-left.w48[ | Built by hand at Class 11 rates | | |---|---| | The 74HC32's logic | ~1 hour | | The 555 | ~1 hour | | The 4017 | **~10 hours** | | **Your whole board** | **~13 hours** | ] .pull-right.w48[ You did it in **two class periods**, and most of that was deciding *what you wanted*, not wiring. That is what the chips bought you. Not the transistors — **the time, and the certainty that the inside is already correct.** ] --- class: small-font # And then keep going Your board: about **250** transistors, three parts, two periods. - The microcontroller you meet next class is on the order of a **million** transistors on one die. At three minutes each, by hand: about **six years**, working without stopping. - The processor in the phone in your pocket is on the order of **tens of billions**. There is no "by hand." There is not enough time in a human life by a factor of thousands. .emphasis[ Nobody understands a modern chip the way you understand your board. Not one person, not any team. The only reason any of it works is that each layer was verified once and then **trusted** by the layer above. ] That is not a scandal — it's the deal. You made it yourself, three times this unit: once when the transistor gate became a 74HC part, once when two gates became a half adder, once when a counter became "which step are we on." --- class: small-font # What it cost, what it bought The unit's essential question, and you now have a real answer: .pull-left.w48[ **What the chips hid** - You cannot see the capacitor charging inside the 555 any more — you get a frequency formula instead. - You cannot probe between the 4017's flip-flops. If it counts wrong, you replace it; you do not repair it. - You are trusting a datasheet, written by strangers, that you verified against exactly one truth table. ] .pull-right.w48[ **What you got** - A design you could **hold in your head** — three blocks, two wires between them. - A circuit you could **change your mind about** in five minutes, by moving one wire from Q6 to Q5. - Timing accurate enough to be *designed*, not tuned by trial and error. - Two periods instead of thirteen hours. ] .emphasis-center[ You gave up sight of the mechanism. You got back the ability to work at the scale of the idea. ] --- class: center, middle # Where Unit 3 picks up .emphasis[ Every phase length on your board is a **resistor**. Changing the timing means changing a part. ] Next unit, the whole thing — counter, phases, timing, all of it — becomes a few lines you can edit, on a chip that hides a million transistors instead of two hundred. Same intersection. You will build it again in Unit 3, in code, with a pedestrian button. Then we ask the next version of today's question: **when we replace hardware with software, what becomes easier — and what becomes harder?** --- class: center, middle # Homework .hw-box[ - **Finish your documentation** and hand it in: phase table, clock calculation, schematic of *your* build, and the diagnosis write-up. Another student has to be able to rebuild it from your pages alone. - Your board has about 250 transistors. **Pick one lamp** and write the chain from the lit LED all the way down to the level of transistors switching — block, chip, gate, transistor. Half a page. - One paragraph, for your notebook: **what did the chips hide from you, and was it worth it?** Use a specific moment from your own build — something you couldn't see, or something you could only do *because* you couldn't see it. - Bring your board **intact** to next class if you can. It's the thing Unit 3 is going to replace. ]