COMMON LOGIC CIRCUITS
There are several types of logic circuits that occur again and again in digital equipment. The counters and registers just described are good examples. A few others that you may encounter are described in this section. Remember that these circuits can be made from individual gates and FFs in IC form. You can also buy them in IC form already wired for their specific function. But mostly these circuits appear as a collection of circuits inside some larger IC.
Multiplexer
A multiplexer or mux is a circuit with two or more inputs and one output (see Figure 5.20). Here there are four inputs and one output. Two other inputs are used to select one of the inputs to appear as the output. The four selected inputs are 00, 01, 10, and 11. In the figure, note which input is routed to the output with each input select code. Multiplexers can have as many inputs as needed.
Demultiplexer
A demultiplexer or demux is the opposite of a mux. It has one input and multiple outputs. Like the mux, select inputs specify which of the output lines the input is connected to.
Decoder
A decoder is a circuit that can detect a specific binary code. In its simplest form, it is just an AND gate, as shown in Figure 5.21A. If the input 0110 appears at the inputs, the AND gate will have all its inputs at binary 1, so the output will be binary 1 indicating that it is detecting the desired input. For any other 4-bit input, the output will be binary 0.
Decoders can also be made to detect all states of a given binary input. For example, a 4-bit decoder like that in Figure 5.21B looks at the 4-bit inputs and decodes all states from 0000 to 1111. If the input is 1000, the 8 output is binary 1 and all other outputs are 0.
Comparators
A comparator takes two binary words as inputs and compares them. If the two inputs are equal, a binary 1 output occurs. Otherwise, if the two inputs are different, the output is 0. Some comparators have outputs that can tell if one input is larger than or smaller than the other.
Arithmetic Circuits
Digital logic does a good job of basic arithmetic functions like add and sub- tract. The basic computing element is called an arithmetic logic unit (ALU). It does binary addition and subtraction. It can also perform basic logic operations such as AND, OR, or XOR on two binary input words. Circuits for multiplication and division are more complex, but are common in digital computers.