Constructing Truth Table based on Circuit Diagram: the case of flip-flops S-R flip flop using NOR gates: If S-R flip flop is constructed out of NOR gates, then it detects 1's. Assume the circuit is constructed as: Q = R NOR Q' and Q'= S NOR Q. If you just trace the signals through the gates, the truth table can be constructed as: R 0 0 0 S 0 0 1 Q 0 1 0 Q' 1 0 1 0 1 1 1 0 0 1 0 1 0 1 0 Qnext 0 1 0, then 1 (when Q' switches from 1 to 0) 1 0 0 1 1 1 1 0 1 1 0 0 0 Q'next 1 0 0 0 1 0, then 1 (when Q switches from 1 to 0) 0 0 The last sentence in the last paragraph on p.116 of the textbook, is a cryptic reference to the behavior of switching the output state as shown in the table above in rows 3 and 6. The problem with S=1=R is that it produces Q=Q' output state, which is incorrect. Furthermore, there is a problem with switching over from state S=R=1 to state S=R=0, because then we have a race (it can be seen from the Karnaugh table, it is a hazard.) Therefore, we don't use the state S=R=1. S-R flip flop using NAND gates: If S-R flip flop is constructed out of NAND gates, then it detects 0's. Note: it must have the same truth table as the S-R flip flop constructed using NOR gates. Try 1: Assume the circuit is constructed as: Q = R NAND Q' and Q'= S NAND Q. If you just trace the signals through the gates, the truth table can be constructed as below - and it is not the truth table we want: R 0 0 0 S 0 0 1 Q 0 1 0 Q' 1 0 1 Qnext 1 1 1 0 1 1 1 1 1 0 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 0 0 1 Q'next 1 1 1, then 0 (when Q switches from 0 to 1) 0 1 1 1 0 Try 2: Therefore, if an S-R flip flop is constructed out of NAND gates, we must feed the gates with inverted S and R in order to obtain the truth table we want (i.e. Q = R' NAND Q' and Q' = A NAND Q). So we invert the above truth table (and we should get the first truth table, if we complement the output): R 1 1 1 1 0 0 0 0 S 1 1 0 0 1 1 0 0 R' 0 0 0 0 1 1 1 1 S' 0 0 1 1 0 0 1 1 Q 0 1 0 1 0 1 0 1 Q' 1 0 1 0 1 0 1 0 Qnext 1 1 1 1 0 0 0 1 Q'next 1 1 0 0 1 1 1 0 JK Flip flop: Assume that S = J AND Q', and R = K AND Q (there was a typo in the notes, we used NAND instead of AND). Given J and K, R and S are calculated according to those formulas. Then Qnext and Q'next are calculated based on the R-S flip flop truth table. J 0 0 0 0 1 1 1 1 K 0 0 1 1 0 0 1 1 Q 0 1 0 1 0 1 0 1 Q' 1 0 1 0 1 0 1 0 R = K AND Q 0 0 0 1 0 0 0 1 S = J AND Q' 0 0 0 0 1 0 1 0 Reference: http://www.shef.ac.uk/physics/teaching/phy107/. Qnext 0 1 0 0 1 1 1 0 Q'next 1 0 1 1 0 0 0 1