Decoders
On this page 6 headings
Start here A hotel has 8 rooms and a 3-digit binary room code. When the code 101 comes in, only room 5’s light should turn on, and every other light stays off. A circuit that does this is called a decoder: it turns a code into “exactly one line on”.
- n inputs → 2ⁿ outputs.
- For each input pattern, exactly one output is 1, and all the rest are 0.
- The output that turns on is the one whose number matches the input.
Names: a decoder with 2 inputs is a 2:4 decoder (or 2-to-4). With 3 inputs it’s a 3:8 decoder. With 4 inputs it’s a 4:16 decoder.
| A | B | ||||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
Equations: .
Key idea: each decoder output is a minterm. .
Lecture example — Input pattern 10 is the number 2, so only . The outputs are 0, 0, 1, 0.
- Memory addresses: the processor sends a row number; a decoder switches on that one row of memory.
- Instructions: the processor reads an instruction’s opcode (the part that says which operation); a decoder turns on the one circuit that does that operation.
Since every decoder output is a minterm, you can make any function of n variables:
- Connect the variables to the decoder inputs.
- Find the minterms where .
- OR those outputs together.
Lecture exercise — Y is 1 in every row except row 0 (0000). So (an OR of 15 outputs). Smarter: . One inverter on does the same job.
Trick: if F has many 1s, use the 0s instead: (OR of the 0-row outputs). That is a NOR gate.
Inside a decoder, each input goes through a NOT (for the barred letters), then an AND gate. So the longest path is:
delay = NOT delay + AND delay
- 4:16 decoder with ns and 4-input ns → 1 + 2 = 3 ns.
- 3:8 decoder built from NOT and 2-input ANDs (all 1 ns): a 3-input AND needs two 2-input ANDs in a chain. So 1 + 1 + 1 = 3 ns.
In one line: A decoder has n inputs and 2ⁿ outputs; exactly one output is 1, and each output is a minterm, so decoder + OR gate can build any function. Exam words: decoder, 2:4, 3:8, 4:16, one-hot output, minterm, memory address, opcode, decoder delay.
