|
|
|
|
|
All the circuits we’ve looked at have one thing in common; their outputs are determined only by the inputs and the configuration (i.e., interconnection) of the gates. We now look at a circuit whose output is determined by its inputs, the configuration of its gates, and its previous state. Such a device is called a sequential circuit and has the property of memory, because its current state is determined by its previous state. The basic element of the sequential circuit is known as a flip-flop.
Although we are introducing a new class of circuit, the flip-flop can be constructed from the gates we have just described. Figure 4.16 provides the circuit and symbol of a simple flip-flop (output P is labeled Q* by convention). The output of NOR gate G1, P, is connected to the input of NOR gate G2. The output of NOR gate G2 is Q and is connected to the input of NOR gate G1. This circuit employs feedback, because the input is defined in terms of the output—the value of P determines Q, and the value of Q determines P.
Figure 4.16 Feedback in a logic circuit

Let’s remind ourselves about the NOR gate—its output is 0 unless both its inputs are 0. Assume that the input S to gate G1 and the input R to gate G2 are currently 0. What is the state of outputs Q and P? If we also assume that output Q = 1, the output of gate G1 is 0 (because its inputs are 0,1). The inputs to gate G2 are both 0 and its output, Q, is 1—that’s what we assumed. Now suppose that Q = 0 initially. The output of gate G1 is 1, and the inputs to G2 are 0 and 1. The output of G2 is, therefore, 0, which is also what we assumed. In other words, this circuit maintains its current state with Q = 0 or Q = 1. It’s a memory element.
Inputs R and S can be used as control inputs to change the current state of the flip-flop. If Q is in a 1 state, setting input R to 1 will force output Q to 0. Q will remain at 0 even when R goes back to 0. Similarly, if Q = 0, setting input S to 1 will force Q to 1. This type of flip-flop is called an RS flip-flop because its output can be Reset to 0 or Set to 1.
Figure 4.17 illustrates the D flip-flop which has two inputs; one is called D (or data), and the other C (or clock). The act of setting the C input to 1 is called clocking the flip-flop. Some flip-flops are clocked when the C input is at a steady logical 1 (or 0), and others are clocked by the change of clock level from 0 to 1 (or from 1 to 0).
Figure 4.17 The D flip-flop

When the D flip-flop is clocked, the value at its D input is captured and transferred to its Q output. The Q output then remains constant until the next time the flip-flop is clocked. Most flip-flops have two outputs. One output is called Q and the other is its complement, Q*. Figure 4.17 also gives the truth table of the D flip-flop. The output column is headed Q+ to indicate that it is the new output when the flip-flop is clocked. When C = 0 the output is the old output Q. We cannot say whether Q is 1 or 0, because we don’t know what the previous state was. When C = 1 and the flip-flop is clocked, the new output, Q+, takes the current value of D replaces the old value of Q.
Figure 4.18 shows how m D flip-flops can be connected together to create an m-bit register—a one-word memory element. The clock input of each of the flip-flops is connected together so that all the flip-flops are clocked at the same time. When the register is clocked, the word at its D inputs is transferred to its Q outputs and held constant until the next clock pulse.
Figure 4.18 The register
