3 Models for Sequential Circuits Block diagram representation: Figure 6.1State Tables and Diagrams: the functional relationship that exists among the input, output, present state, and next state is illustrated by either the state table or the state diagram.The state diagram is a graphical representation of a sequential circuit in which the states are represented by circles and the state transitions (the transfer from the present state y to the next state Y) are shown by arrows.The state table lists the inputs across the top, the outputs along the left side, with the entries in the table being the next state and output for each input and present state.
5 Example 6.1 State tables and Diagrams Consider a sequential circuit having one input variable x, two state variables y1 and y2, and one output variable z.Inputs: x = 0x = 1States: [y1,y2] =  A[y1,y2] =  B[y1,y2] =  C[y1,y2] =  DOutputs: z = 0z = 1The state diagram for this circuit is shown in Fig. 6.3
6 Example 6.1 (continued)Now assume the circuit is initially in state A.If an input of x = 0 is applied the next state is D and the output is 0.Consider the application of the following input sequence to the circuitx =The circuit will behave as follows:present state: A D B A D B B A C C Cinput:next state: D B A D B B B A C C Coutput:
7 Example sequential circuit State tableFigure 6.3State diagram
8 Memory DevicesMemory elements exist indefinitely in one of two possible states,0 and 1.Binary data are stored in a memory element by placing the element into the 0 state to store a 0 and into the 1 state to store a 1.The output Q of the circuit indicates the present state of the memory.The two memory element types most commonly used in switching circuits are latches and flip-flops.Latches are devices whose excitation inputs control the state of the device.A flip-flop differs from a latch in that it has a control switch called a clock. This means a flip-flop waits for its clock signal before changing states. The final state of a flip-flop is determined by its excitation values at the time the clock signal occurs.
9 Table 6.1 TTL Memory Elements  Number ofDevice Elements Element Description74LS73A747474LS757476741117411674175742737427674279248Negative-edge triggered flip-flop with clearPositive-edge triggered D flip-flop with preset and clearD latch with enablePulse-triggered JK flip-flop with preset and clearMaster-slave JK flip-flop with preset, clear, data lockout4-Bit hazard-free D latch with clear and dual enablePositive-edge triggered D flip-flop with clearNegative-edge triggered JK flip-flop with preset, clearSR latch with active-low inputs
10 Set-reset latch Figure 6.7 S latch redrawn SR latch Traditional view of SR latchLogic symbol of SR latchFigure 6.7
11 NAND SR Latch Figure 6.8 Logic diagram Storage mode Reduced logic Logic symbol 1Logic symbol 2Figure 6.8
12 SR Latch Timing Diagrams The operation of any latch circuit may be described using a timing diagram.The diagram shown in Fig. 6.9 shows that placing logic 1 signals on both the R and S inputs forces both outputs, Q and Q, to logic 0.When the two inputs are returned to logic 0, a race condition is created, and which state the device will assume can not be determined.Consequently, the use of the SR latch is restricted to exclude the input combination S = R = 1.If the R signal is returned to logic 0 before S, the final state of Q will be a logic 1. If S is returned to logic 0 first, the device will be reset to logic 0.
14 Delay ParametersEvery circuit output requires a nonzero amount of time to respond to changes on its input, as specified by delay parameters tPLH and tPHL .Recall that tPLH designates the delay time between an input change and a corresponding low-to-high transition of an output.tPHL is the delay between an input change and a corresponding high-to-low transition.For a latch circuit the delay parameters represent the sum of the propagation delays through the gates between a given latch input and output, with separate delay parameters usually specified for each input/output pair.
15 Delay Parameters (continued) For example, Fig illustrates the timing behavior of the SR latch of Fig. 6.7c.Following a change in S from 0 to 1, note that output Q changes from 1 to 0 after propagation delay tPHL through N1.Then the feedback signal causes the Q output to change from 0 to 1 after propagation time tPLH through N2.Thus, output Q always changes before output Q when setting an SR latch built from cross-coupled NOR gates.Therefore, tPHL from input S to output Q involves a single gate delay, whereas tPLH from input S to output Q includes two gate delays.
17 SR Latch Excitation Table and Characteristic Equation The logical operation of the SR latch is summarized in the excitation table of Fig. 6.11a.The excitation table is simply the state table of the latch, showing the state transitions for each combination of excitation inputs.The information from the table can be represented as a state diagram, as shown in Fig. 6.11b, and plotted in K-map form, as shown in Fig. 6.11c, where the value of the next state Q* is plotted as a function of the inputs, S and R, and the present state Q.From the K-map the characteristic equation of the SR latch can be derived: Q* = S + RQ.
18 SR Latch: Characteristic Equation (continued) The characteristic equation is so called because it characterizes the operation of the latch. We can classify the latch operation into three cases:1. S = R = the state does not change2. S = 1, R = 0 represents the set operation3. S = 0, R = 1 represents the reset operation
19 SR latch characteristics State diagramExcitation tableK-map of latch output Q*Figure 6.11
20 Gated SR LatchOften it is desirable to use a special control signal to inhibit state changes in an SR latch while S and R are changing.This device is commonly referred to as a gated SR latch, since the control signal can be thought of as opening a gate through which signals on the S and R inputs propagate to the output.Circuit Structure: In Fig. 6.13a, a control signal C, is added to an SR latch to apply the inputs S and R.The two AND gates apply the control signal S and R during time intervals when the enable signal C is logic 1.When C is logic 0, the inputs are held in the S = R = 0 state.
21 Gated SR Latch (continued) So the operation of the latch is as follows:when C = 0, no change occurswhen C = 1, the SR excitation table of Fig. 6.11a and the characteristic equation describe its function.If the AND gates are changed to NAND gates and cross-coupled NAND gates are used for the SR latch, the circuit of Fig. 6.13b results.The NAND gate implementation of the gated SR latch is shown in Fig. 613.c.The generic logic symbol for the gated SR latch is shown in Fig. 6.13d.
22 Gated SR Latch Figure 6.13 With NAND SR latch With NOR SR latch (d) logic symbolNAND logic diagram
23 Gated SR Latch (continued) Characteristic Equation: The complete excitation table and state diagram of the gated SR latch are given in Figs. 6.14a and b.From the excitation table the characteristic equation is derived: Q* = SC + RQ + CQNote that when C = 0 this equation reduces to Q* = Q which means that the present state is held.When C = 1 the equation becomes: Q* = S + RQ, the characteristic equation of the simple SR latch, and thus the latch is enabled.
24 Gated SR Latch Characteristics Excitation tableState diagramFigure 6.14
25 Delay LatchWhen storing data, a memory element’s excitation input is simply the data to be stored.A device (which is called a delay latch or D latch) is needed that transfers a logic value on its excitation input D into the cross-coupled storage cell of a latch.The logic symbol of the D latch is shown in Fig. 6.15a. Such a device can be created from a gated SR latch, by assigning S = D and R = D.The D latch excitation table and state diagram is shown in Figs a and b.A NAND implementation of the D latch is shown in 6.15b and NOR is shown in 6.15c.
26 Delay Latch (D latch) Figure 6.15 Logic symbol NAND implementation NOR implementation
27 D Latch Characteristics Excitation tableState diagramFigure 6.16
28 D Latch (continued)Characteristic equation: this equation can be derived from that of the gated SR latch by substituting D for S and D for R: Q* = DC + CQWhen the enable signal is low, (C = 0), the equation reduces toQ* = Q, meaning the latch is placed in hold mode (no change) operating mode with the latch holding the last value of D that was entered.When the enable signal is high (C = 1), Q* = D, the excitation input D is gated directly to output Q (gated or enabled mode).Fig illustrates the timing diagram for D latch operation.
30 D Latch (continued)Timing Constraints : To ensure that a specific value on excitation input D will determine the final state of the latch, D must not be allowed to change too near the time at which the enable signal makes its transition from high to low.Set up time: denoted tsuis defined as the period of time immediately preceding the enable signal transition during which the excitation input must be stable.That is, the excitation input must be set up at least tsu prior to the enable signal transition and should not change until well after the transition.
31 D Latch (continued) Hold time : denoted th is defined as the period of time immediately following the enable signal transition during which D should not change. Therefore, the excitation input must be held constant for at least th following the enable signal transition to ensure the correct value has been latched.Setup and hold times are illustrated in Fig. 6.18Note the two constraint violations:- the change in D from 0 to 1 too close to the clock edge represents a setup time violation- the change in D from 1 to 0 too soon after the clock edge may result in an unpredictable state.
33 Flip-FlopsThe latch circuits presented thus far are not appropriate for use in synchronous sequential logic circuits.The possibility of two cascaded combinational circuits feeding each other, generating oscillations and unstable transient behavior can be controlled by using a special timing control signal called a clock.The clock can then be used to restrict the times at which the states of the memory elements may change thus preventing the unstable behavior just described.
34 Master-Slave SR Flip-Flops One method to prevent unstable behavior is to employ two latches in a master-slave configuration as shown in Fig. 6.21a.When the clock signal C is low, the master latch is in the gated mode and slave is in the hold mode. Changes on the excitation input signal S and R are gated into the master latch while the slave latch ignores any changes on its inputs.When the clock changes to logic 1, the two latches exchange roles. The slave latch enters the gated mode, sending the output of the master latch to the flip-flop output Q, while the master latch enters the hold mode.
35 Master-Slave SR Flip-Flops (continued) Master-slave flip-flops are sometimes called pulse triggered because they require both logic 0 to 1 and 1 to 0 transitions on the clock input in order to operate properly.The logic symbol of Fig. 6.21b indicates the pulse-triggered nature of the device by showing the clock edge transition that enables the slave at the flip-flop output terminals Q and Q.In Fig. 6.21b, the rising transition indicates that the flip-flop outputs change on the positive edge of a pulse on the clock signal.If the SR flip-flop is used in a synchronous sequential circuit, an unstable oscillation cannot occur because, at all times, either the master or the slave latch is in the hold mode (Fig. 6.21d).
37 Master-slave SR flip-flop (continued) ( c) Timing behaviorFigure 6.21(d) Timing constraints
38 Excitation Table and Characteristic Equation The excitation table and state diagram for the SR master-slave flip-flop are presented in Figs. 6.22a and b.Note that the columns S, R, and Q denote the conditions on the flip-flop signals before the clock pulse is applied.The Q* column denotes the flip-flop output after the clock pulse has been applied.The state diagrams of the simple SR latch and the master-slave SR latch are identical. The difference between them is that the latch changes states immediately when S or R changes, whereas all flip-flop state changes are triggered by clock pulses.
39 SR Master-Slave Flip-Flop Characteristics Q* = S + RQFigure 6.22
40 Master-Slave D Flip-Flops A master-slave D flip-flop can be built from two D latches as shown in Fig. 6.23a.This flip-flop operates in the same manner as the SR version; the master latch is gated when the clock is low and the slave, when the clock is high.The logic symbol for this pulse-triggered device indicates that the outputs change on the positive edge of a pulse on the clock signal (Fig. 6.23b).The overall behavior of the D flip-flop output Q can be summarized by noting that Q will assume the value of D on the rising edge of the clock C.Therefore, the characteristic equation for a master-slave D flip-flop is : Q* = D
42 Master-slave D flip-flop characteristics Figure 6.24
43 Master-Slave JK Flip-Flops The JK operates as an SR flip-flop whose inputs are assigned J = S and K = R.However, whereas the S = R = 1 combination is not allowed, the JK uses this special case to incorporate a very useful mode of operation.The additional feature of the JK device is that it state toggles, that is changes from 0 to 1 or from 1 to 0 when J = K = 1.Examination of the state diagram, shown in Fig. 6.25b, indicates that the JK flip-flop will change from the 0 state to the 1 state with an input of J = 1 and K = 0 or J = 1 and K = 1 (toggle).This means that a logic 1 on J will force the device into the 1 condition no matter what value is placed on K. So K is a don’t-care in this case.
44 Pulse-triggered JK flip-flop characteristics (b) State diagram(a) Excitation tableFigure 6.25( c) K-map for Q*
45 JK Flip-Flops (continued) By plotting the next state Q* on a K-map, as shown in Fig 6.25c, the characteristic equation of the JK flip-flop can be derived: Q* = KQ + JQFrom this equation, the logic diagram for the flip-flop can be derived as presented in Fig. 6.26a.The logic symbol for this device is shown in Fig b. Note that the clock input signal is inverted within the device itself so that the slave will change on the falling edge of the clock.
46 Pulse-Triggered JK Flip-Flop Realization Logic symbolLogic diagramFigure 6.26
47 7476 Dual Pulse-triggered JK Flip-Flop Module Figure 6.27 shows the logic symbol of the SN7476. This device packages two flip-flops that operate in the manner displayed in FigIncluded in the configuration are asynchronous set signals PRE and reset signals CLR. The PRE and CLR signals override the operation of the pulse-triggered inputs J, K and CLK.This means that if CLR = 0 then the state Q* goes to 0, or if PRE = 0 the state Q* sets to 1, independent of the values of the clock and the excitation inputs.
48 The SN7476 Dual Pulse-Triggered JK Flip-Flop Figure 6.27
49 Edge-triggered D Flip-Flops All the pulse-triggered flip-flops discussed previously, require both a rising and falling edge on the clock for proper operation.Another approach is to design the flip-flop circuitry so that it is sensitive to its excitation inputs only during rising or falling transitions of the clock.A circuit with this design is called positive edge triggered if it responds to a 0 to 1 clock transition, or negative edge triggered if it responds to a 1 to 0 clock transition.The edge-sensitive feature eliminates unstable transients by drastically reducing the period during which the input excitation signals are applied to the internal latches.
50 7474 Dual Positive-edge-triggered D Flip-Flop Module Fig. 6.28b presents the logic symbol for the SN7474. It is important to note that the small triangle at the C1 input to the device is the standard notation to indicate that it is positive edge triggered.The modes of operation are shown in the excitation table of Fig Note that the asynchronous preset and clear signals override the clocked operation of the circuit.When both CLR and PRE are inactive (high), the clock, CLK, takes control of the device.While CLK is low, the flip-flop is in the hold mode. However, on a 0 to 1 transition of the clock the data input D is transferred to the flip-flop output Q.
51 SN7474 dual positive-edge-triggered D Flip-Flop (b) generic logic symbol(a) Logic diagramFigure 6.28( c ) IEEE standard logic symbol
53 Edge-triggered Flip-flop Timing Characteristics To ensure proper operation of any edge-triggered flip-flop, the excitation inputs should not change immediately before or after the clock transition.The value of D for the SN7474 is sampled and transferred to the flip-flop output Q at the exact instant the clock reaches its threshold value.One should always make sure that the input is either logic 1 or 0 at this instant in time so that the flip-flop’s output Q will be the value planned in the system design.Fig.6.30
55 T Flip-flopsA common building block used in sequential logic circuits that counts pulses on a signal line is the T flip-flop.The T flip-flop has only one excitation input signal T, as shown on the logic symbol for the device pictured in Fig. 6.33a.The function of this device is to change (toggle) its state upon each negative-going transition of its excitation input signal, as shown in the excitation table and state diagram in Figs. 6.34a and b.Therefore, the characteristic equation of the edge-triggered T flip-flop is simply: Q* = Q
56 Negative-Edge-Triggered T Flip-Flop Logic symbolFunctional equivalentFigure 6.33
57 Edge-Triggered T Flip-Flop Characteristics State diagramExcitation tableQ* = QFigure 6.34
58 Clocked T Flip-flopsSome versions of the T flip-flop operate under clock pulse control, as shown in Fig. 6.35a. In this case, the flip-flop toggles if T = 1 when the clock makes a high-to-low transition and holds its present state if T = 0 when the flip-flop is clocked.The operation of a clocked T flip-flop is described by the excitation table given in FigThe equivalent circuit of the clocked T flip-flop, shown in Fig. 6.35b, is simply a JK flip-flop with inputs J = K = T, and its C input driven by the clock signal.Another variation of the clocked T flip-flop is shown in Fig. 6.37a.
59 Functional equivalent Clocked T Flip-FlopLogic symbolFunctional equivalentFigure 6.35
60 Excitation Table for Clocked T Flip-Flops Q* = TQ + TQFigure 6.36
61 The Clocked T Flip-flop (a) logic symbolFigure 6.37(b) Timing diagram
62 Table 6.3 Summary of Latch and Flip-Flop Characteristics DeviceCharacteristic EquationSR latchQ* = S + RQGated SR latchQ* = SC +QR + CQD latchQ* = DC + CQSR flip-flopQ* = S + RQD flip-flopQ* = DJK flip-flopQ* = KQ + JQT flip-flop (edge-triggered)Q* = QQ* = TQ + TQT flip-flop (clocked)