Section 04 of 10 · 16 entries
Digital logic
Bits, gates, truth tables, adders and flip-flops: how ones and zeros become arithmetic and memory.
Entries in Digital logic
- AND gateAn AND gate outputs 1 only when all of its inputs are 1.Y = A · Binteractive demo
- Binary place valueIn binary each digit position is worth twice the one to its right: 1, 2, 4, 8, 16 and so on. A number's value is the sum of the place values that hold a 1.value = Σ b_i × 2^i (i = 0 for the rightmost bit)interactive demo
- Bits and bytesA bit is a single binary digit, 0 or 1. A byte is 8 bits. n bits can represent 2^n different values.number of values = 2^n
- D flip-flopA D flip-flop stores one bit. On each rising clock edge it copies its D input to its Q output and holds that value until the next edge.Q(next) = D at the rising clock edge
- De Morgan's lawsNOT (A AND B) equals (NOT A) OR (NOT B), and NOT (A OR B) equals (NOT A) AND (NOT B).NOT(A · B) = Ā + B̄interactive demo
- Full adder and ripple-carry adderA full adder adds three bits (A, B and a carry in) to give a sum and a carry out. Chaining n of them, each carry out feeding the next carry in, makes an n-bit ripple-carry adder.S = A ⊕ B ⊕ C_in
- Half adderA half adder adds two single bits and gives a sum bit (A XOR B) and a carry bit (A AND B).S = A ⊕ Binteractive demo
- HexadecimalHexadecimal is base 16, using digits 0–9 and A–F. Each hex digit stands for exactly four bits, so two hex digits describe one byte.value = Σ h_i × 16^iinteractive demo
- MultiplexerA multiplexer passes one of several data inputs to a single output, chosen by a binary number on its select lines; 2^k inputs need k select lines.inputs = 2^k for k select lines
- NAND and NOR (universal gates)NAND outputs 0 only when all inputs are 1; NOR outputs 1 only when all inputs are 0. Either one alone can build every other logic function.NAND: Y = NOT (A · B)interactive demo
- NOT gate (inverter)A NOT gate has one input and outputs its opposite: 0 becomes 1 and 1 becomes 0.Y = NOT A (written Ā or A′)interactive demo
- OR gateAn OR gate outputs 1 when at least one of its inputs is 1.Y = A + Binteractive demo
- Propagation delayPropagation delay is the time a gate's output takes to respond to a change at its input. The slowest path between flip-flops, the critical path, sets the fastest safe clock.t_clock ≥ t_clk→Q + t_logic + t_setup
- Truth tableA truth table lists the output of a logic function for every possible combination of its inputs; n inputs need 2^n rows.rows = 2^n for n inputsinteractive demo
- Two's complement (signed integers)Two's complement represents negative integers so that ordinary binary addition still works: the top bit has a negative place value, so an n-bit number ranges from −2^(n−1) to 2^(n−1) − 1.value = −b_(n−1) × 2^(n−1) + Σ_(i<n−1) b_i × 2^iinteractive demo
- XOR gateAn XOR gate outputs 1 when its inputs are different and 0 when they are the same.Y = A ⊕ B = A·B̄ + Ā·Binteractive demo