Peter Mawhorter
When you press the power button, some wires in the computer are powered with +5V, based on the transistors, which implement a series of logic gates. The logic gates are organized into common units called “chips” or “integrated circuits” (ICs).
A clock creates cycles of high and low voltage, which creates patterns of activation over time determined by the chips. Buttons or other inputs may also create be woven into these patterns.
High/low voltage patterns in groups of wires represent numbers using binary. These numbers can also represent symbols via an encoding like ASCII.
Specialized chips create patterns of voltage from inputs to outputs which, when interpreted as binary, correspond to things like “counting” or “addition.”
A multiplexer (or mux) selects one of inputs, using “select” wires whose activation pattern is interpreted as a binary number.
We can imagine that the select inputs change which input wire (or wire group) is connected to the output.
S2 | S1 | S0 | Q |
---|---|---|---|
0 | 0 | 0 | D0 |
0 | 0 | 1 | D1 |
0 | 1 | 0 | D2 |
0 | 1 | 1 | D3 |
1 | 0 | 0 | D4 |
1 | 0 | 1 | D5 |
1 | 1 | 1 | D6 |
1 | 1 | 1 | D7 |
D0-D8 are the Data inputs
A demultiplexer (or demux) is the inverse of a multiplexer: it steers an input value (or group) onto one of outputs based on select inputs.
S1 | S0 | Q3 | Q2 | Q1 | Q0 |
---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | D |
0 | 1 | 0 | 0 | D | 0 |
1 | 0 | 0 | D | 0 | 0 |
1 | 1 | D | 0 | 0 | 0 |
D is the data input
A decoder takes an -bit binary number on wires and outputs a high signal on one of wires with the rest low.
D2 | D1 | D0 | Q7 | Q6 | Q5 | Q4 | Q3 | Q2 | Q1 | Q0 |
---|---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 |
0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 |
1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
An encoder is the opposite of a decoder: it takes inputs where only one is on at once, and has outputs which encode the position of the input that was on in binary.
Note the disconnected input: when that’s the high input, neither output is on.
A half-adder adds two one-bit values to get a 1-bit result, plus a 1-bit carry-out (which is 1 when both inputs are 1).
A full adder uses two half-adders to implement addition for 1 bit, with a carry-in and a carry-out.