THE DATA LATCH R/S BASE
Perhaps the simplest memory device in real applications, the Data Latch is really a Clocked Set-Reset Latch with the inputs R and S tied together through an inverter. There are other designs, but essentially they are all the same. One Data Latch can only store one bit of information: a 0 or a 1. Consequently, you will not likely find a Data Latch in a computer. However, you will find the shift register, which is constituted of a group of Data Latches arranged in series. Other applications of the Data Latch abound. For example, most designers — especially students — design omnifarious sequential logic circuits using Data Latches.
If you played with the interactive Data Latch circuit at the top of this page, then you saw that the value of the input (D) is reflected in the output (Q) when the clock (Clk) is asserted. In other words, when the clock signal is unasserted the output is locked and cannot be changed; however, when the clock signal is HIGH then the output follows the input. (Note: in this article, we use C and Clk interchangeably for the clock input signal).
Boolean Function Derivation
The analysis of the Data Latch is as simple as its operation. First we will solve for the switching (Boolean) function using a nice little technique. Then from the Boolean expression we will write the state
transition table and draw the state diagram.
Using the circuit diagram in figure 1, we just solve for the output Q in terms of little q and the inputs D and C. To make things easy for you to see, before we start solving, we also label the output of the inverter X and the intermediate NAND gates T1 and T2, as shown in figure 2 below.
Now we solve: The symbol for the NAND gate is () and the symbol for the NOT gate is the super-bar ().
Now that we have expressed the outputs of the five gates as algebraic equations, our next job is to combine them to solve for Q in terms of q and the inputs D and Clk.
At this point we are done solving for Q. However, best practice says we should simplify the equation to get a minimal cost expression that defines the circuit; minimal cost means as few gates and as few inputs as possible. If you don't get the simplification process below the first time, don't worry about it. With enough practice you will get there. Here goes:
Now we are really done solving for Q. Some textbooks will have the answer as Q = D Clk+ Clk q. However, I prefer our answer because our answer expresses a more stable Data Latch circuit. They got their answer using a K-map. Later, at the end of this article, I will show you how they got theirs. But for now let's proceed to the state transition table.
Getting the State Transition Table and the State Diagram
A state transition table shows how the given state and the input condition of a circuit interact to produce the output of the circuit. As such, the tables rows are labeled by state and the tables columns are labeled by input condition. From the Boolean expression we just derived, we can see that the circuit is defined by one state variable q and two input variables D and Clk. Consequently, the state transition table will have two states/rows (q = 0 and q = 1) and four input conditions/columns (D Clk = 00, D Clk = 01, D Clk = 10, D Clk = 11). We show the table in table 1 below, using C for Clk.
Next, to fill the table, evaluate the equation Q = D Clk + D q + Clk q for Q by substituting the values q, C,
and D. For example, to fill the cell where q = 0 intersect CD = 00, we evaluate Q at those values:
As a result, we place a 0 in the first cell as shown in table 2.
In table 3, we fill the remaining Q values for you. Feel free to double check our work for practice.
Table 3 is pretty easy to understand. However, we are often required to show an even easier to understand representation of the circuit: a state diagram. We will show you the state diagram first; then we will use our words.
Each circle in the state diagram represents a state, as the labels indicate, and the curved arrows represent movement between states resulting from the input conditions.
A Promise Kept
Okay. Earlier I promised to show you how those textbooks get Q = D Clk + Clk q. Here it is. Change the state transition table (table 3) into a K-map, by just swapping the column where CD = 10 with the column where CD = 11, and then solve the K-map for a switching function
From the K-map you should get Q = C D + C q. So which one is correct? Well, lets see. We created the Kmap using a state transition table that we got from Q = D Clk + D q + Clk q. Consequently, the two expressions are equivalent.