From transistor to adder
About this app
built yourself in five stages — a NAND from two transistors, an XOR from NANDs, then half and full adder and finally a 4-bit adder computing 7 + 9. The carry ripples through visibly, and you can zoom in all the way to the transistor.
Computing is switching
A computer calculates with transistors that act as switches: an NMOS transistor conducts when its gate is 1, a PMOS transistor when it is 0. Four transistors in CMOS technology form a NAND gate. NANDs can build NOT, AND, OR and XOR, these a half adder for two bits and a full adder that also handles a carry. Chaining four full adders gives a 4-bit ripple-carry adder: the carry travels from position to position. Every level hides the one below, yet physically it all remains a flow of current.
What the app shows
Five levels climb the ladder of abstraction: the transistor as a switch, the CMOS NAND, gates built from NANDs, half and full adder, and the 4-bit adder with switches for two numbers. Signals glow along the wires and the simulation runs with visible gate delay, so you see the carry ripple through the chain. A truth table fills in live, and zooming in takes you from the adder through a gate down to the transistors.
Try it yourself
In the build area you place components and connect their ports. “Check” tells you whether the level's goal is met, and a model solution shows one possible layout. In the last level set 7 + 9: the result 16 needs five bits, and you see the carry travel through all four positions.
Frequently asked questions
- How do transistors make a logic gate?
- In CMOS, PMOS transistors, which conduct at 0, sit between the supply and the output, and NMOS transistors, which conduct at 1, sit between the output and ground. For a NAND, two PMOS are in parallel and two NMOS in series: only when both inputs are 1 is the output pulled to 0.
- What is a full adder?
- A full adder adds three bits: two operand bits and an incoming carry. It outputs a sum bit and an outgoing carry. It can be built from two half adders and an OR gate.
- How does a ripple-carry adder work?
- Several full adders are chained; the outgoing carry of each position is the incoming carry of the next. This is simple but slow, because the result is only settled once the carry has passed through every position. Faster adders compute carries in advance (carry lookahead).
- What do I build in From transistor to adder?
- Across five levels: a transistor switch, a CMOS NAND, NOT, AND, OR and XOR from NANDs, half and full adder, and a 4-bit adder. Each level has a goal to check, a model solution and a truth table that fills in live.
Subject: Computer science
More from Computer science
- Ackermann function
- Elevator simulator
- Binary workshop
- Binary versus linear search
- The Collatz problem
- Inside a CPU
- Swap the inside
- One frame in 16 milliseconds — how a game engine renders an image (3D)
A VisuApp by heyprof: interactive, free in your browser, no sign-up. What is a VisuApp? · All apps