TEAHLAB NEW ADDITION
BUILD. SAVE. SHARE.
The world's first and only Integrated Simulator Community.

The Gated RS Nand Latch

The interactive Gated RS Nand Latch digital logic circuit, with Boolean function and truth table
Click on the board to energize the circuit.VHDL Program
Watch Short Film
TRUTH TABLE
Input Output Comment
CLK S R Q not-Q
0 0 0 Latch Latch
0 0 1 Latch Latch
0 1 0 Latch Latch
0 1 1 Latch Latch
1 0 0 Latch Latch
1 0 1 0 1
1 1 0 1 0
1 1 1 Invalid Invalid

INTRODUCTION

The Gated Set-Reset Latch (also known as a Clocked SR Latch) is merely a Set-Reset Latch with a doorway. And we put a door on a set-reset latch for the same reasons we might put a door on anything else: to control access. With a simple set-reset latch, the input signals are free to come in whenever they want. But if we add a door at the entrance, then we effectively control the entire circuit. As long as the door is closed, we have certitude that no matter what is happening at the input, the state of our circuit cannot be changed. And when we want changes at the input to be reflected in the output, we simply open the door.

Presently Q is entirely in terms of the input variables S, R, C and the given state variable q. As such, we are technically done solving for Q. However, we can simplify the expression further to get a minimal cost Boolean function. For your reference, the symbol for the AND gate is the dot • and the symbol for the NOT gate is the super-bar (an overhead bar).


Q = (S nand C) nand pic ((R nand C) nandq)
Q = (S • C) • ((R • C) • q) after rewrite each NAND as AND-NOT
Q = (S • C) ((R • C) • q) after cancelling the double negatives
Q = (S • C) + ((R + C) • q) after substituting for the complements = +
Q = (S • C) + (R • q + C • q) after expanding the q
Q = S • C + R • q + C • q after cleaning out the parentheses.

This time you can celebrate. We are finally done with solving for Q! Our next course of action is to show the state transition table.

The State Transition Table

To show the state transition table, we simply evaluate Q for all possible combinations of the given state q and the input conditions S, C, R, and then we present the result in a table format. Since this is a Boolean exercise, every variable has two possible values, 0 or 1. In view of that, the Gated Set-Reset Latch has two given states (q = 0; q = 1) and eight input conditions (CSR = 000; CSR = 001; CSR = 010; CSR = 011; CSR = 100; CSR = 101; CSR = 110; CSR = 111). We will list the given states along the rows of the table and the input conditions along the columns; that way we can clearly show the relationship between the given states and the input conditions, and their combined effect on Q. Table 1 below shows the empty state transition table.


Given state
q
Input Condition
CSR
000 001 010 011 100 101 110 111
0
1

Table 1: Empty State Transition Table


As we mentioned earlier, we will fill the table by evaluating Q = S • C + R • q + C • q for each combination of the given state q and the input condition CSR, and we will place the result in the appropriate cell. For example, when q = 0 and CSR = 000, then Q is

Q = S • C + R • q + C • q
Q = 0 • 0 + 0 • 0 + 0 • 0
Q = 0 • 0 + 1 • 0 + 1 • 0
Q = 0 + 0 + 0
Q = 0


Since Q = 0, we put 0 in the appropriate cell as shown in Table 2 below. This example should serve to emphasize that the values inside the state transition table are Q valuations.

Given state
q
Input Condition
CSR
000 001 010 011 100 101 110 111
0 0
1

Table 2: State Transition Table with One Filled Cell


We fill the rest of the table for you, as shown in Table 3 below. We welcome you to practice your evaluation skills by checking that our valuations are correct.

Given state
q
Input Condition
CSR
000 001 010 011 100 101 110 111
0 0 0 0 0 0 0 1 1
1 1 1 1 1 1 0 1 1

Table 3: Completely Filled State Transition Table


Before we proceed to drawing the state diagram, observe the following patterns in the state transition table. First, whenever C = 0 then Q = q, no matter what S and R happen to be. We expected this result because C is the lock to the door. Remember what we told you at the beginning of this article: "As long as the door is closed, we have certitude that no matter what is happening at the input, the state of our circuit cannot be changed." Because of this observation, we can actually rewrite Table 3 as Table 4 below; replacing the first four columns with CSR = 0xx. The xx means that S and R are irrelevant when C is 0. Many textbooks don't address the analysis of asynchronous feedback sequential circuits (think latches and flipflops). And the ones that do will normally not give you table 3; they will give you table 4.

Given state
q
Input Condition
CSR
0xx 100 101 110 111
0 0 0 0 1 1
1 1 1 0 1 1

Table 4


The State Diagram

At this point we can move on to drawing the state diagram from Table 4. We use table 4 instead of Table 3 because it is less work. Feel free to use table 3 if you want; it makes no difference. We show the state diagram in figure 3 below.

a state diagram image

Figure 3

Our final stretch is to mark the unstable state transitions. From the state transition diagram in figure 3 the unstable transitions are easy to spot: they are the arrows that leave one given state to go to another. If you want to use the state transition table (table 4 or table 3), the unstable transitions are the ones where, for a given cell, Q ≠ q. For example, the cell where q = 0 and CSR = 110 shows an unstable transition because Q = 1. In table 4 below the unstable transitions are shown in green.


Given state
q
Input Condition
CSR
0xx 100 101 110 111
0 0 0 0 1 1
1 1 1 0 1 1
Teahlab on LinkedIn     Teahlab on Facebook