Template: 3-to-8 Decoder
Three-bit decoder with eight outputs. Advanced address decoding for larger memory and I/O systems.
What You'll Learn
- Convert a 3-bit binary code into one of 8 one-hot output lines.
- Read the 3-to-8 decoder truth table — 8 input rows, 8 outputs, exactly one high per row.
- Write each output as a unique 3-input minterm of A2, A1, A0.
- See how decoders scale: 3 inputs → 8 outputs; 8 inputs → 256 outputs; etc.
- Apply for memory row select, chip select, and instruction-class decode.
How It Works
A 3-to-8 decoder takes a 3-bit input (A2 A1 A0) and asserts exactly one of eight outputs (Y0–Y7) — the one whose index equals the binary value of the input.
For example, A2A1A0 = 101 (decimal 5) asserts Y5 = 1; all others stay at 0. Each output Yi = the i-th 3-variable minterm: Y0 = ¬A2¬A1¬A0, Y1 = ¬A2¬A1·A0, ..., Y7 = A2A1A0.
Decoders scale linearly in outputs (one minterm per output) but the input width is logarithmic (3 input bits → 8 outputs). This makes them efficient for address decoding in memory systems where wide addresses must select unique storage cells.
A 3-to-8 decoder built from gates uses 8 three-input ANDs plus 3 NOTs (the inverters can be shared across all minterms). It's compact and fast — one logic level deep after the input inverters.
Truth Table
Each of the 8 input codes asserts exactly one output. The output index equals the binary value of the input.
| Inputs | Output | |||
|---|---|---|---|---|
| A2 | A1 | A0 | Active | |
| 0 | 0 | 0 | 1 | Code 0 → Y0 |
| 0 | 0 | 1 | 1 | Code 1 → Y1 |
| 0 | 1 | 0 | 1 | Code 2 → Y2 |
| 0 | 1 | 1 | 1 | Code 3 → Y3 |
| 1 | 0 | 0 | 1 | Code 4 → Y4 |
| 1 | 0 | 1 | 1 | Code 5 → Y5 |
| 1 | 1 | 0 | 1 | Code 6 → Y6 |
| 1 | 1 | 1 | 1 | Code 7 → Y7 |
Boolean Expression
Each output is the i-th 3-variable minterm. With 3 inputs there are 2³ = 8 minterms — one per output.
Try It Step-by-Step
Set the inputs in the embed above, then read what should happen and confirm.
- 1A2 = 0 A1 = 0 A0 = 0Expected:
Y0=1, others=0What you'll see: Code 0 → Y0. The 'home' position of any binary decoder. - 2A2 = 0 A1 = 1 A0 = 1Expected:
Y3=1, others=0What you'll see: Code 011 = 3 → Y3 lights. The active output index matches the binary input value. - 3A2 = 1 A1 = 0 A0 = 0Expected:
Y4=1, others=0What you'll see: Code 100 = 4 → Y4. Flipping just the high bit jumps to the upper half. - 4A2 = 1 A1 = 1 A0 = 1Expected:
Y7=1, others=0What you'll see: All 1s → Y7, the last output. Walk through 0–7 to see the active line shift one step at a time.
Components Used
Real-World Applications
Memory address row decoding. A small RAM with 8 rows uses a 3-to-8 decoder driven by 3 address bits to select the row to read or write.
8-output chip-select. A microcontroller addressing 8 peripheral chips uses a 3-to-8 decoder driven by 3 high-order address bits.
Display digit selection. Multiplexed 8-digit displays cycle through digit-strobe lines via a 3-to-8 decoder.
Octal-to-decimal logic. Older octal computer systems used 3-to-8 decoders to convert internal octal codes to one-hot indicator lines.
Instruction class decode. A CPU's opcode field's top 3 bits often select one of 8 instruction classes via a 3-to-8 decoder, with each class running its own micro-sequencer.