Skip to main content
Logo image

Section 4.2 One-hot decoders

A multiplexer selects one of two or more inputs, according to the value of one or more select bits. The one-hot decoder, introduced previously in Figure 1.3.2 and Checkpoint 1.4.3, goes the other way: it activates one of its outputs, according to the value of its select bits, Figure 4.2.1. The additional enable input, G, must be ’1’ in order for any output to be activated. If it is ’0’, then all outputs are off. Although, as shown in the figure, the decoder can be thought of as a demultiplexer, potentially routing a multi-bit data input to one of several multi-bit outputs, the more common application is to use the decoder with only single-bit outputs, to provide control signals to other components.
described in detail following the image
Two-to-four decoder
Figure 4.2.1. A two-to-four one-hot decoder, drawn two ways. (Left) As a "demultiplexer", with select inputs S and data input G. (Right) As a decoder block, with with select inputs S enable input G. The notation on the right is preferred in this class. The select bits may be drawn as a two-bit bundle, as shown here, or as two individual wires, whichever is more convenient for the designer.

Checkpoint 4.2.2.

Revisit Figure 1.3.2 and Checkpoint 1.4.3, adding the enable input \(G\text{.}\) Also draw a logic diagram, using NAND and NOT gates.
Answer.
The truth table, with enable input added, is:
\(G\) \(n_1\) \(n_0\) \(y_3\) \(y_2\) \(y_1\) \(y_0\)
0 0 0 0 0 0 0
0 0 1 0 0 0 0
0 1 0 0 0 0 0
0 1 1 0 0 0 0
1 0 0 0 0 0 1
1 0 1 0 0 1 0
1 1 0 0 1 0 0
1 1 1 1 0 0 0
And the logic equations are:
\begin{align*} y_0 \amp= G \cdot \overline{n_1} \cdot \overline{n_0} \\ y_1 \amp= G \cdot \overline{n_1} \cdot n_0 \\ y_2 \amp= G \cdot n_1 \cdot \overline{n_0} \\ y_3 \amp= G \cdot n_1 \cdot n_0 \end{align*}
(Spoiler alert) Please attempt the preceding exercise before watching this video.

Checkpoint 4.2.3.

Draw a logic diagram using a one-hot decoder block (not gate-level logic) to activate one of four LEDs — RED, YELLOW, GREEN, BLUE —, depending on a binary input — "00", "01", "10", "11", respectively. An additional control signal disables all four LEDs.