Daisy I: Logic gates3 min read
All computer chips are made from the same building blocks: elementary logic gates. A logic gate is a physical device that implements a mathematical logic (Boolean) function. The simplest example of a logic gate is the
NOT gate. It takes a single input and outputs its inverse. If the signal is ON, the inverter outputs OFF and vice versa. These gates can be constructed in many different ways but their logic behaviour remains consistent across all computers.
For this project, I started with the
Nand gate and then built all other gates from it. These standard set of gates were then used to construct the computer’s processing and storage chips.
Nand: the special one
Nand gate is designed to compute the following Boolean function:
| Input A | Input B | Nand(A, B) | | ------- | ------- | ---------- | | 0 | 0 | 1 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |
Nand function has an interesting property. Each one of the operations
Not can be constructed from it, and it alone.
x Or y = (x Nand x) Nand (y Nand y)
Since every Boolean function can be constructed from
Not operations using the canonical representation method, it follows that every Boolean function can be constructed from
Nand function alone. This is why
Nand gate was chosen as the primitive gate and the foundational element of all other gates in the project.
Not16, a 2-input bitwise NOT, where each input is 16 bits wide
And16, a 2-input bitwise AND, where each input is 16 bits wide
Or16, a 2-input bitwise OR, where each input is 16 bits wide
Mux16, a 2-input, 16-bit multiplexor
Or8Way, a 8-input OR gate
Mux4Way16, a 4-input, 16-bit multiplexor
Mux8Way16, a 8-input, 16-bit multiplexor
DMux4Way, a 4-output demultiplexor
DMux8Way, a 8-output demultiplexor