wire / wire-format / decoder
A decoder converts an n-bit binary input to a one-hot output (2^n outputs, exactly one is 1). A 2:4 decoder: outputs D0-D3, where D[i] = 1 if input = i. Demultiplexer (DEMUX) routes a single input to one of 2^n outputs based on select bits. Decoders are used for address decoding, instruction decoding, and one-hot state machines.
aka: Decoder / demultiplexer
spec: Digital logic design
A decoder converts an n-bit binary input to a one-hot output (2^n outputs, exactly one is 1). A 2:4 decoder: outputs D0-D3, where D[i] = 1 if input = i. Demultiplexer (DEMUX) routes a single input to one of 2^n outputs based on select bits. Decoders are used for address decoding, instruction decoding, and one-hot state machines.
| field | size | meaning |
|---|---|---|
| 2:4 decoder | 2 inputs, 4 outputs | Output i = 1 if input = i. E.g., input 10 -> D2 = 1, others 0. |
| 3:8 decoder | 3 inputs, 8 outputs | Output i = 1 if input = i. Used for octal selection. |
| n:2^n decoder | n inputs, 2^n outputs | General: n-bit input to 2^n one-hot outputs. |
| Decoder with enable | n+1 inputs | Enable input gates all outputs (when E=0, all outputs are 0). |
| DEMUX | 1 data + n select | Routes data input to one of 2^n outputs based on select bits. |
| Priority encoder | 2^n inputs, n outputs | Reverse of decoder: outputs the binary code of the highest-priority active input. Used for interrupt priority. |
example:
00 00
Decoder (placeholder)
agent: curl -H 'accept: application/json' wire.phall.io/wire-format/decoder
or /wire-format/decoder.json