CS2100 Computer Organisation Tutorial #5: Sequential Circuits (28 – 29 September 2015) [ This document is available on “Tutorials” material folder on https://edutech.comp.nus.edu.sg ] Questions D1 and D2 are to be discussed in the EduTech forum. D1. The following state table describes the state transition of a circuit with 4 states A, B, C and D, an input x, and an output z. For example, if the circuit is in state A and its input x is 0, then it moves into state C and generates the output 0 for z. A B C D 0 C/0 D/1 B/1 C/0 x 1 A/1 B/0 D/0 D/0 (a) Complete the state diagram below. The label of the arc indicates input/output, hence 1/1 means x=1 and z=1. x/z 1/1 A B C D (b) Assuming that the circuit starts in state A, find the output sequence and state sequence for the input sequence x = 100010 (read from left to right). (x = 100010 means that initially x is 1, then in the next clock x is 0, and so on.) AY2015/6 Semester 1 - 1 of 4 - CS2100 Tutorial #5 D2. Match the following state diagrams to the 4 flip-flops: JK flip-flop, D flip-flop, RS flip-flop, and T flip-flop. Don’t-care value is indicated by “x”. (a) (b) 1 0 10 0 1 1 0x 0 0 (c) x0 1 x0 01 (d) 1 0 1 0 1 1x 0 0x 0 1 x1 1. [AY2011/2012 Semester 2 exam] The sequential circuit with state AB shown below contains two JK flip-flops. Complete the state table and hence draw the state diagram. In your state diagram, you may write the state values in binary or decimal. Q J A Clk K Q' J Q B Clk Q' K Clock Present state A B AY2015/6 Semester 1 Flip-flop inputs JA KA Next state JB=KB A+ - 2 of 4 - B+ CS2100 Tutorial #5 2. A four-state sequential circuit below consists of a T flip-flop and a D flip-flop. Analyze the circuit. T Q Clk A Q' D Q Clk p B Q' Clock (a) Complete the state table and hence draw the state diagram. (b) Assuming that the circuit is initially at state 0, what is the final state and the outputs generated after 3 clock cycles? A state is called a sink if once the circuit enters this state, it never moves out of that state. (c) How many sinks are there for this circuit? (d) Which is likely to be an unused state in this circuit? Present state A B 0 0 0 1 1 0 1 1 AY2015/6 Semester 1 Output p Flip-flop inputs TA DB - 3 of 4 - Next state A+ B+ /p 0 1 3 2 CS2100 Tutorial #5 3. Given the following state transition diagram with states AB (in binary) and input x, fill in the corresponding state table and, using D flip-flops and appropriate logic gates, draw the circuit. Present state Input Next state A B x A+ B+ 0 0 0 0 0 0 1 0 0 0 1 0 1 1 0 1 1 1 1 0 0 2 1 1 0 1 0 1 1 0 1 1 1 4. Repeat question 3 using JK flip-flops. This time, you do not need to follow the simplified SOP expressions. Instead, implement your circuit using the fewest number of logic gates. After implementing your circuit using the simplified SOP expressions for the flip-flop inputs, can you now complete the following state diagram with unused state? A circuit is self-correcting if for some reason the circuit enters into any unused (invalid) state, it is able to transit to a valid state after a finite number of transitions. Is your circuit self-correcting, and why? 0 0 1 1 2 Present state A B 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 AY2015/6 Semester 1 1 0 Input x 0 3 1 Next state A+ B+ Flip-flop A Flip-flop B JA JB KA KB 0 1 0 1 0 1 0 1 - 4 of 4 - CS2100 Tutorial #5