Decoders and Encoders
Guy Even, Moti Medina · Cambridge University Press eBooks · 2012
Consider the following problem. We need a combinational circuit that controls many devices numbered 0, 1, …, 2 k − 1. At every moment, the circuit instructs exactly one device to work while the others must be inactive. The input to the circuit is a k -bit string that represents the number i of the device to be active. Now, the circuit has 2 k outputs, one for each device, and only the i th output should equal 1; the other outputs must equal zero. How do we design such a circuit? The circuit described previously is known as a decoder . The circuit that implements the inverse Boolean function is called an encoder . In this chapter, we specify and design decoders and encoders. We also prove that the combinational circuit are correct, namely, they satisfy the specification. Moreover, we prove that these designs are asymptotically optimal. BUSES We begin this section by describing what buses are. Consider a circuit that contains an adder and a register (a memory device). The output of the adder should be stored by the register. Suppose that the adder outputs 8 bits. This means that there are eight different wires that emanate from the output of the adder to the input of the register. These eight wires are distinct and must have distinct names. Instead of naming the wires a, b, c , …, we often use names such as a [0], a [1], …, a [7].