Lecture 7: Synchronous Sequential Logic

Lecture 7: Synchronous Sequential Logic

<p>Systems I: Computer <br>Organization and Architecture </p><p>Lecture 7:&nbsp;Synchronous Sequential <br>Logic </p><p>Synchronous Sequential Logic </p><p>• The&nbsp;digital circuits that we have looked at so far are combinational, depending only on the inputs.&nbsp;In practice, most systems have many components that contain memory elements, which&nbsp;require <strong>sequential </strong>logic. <br>• A&nbsp;sequential circuit contains both a combinational circuit and memory elements, whose output also serves as an input for the combinational circuit. <br>• The&nbsp;binary data stored in the memory elements define the state of the sequential circuit and help determine the conditions for changing the state in the memory elements. </p><p>Combinational circuit </p><p></p><ul style="display: flex;"><li style="flex:1">Inputs </li><li style="flex:1">Outputs </li></ul><p></p><p>Memory elements </p><p>Sequential Circuits: Synchronous and <br>Asynchronous </p><p>• There&nbsp;are two types of sequential circuits, classified by their signal’s timing: </p><p>– Synchronous sequential circuits have behavior that is defined from knowledge of its signal at discrete instants of time. </p><p>– The behavior of asynchronous sequential circuits depends on the order in which input signals change and are affected at any instant of time. </p><p>Synchronous Sequential Circuits </p><p>• Synchronous&nbsp;sequential circuits need to use signal that affect memory elements at discrete time instants. </p><p>• Synchronization&nbsp;is achieved by a timing device called a master-clock generator which generates a periodic train of clock pulses. </p><p>Basic Flip-Flop Circuit Using NOR Gates </p><p>10<br>R(reset) <br>Q</p><p><em>Set state Clear state </em></p><p>10<br>Q’ <br>S(set) </p><p>S R&nbsp;Q Q’ 1 0 0 0 0 1 0 0 1 1 <br>1 0 1 0 (after&nbsp;S = 1, R = 0) 0 1 0 1 (after&nbsp;S = 0, R = 1) 0 0 </p><p>Basic Flip-Flop Circuit Using NAND Gates </p><p>10</p><ul style="display: flex;"><li style="flex:1">S(set) </li><li style="flex:1">Q</li></ul><p>10<br>Q’ <br>R(reset) </p><p>S R&nbsp;Q Q’ 1 0 1 1 0 1 1 1 1 1 <br>0 1 0 1 (after&nbsp;S = 1, R = 0) 1 0 1 0 (after&nbsp;S = 0, R = 1) 0 0 </p><p>How the Basic Flip-Flop Circuit Works </p><p><em>0</em></p><p>10<br>RS<br>1<br>Q</p><p><em>0</em></p><p>0<br>Q’ </p><p><em>1</em></p><p>How the Basic Flip-Flop Circuit Works </p><p><em>1</em></p><p>01<br>RS<br>1<br>Q</p><p><em>1</em></p><p>0<br>Q’ </p><p><em>0</em></p><p>How the Basic Flip-Flop Circuit Works </p><p><em>1</em></p><p>00<br>RS<br>1<br>Q</p><p><em>1</em></p><p>0<br>Q’ </p><p><em>0</em></p><p>How the Basic Flip-Flop Circuit Works </p><p><em>0</em></p><p>00<br>RS<br>0<br>Q</p><p><em>0</em></p><p>1<br>Q’ </p><p><em>1</em></p><p>Clocked RS&nbsp;Flip-Flop </p><p>R<br>Q</p><p>CP </p><p>(Clock Pulse) </p><p>Q’ <br>S</p><p><em>Dynamic indicator - denotes that the flip-flop responds to a clock input </em></p><p>RS<br>Q<br>CP <br>Q’ </p><p>Karnaugh Map for Clocked&nbsp;RS Flip-Flop </p><p>SR </p><p>11 X<br>10 <br>1<br>00 1<br>01 </p><p>Q</p><p>0</p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">1</li></ul><p>1</p><p>Q(t+1) = S + R’Q(t) <br>SR = 0 </p><p>Truth Table for Clocked RS Flip-flop </p><p>Q00001111<br>S00110011<br>R01010101<br>Q(t+1) <br>001</p><p>Indeterminate </p><p>101</p><p>Indeterminate </p><p>D Flip-Flops </p><p>D<br>Q</p><p>CP </p><p>Q’ </p><p><em>D Flip-flops are a modification of RS flip-flops which Q is set to whatever value D has. </em></p><p>Q<br>CP <br>Q’ <br>D</p><p>Truth Table for D Flip-flops </p><p>Q0011<br>D0101<br>Q(t+1) <br>0101</p><p>Karnaugh Map for D Flip-flops </p><p>D</p><p>DQ</p><p>1<br>0</p><p>1<br>0</p><p>1<br>Q<br>1</p><p>Q(t+1) = D </p><p>JK Flip-flops </p><p>K<br>Q</p><p>CP </p><p>Q’ <br>J</p><p><em>JK Flip - flops are a refinement </em></p><p></p><ul style="display: flex;"><li style="flex:1">J</li><li style="flex:1">Q</li></ul><p></p><p><em>of RS Flip-flops where the indeterminate state is now a “toggle” </em></p><p>CP <br>Q’ <br>K</p><p>Truth Table for JK Flip-flops </p><p>Q00001111<br>J00110011<br>K01010101<br>Q(t+1) <br>00111010</p><p>Karnaugh Map for JK Flip-flops </p><p>JK </p><p>11 <br>1<br>10 1</p><ul style="display: flex;"><li style="flex:1">00 </li><li style="flex:1">01 </li></ul><p></p><p>Q</p><p>0</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">1</li></ul><p>1</p><p>Q(t+1) = JQ’ + K’Q </p><p>T Flip-flops </p><p>T<br>Q</p><p>CP </p><p>Q’ </p><p><em>T flip-flops are a single-input version of JK Flip-flops where the input “toggles” the output </em></p><p>Q<br>CP <br>Q’ <br>T</p><p>Truth Table for T Flip-flops </p><p>Q(t) 0<br>T0<br>Q(t+1) 0</p><p>01<br>10<br>11</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">1</li><li style="flex:1">0</li></ul><p></p><p>Karnaugh Map for T Flip-flops </p><p>T</p><p>TQ</p><p>1<br>0</p><p>1<br>0</p><p>1<br>Q<br>1</p><p>Q(t+1) = TQ’ + T’Q </p><p>Triggering Flip-flops </p><p>• The&nbsp;state of a flip-flop is switched by a momentary change in input signal (called a <strong>trigger</strong>). <br>– RS flip-flops are asynchronous and require an input trigger defined by a change of signal level.&nbsp;If the level does not return to its original level (0 in NOR flipflops; 1 in NAND flip-flops), they cannot be triggered again. <br>– Clocked flip-flops are triggered by pulses, which start at a value of 0, rise to 1 momentarily and return to 0. </p><p>Triggering Flip-flops (continued) </p><p>• Sequential&nbsp;circuits have feedback paths between the combinational circuits and memory elements, which could produce instability if memory element outputs are changing while combinational circuit outputs are sampled by the clock pulse. <br>• This&nbsp;timing problem can be solved by not have flip-flop outputs change until the pulse returns to 0.&nbsp;This requires delaying the propagation of&nbsp;the flip-flop’s signal. <br>• This&nbsp;is more easily done by having the delay unit within the flip-flop. </p><p>Clock Pulses </p><p></p><ul style="display: flex;"><li style="flex:1">Negative Pulse </li><li style="flex:1">Positive Pulse </li></ul><p></p><p>1</p><p>0</p><p></p><ul style="display: flex;"><li style="flex:1">Positive Edge </li><li style="flex:1">Positive Edge </li><li style="flex:1">Negative Edge </li><li style="flex:1">Negative Edge </li></ul><p></p><p>To avoid having a flip-flop change values during the life of a clock pulse, it is important to have the flip-flop respond to </p><p>either positive <strong>or </strong>negative edge <strong>only</strong>. </p><p>Master-Slave Flip-Flop </p><p>• A&nbsp;master-slave flip-flop consists of two flipflops, one serving as a master, one serving as a slave and an inverter for the clock pulse. </p><p>• First&nbsp;the master is set (or cleared) and then the slave. </p><p>Master-Slave Flip-Flop Logic Diagram </p><p><em>Y</em></p><ul style="display: flex;"><li style="flex:1"><em>S</em></li><li style="flex:1"><em>Q</em></li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">S</li><li style="flex:1">S</li></ul><p></p><p><em>Slave </em><br><em>Y’ </em><br><em>Master </em></p><p><em>Q’ </em></p><p>R</p><p><em>R</em></p><p>R</p><p><em>CP </em></p><p>Master-Slave Flip-flop </p><p>Master-Slave Flip-Flop Timing Relationships </p><p>CP S</p><p>YQ</p><p>Edge-Triggered Flip-Flops </p><p>• In&nbsp;edge-triggered flip-flops, output transitions occur at a specific level of the clock pulse. </p><p>• When&nbsp;the pulse exceeds this threshold, inputs are locked out and the flip-flop won’t respond to input until the clock pulse returns to 0. </p><p>• <strong>Setup time </strong>– the time for which the D input must be maintained at a constant value prior to application of the pulse. </p><p>• <strong>Hold time</strong>– the time for which the D input must </p><p>not change after the application of the positivegoing transition of the pulse. </p><p>D-type Positive-Edge-Triggered Flip-Flop </p><p></p><ul style="display: flex;"><li style="flex:1"><em>S</em></li><li style="flex:1"><em>Q</em></li></ul><p></p><p><em>CP </em></p><p><em>Q’ </em><br><em>R</em></p><p><em>D</em></p><p>Edge-Triggered With CP= 0 &amp; D = 0 </p><p><em>0</em></p><p><em>S = 1 </em></p><p><em>CP </em></p><p><em>R = 1 </em></p><p><em>1</em></p><p><em>D</em></p><p>Edge-Triggered With CP= 0 &amp; D = 1 </p><p><em>1</em></p><p><em>S = 1 </em></p><p><em>CP </em></p><p><em>R = 1 </em></p><p><em>0</em></p><p><em>D</em></p><p>Edge-Triggered With CP= 1 &amp; D = 0 </p><p><em>0</em></p><p><em>S = 1 </em></p><p><em>CP </em></p><p><em>R = 0 </em></p><p><em>1</em></p><p><em>D</em></p><p>Edge-Triggered With CP= 1 &amp; D = 1 </p><p><em>1</em></p><p><em>S = 0 </em></p><p><em>CP </em></p><p><em>R = 1 </em></p><p><em>0</em></p><p><em>D</em></p><p>Sequential Circuit – An Example </p><p>xAB’ yCP x<br>B</p><p>Q<br>R</p><p>S</p><p>AxA’ </p><p>Q’ </p><p>B’ x</p><p>RS</p><p>A</p><p>Q</p><p>Bx</p><p>Q’ </p><p>A’ <br>B’ </p><p>State Table for the Sequential Circuit </p><p></p><ul style="display: flex;"><li style="flex:1">Next state </li><li style="flex:1">Output </li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1"><strong>Present State </strong></li><li style="flex:1"><strong>x = 0 </strong></li><li style="flex:1"><strong>x = 1 </strong></li><li style="flex:1"><strong>x = 0 </strong></li><li style="flex:1"><strong>x = 1 </strong></li></ul><p></p><p><strong>AB </strong></p><p>00 01 10 11 </p><p><strong>AB </strong></p><p>00 11 10 10 </p><p><strong>AB </strong></p><p>01 01 00 11 </p><p><strong>y</strong></p><p>0000</p><p><strong>y</strong></p><p>0010</p><p>State Diagram for the Sequential Circuit </p><p><em>Output </em></p><p>0/0 </p><p><em>from this transition </em></p><p>00 <br>0/0 <br>1/1 <br>1/0 </p><p>1/0 </p><p><em>Input </em></p><p></p><ul style="display: flex;"><li style="flex:1">01 </li><li style="flex:1">10 </li></ul><p></p><p><em>for this transition </em></p><p>0/0 <br>0/0 </p><p>11 <br>1/0 </p><p>State Equations for the Sequential Circuit </p><p>Bx </p><p></p><ul style="display: flex;"><li style="flex:1">00 </li><li style="flex:1">01 </li><li style="flex:1">11 </li><li style="flex:1">10 </li></ul><p>1</p><p>A</p><p>01<br>1</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">1</li></ul><p>A(t+1) = Bx’ + (B+x’)A <br>= Bx’ + (B’x)’A </p><p>State Equations for the Sequential Circuit </p><p>Bx </p><p></p><ul style="display: flex;"><li style="flex:1">00 </li><li style="flex:1">01 </li></ul><p>1<br>11 <br>1<br>10 1</p><p>A</p><p>01<br>1</p><p>B(t+1) = A’x + (A’+x)B <br>= Ax + (Ax’)’B </p><p>Flip-flop Excitation Tables </p><p>• Characteristic&nbsp;tables tell us the state into which a flip-flop goes depending on the inputs. </p><p>• What&nbsp;we really want to know is what inputs we need to get the flip-flop to make a particular transition </p><p>Characteristic Table for RS Flip-flop </p><p><strong>S</strong></p><p>0011</p><p><strong>R</strong></p><p>0101</p><p><strong>Q(t+1) </strong></p><p>Q(t) <br>01?</p><p>Excitation Table for RS Flip-flop </p><p></p><ul style="display: flex;"><li style="flex:1"><strong>Q(t) </strong></li><li style="flex:1"><strong>Q(t+1) </strong></li><li style="flex:1"><strong>S</strong></li></ul><p></p><p>0</p><p><strong>R</strong></p><p>X0<br>0011<br>0101<br>1</p><ul style="display: flex;"><li style="flex:1">0</li><li style="flex:1">1</li></ul><p></p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">0</li></ul><p></p><p>Excitation Table for JK Flip-flop </p><p></p><ul style="display: flex;"><li style="flex:1"><strong>Q(t) </strong></li><li style="flex:1"><strong>Q(t+1) </strong></li><li style="flex:1"><strong>J</strong></li></ul><p></p><p>0</p><p><strong>K</strong></p><p>XX1<br>0011<br>0101<br>1X</p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">0</li></ul><p></p><p>Excitation Table for D Flip-flop </p><p></p><ul style="display: flex;"><li style="flex:1"><strong>Q(t) </strong></li><li style="flex:1"><strong>Q(t+1) </strong></li><li style="flex:1"><strong>D</strong></li></ul><p></p><p>0101<br>0011<br>0101</p><p>Excitation Table for T Flip-flop </p><p></p><ul style="display: flex;"><li style="flex:1"><strong>Q(t) </strong></li><li style="flex:1"><strong>Q(t+1) </strong></li><li style="flex:1"><strong>T</strong></li></ul><p></p><p>0110<br>0011<br>0101</p><p>Sequential Logic Design <br>• Designing&nbsp;a sequential circuits consits of choosing the flip-flops and combinational gates. </p><p>– The number of flip-flops depends on the number of states in the circuits. </p><p>– The combinational circuit depends on the state table. </p><p>Sequential Logic Design Procedure </p><p>• The&nbsp;procedure is summarized by these steps: </p><p>1. The&nbsp;word description of the circuit behavior is states, accompanied by a state diagram, timing diagram or other pertinent data. <br>2. Obtain&nbsp;the state table from the given information about the circuit. <br>3. The&nbsp;number of states may be reduced if the sequential circuit can be characterized by input-output relationships independent of the number of states. <br>4. Assign binary values to each state if the state table obtained in step 2 or 3 contains letter symbols. </p><p>Sequential Logic Design Procedure (continued) 5.Determine the number of flip-flops needed and assign a letter symbol to each </p><p>6.Choose the type of flip-flop to be used. 7.From the state table, derive the circuit excitation and output table. </p><p>8.Using the map or any other simplification method, derive the circuit output function and the flip-flop input functions. </p><p>9.Draw the logic diagram. </p><p>Example - A Simple Counter </p><p>0<br>00 <br>0<br>1<br>0</p><p>1</p><p></p><ul style="display: flex;"><li style="flex:1">01 </li><li style="flex:1">11 </li></ul><p>1<br>1</p><p>10 <br>0</p><p>State Table for the Sequential Circuit </p><p>Next State </p><ul style="display: flex;"><li style="flex:1">Present State </li><li style="flex:1">x = 0 </li><li style="flex:1">x = 1 </li></ul><p>A0</p><ul style="display: flex;"><li style="flex:1">B</li><li style="flex:1">A</li></ul><p>0<br>B0<br>A0<br>B</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">0</li></ul><p></p><ul style="display: flex;"><li style="flex:1">0</li><li style="flex:1">1</li><li style="flex:1">0</li><li style="flex:1">1</li><li style="flex:1">1</li><li style="flex:1">0</li></ul><p>11<br>01<br>11<br>01<br>10<br>10</p><p>Excitation Table for the Sequential Circuit </p><p></p><ul style="display: flex;"><li style="flex:1">Inputs of </li><li style="flex:1">Outputs of </li></ul><p></p><ul style="display: flex;"><li style="flex:1">combinational circuit </li><li style="flex:1">combinational circuit </li></ul><p>Present State <br>Next </p><ul style="display: flex;"><li style="flex:1">State </li><li style="flex:1">Input </li><li style="flex:1">Flip-flop inputs </li></ul><p>A0<br>B001</p><p>x</p><p>0</p><ul style="display: flex;"><li style="flex:1">A</li><li style="flex:1">B</li></ul><p>011</p><ul style="display: flex;"><li style="flex:1">JA KA </li><li style="flex:1">JB KB </li></ul><p>000<br>000<br>XXX</p><ul style="display: flex;"><li style="flex:1">0</li><li style="flex:1">X</li></ul><p>X0</p><ul style="display: flex;"><li style="flex:1">0</li><li style="flex:1">1</li><li style="flex:1">1</li></ul><p></p><ul style="display: flex;"><li style="flex:1">0</li><li style="flex:1">0</li><li style="flex:1">X</li></ul><p>011<br>100<br>101<br>111<br>001</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">X</li></ul><p>0<br>X0<br>1<br>XX<br>X</p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">0</li><li style="flex:1">1</li></ul><p>11<br>11<br>01<br>10<br>10<br>XX<br>01<br>XX<br>01</p><p>Block Diagram for Sequential Circuit </p><p>B<br>B’ <br>A<br>A’ </p><p>Q’ K<br>QJ<br>Q’ K<br>QJ<br>CP </p><ul style="display: flex;"><li style="flex:1">KA </li><li style="flex:1">JA </li><li style="flex:1">KB </li><li style="flex:1">JB </li></ul><p>A’ A</p><p><em>External outputs (none) </em></p><p>Combinational Circuit </p><p>B’ B</p><p>x</p><p><em>External inputs </em></p><p>Karnaugh Maps for Combinational Circuit </p><p>x</p><p>Bx </p><p>00 X</p><ul style="display: flex;"><li style="flex:1">01 </li><li style="flex:1">11 </li></ul><p>1<br>10 X</p><p>A</p><p>01</p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">X</li></ul><p></p><p>B<br>JA = Bx </p><p>Karnaugh Maps for Combinational Circuit (continued) x</p><p>Bx </p><p>00 X</p><ul style="display: flex;"><li style="flex:1">01 </li><li style="flex:1">11 </li></ul><p>X<br>10 X</p><p>A</p><p>0<br>X</p><p>1<br>1</p><p>B<br>KA = Bx <br>Karnaugh Maps for Combinational Circuit (continued) x</p><p>Bx </p><p></p><ul style="display: flex;"><li style="flex:1">00 </li><li style="flex:1">01 </li></ul><p>1<br>11 X<br>10 X</p><p>A</p><p>01</p><ul style="display: flex;"><li style="flex:1">1</li><li style="flex:1">X</li><li style="flex:1">X</li></ul><p>B<br>JB = x </p><p>Karnaugh Maps for Combinational Circuit (continued) x</p><p>Bx </p><p>00 X<br>01 X<br>11 <br>1<br>10 </p><p>A</p><p>01</p><ul style="display: flex;"><li style="flex:1">X</li><li style="flex:1">X</li><li style="flex:1">1</li></ul><p>B<br>KB = x </p><p>Circuit Diagram for Sequential Circuit </p><p>B<br>A<br>Q’ K<br>QJ</p><ul style="display: flex;"><li style="flex:1">Q’ </li><li style="flex:1">Q</li></ul><p></p><ul style="display: flex;"><li style="flex:1">J</li><li style="flex:1">K</li></ul><p></p><p>CP </p><p>x</p><p>Designing a Binary Counter </p><p>• A&nbsp;sequential circuit that goes through a prescribed sequence of states when an input pulse is applied is called a <strong>counter</strong>. </p><p>• The&nbsp;straight binary sequence is the simplest sequence and a counter that follows it is </p><p>called a <strong>binary counter</strong>. </p><p>• An&nbsp;binary counter with n flip-flops will count from 0 to 2<sup style="top: -0.4375em;">n</sup>-1. </p><p>State Diagram for a Binary Counter </p><p>000 <br>001 <br>111 </p><p>110 <br>010 </p><p>011 <br>101 </p><p>100 </p><p>Excitation Table for 3-bit Binary Counter </p><p></p><ul style="display: flex;"><li style="flex:1">Count Sequence </li><li style="flex:1">Flip-flop inputs </li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">A<sub style="top: 0.25em;">2 </sub>A<sub style="top: 0.25em;">1 </sub></li><li style="flex:1">A<sub style="top: 0.25em;">0 </sub></li></ul><p></p><p></p><ul style="display: flex;"><li style="flex:1">TA<sub style="top: 0.25em;">2 </sub></li><li style="flex:1">TA<sub style="top: 0.25em;">1 </sub></li><li style="flex:1">TA<sub style="top: 0.25em;">0 </sub></li></ul><p></p><p>000<br>001<br>010<br>000<br>010<br>111<br>011<br>100<br>101<br>100<br>101<br>111<br>11<br>11<br>01<br>01<br>01<br>11</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    32 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us