sequential circuits 2
play

Sequential Circuits (2) Prof. Usagi Recap: Combinational v.s. - PowerPoint PPT Presentation

Sequential Circuits (2) Prof. Usagi Recap: Combinational v.s. sequential logic Combinational logic The output is a pure function of its current inputs The output doesnt change regardless how many times the logic is triggered


  1. Sequential Circuits (2) Prof. Usagi

  2. Recap: Combinational v.s. sequential logic • Combinational logic • The output is a pure function of its current inputs • The output doesn’t change regardless how many times the logic is triggered — Idempotent • Sequential logic • The output depends on current inputs, previous inputs, their history Sequential circuit has memory! 2

  3. Recap: Theory behind each • A Combinational logic is the implementation of a Boolean Algebra function with only Boolean Variables as their inputs • A Sequential logic is the implementation of a Finite-State Machine 3

  4. Recap: 4-different types of bit storage • SR-latch • S = 1 sets Q = 1 • R = 1 sets Q = 0 • Problem: S = 1, R = 1, Q = undefined • Level-sensitive SR-latch • S, R only become effective when C = 1 • Problem: avoid the case of signal oscillation, but cannot avoid the “intensional” 1,1 inputs • D-latch • SR can never be 11 if the Clk is set appropriately • Problem: D single needs to be stably long enough to set the memory • D-flip-flop • Only loads the value into memory in the beginning of the rising edge. Values can hold for a complete clock cycle • Problem: more gates 4

  5. Positive-edge-triggered D flip-flop Q Clock Q Data 5

  6. Recap: Clock signal 0ns 10ns 20ns 30ns 40ns 50ns 60ns 70ns 80ns 90ns • Clock -- Pulsing signal for enabling latches; ticks like a clock • Synchronous circuit: sequential circuit with a clock • Clock period: time between pulse starts • Above signal: period = 20 ns • Clock cycle: one such time interval • Above signal shows 3.5 clock cycles • Clock duty cycle: time clock is high • 50% in this case • Clock frequency: 1/period • Above : freq = 1 / 20ns = 50MHz; 6

  7. Outline • From FSM to circuit • Canonical forms of FSMs • When sequential circuits meets datapath components 7

  8. Let’s learn how to design sequential circuits! 8

  9. Poll close in Which is the most likely circuit realization of Life on Mars input output (A) 1/1 1/0 0/0 0/0 S1 S2 S0 Combinational 1/0 0/0 Circuit (C) (B) output (D) input D Flip- output input output flop D Q D Flip- Combin flop D Q D Flip- Combin ational Combin flop D Flip- ational D Q Circuit D Flip- ational flop flop D Q Circuit D Q Circuit CLK CLK 9 CLK

  10. Which is the most likely circuit realization of Life on Mars input output (A) 1/1 1/0 We need memory 0/0 0/0 S1 S2 S0 Combinational 1/0 0/0 Circuit (C) (B) output (D) input D Flip- output input output flop We have 3 states — D Q D Flip- Combin 2-bit memory flop D Q D Flip- Combin ational Combin flop D Flip- ational D Q Circuit D Flip- ational flop flop D Q Circuit D Q Circuit We still need input for CLK transition CLK 10 CLK

  11. Sequential Circuit Design Flow • Input Output Relation • State Diagram (Transition of states) • State minimization (Reduction) • Finite state machine partitioning • State Assignment (Map states into binary code) • Binary code, Gray encoding, One hot encoding, Coding optimization • State Table (Truth table of states) • Excitation Table (Truth table of FF inputs) • K Map, Minimal Expression • Logic Diagram 11

  12. Life on Mars input output State Diagram D Flip- flop D Q Combin 1/1 1/0 D Flip- ational flop 0/0 0/0 D Q Circuit S2 S0 S1 0/0 1/0 CLK State Diagram Next State, Output Current Input State 0 1 S0 S1, 0 S0, 0 S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 12

  13. Life on Mars input output State Diagram D Flip- flop D Q Combin 1/1 1/0 D Flip- ational flop 0/0 0/0 D Q Circuit S2 S0 S1 0/0 1/0 CLK State Diagram Next State, Output Current Input State State Assignment 0 1 S0 S1, 0 S0, 0 S0 00 S1 S2, 0 S0, 0 S1 01 S2 S2, 0 S0, 1 S2 10 13

  14. Life on Mars input output State Diagram D Flip- flop D Q Combin 1/1 1/0 D Flip- ational flop 0/0 0/0 D Q Circuit S2 S0 S1 0/0 1/0 CLK State Diagram State Truth Table Next State, Output Current Input State\Input 0 1 State State Assignment 0 1 00 01, 0 00, 0 S0 S1, 0 S0, 0 S0 00 S1 S2, 0 S0, 0 S1 01 01 10, 0 00, 0 S2 S2, 0 S0, 1 S2 10 10 10, 0 00, 1 14

  15. Poll close in Excitation Table • Excitation table is basically the truth table describing the combinational circuit that provides inputs for the flip-flops in the sequential circuit. How many rows are there in the excitation table of Life on Mars? A. 2 B. 3 input output D Flip- C. 4 flop D Q Combin D. 8 D Flip- ational E. 32 flop D Q Circuit 15 CLK

  16. Excitation Table • Excitation table is basically the truth table describing the combinational circuit that provides inputs for the flip-flops in the sequential circuit. How many rows are there in the excitation table of Life on Mars? A. 2 B. 3 input output D Flip- C. 4 flop D Q Combin D. 8 D Flip- ational E. 32 flop D Q Circuit 16 CLK

  17. input output Life on Mars State Truth Table D Flip- flop State\Input 0 1 D Q Combin 00 01, 0 00, 0 D Flip- ational flop 01 10, 0 00, 0 D Q Circuit 10 10, 0 00, 1 CLK Excitation Table NextStateOput D1 D0 y StateInput 000 0 1 0 001 0 0 0 010 1 0 0 011 0 0 0 100 1 0 0 101 0 0 1 110 X X X 111 X X X 17

  18. input output Life on Mars State Truth Table D Flip- flop State\Input 0 1 D Q Combin 00 01, 0 00, 0 D Flip- ational flop 01 10, 0 00, 0 D Q Circuit 10 10, 0 00, 1 CLK Excitation Table K-Map — D1 NextStateOput K-Map — D0 D1 D0 y StateInput 0,0 0,1 1,1 1,0 000 0 1 0 0,0 0,1 1,1 1,0 0 0 1 X 1 001 0 0 0 1 0 X 0 0 1 0 0 X 0 010 1 0 0 1 0 0 X 0 D1 = x’Q 0 +x’Q 1 011 0 0 0 D0 = Q 0 ’Q 1 ’x’ 100 1 0 0 K-Map — y 0,0 0,1 1,1 1,0 101 0 0 1 110 X X X 0 0 X 0 0 111 X X X y = Q 1 ’x 1 0 0 X 1 18

  19. Circuit — Life on Mars D1 = x’Q 0 +x’Q 1 D0 = Q 0 ’Q 1 ’x’ x D Flip- y = Q 1 ’x flop D Q0 D Flip- y flop input output D Q1 D Flip- flop D Q Combin Clk D Flip- ational flop D Q Circuit CLK 19

  20. Canonical Form: Mealy and Moore Machines 20

  21. Canonical Form: Mealy and Moore Machines Moore Machine Mealy Machine x(t) x(t) y(t) C1 C2 y(t) C1 C2 Clk Clk S(t) y i (t) = f i (x(t), S(t)) y i (t) = f i (S(t)) S i (t+1) = g i (x(t), S(t)) S i (t+1) = g i (x(t), S(t)) S(t) input input/output Si Sj Si Sj output Result depends on both input and Result only depends on the current state the current state 21

  22. Poll close in Moore or Mealy? — Life on Mars • Which type of state machine can describe the “Life on Mars” pattern recognizer of “001”. Moore Machine A. Moore machine x(t) B. Mealy machine y(t) C1 C2 C. Both Clk Mealy Machine D. None x(t) y(t) C1 C2 Clk S(t) 22

  23. Moore or Mealy? — Life on Mars • Which type of state machine can describe the “Life on Mars” pattern recognizer of “001”. Moore Machine A. Moore machine x(t) B. Mealy machine y(t) C1 C2 C. Both Clk Mealy Machine D. None x(t) y(t) C1 C2 Clk S(t) 23

  24. Poll close in Moore machine for Life on Mars • What does state table need to show to design controls of C2 to implement pattern recognizer “001”? A. (current input x(t), current state S(t) vs. next state, S(t+1)) B. (current input, current state vs. current output y(t)) C. (current state vs. current output y(t) and next state) D. (current state vs. current output y(t) ) Moore Machine E. None of the above x(t) y(t) C1 C2 input Si Sj Clk output 24

  25. Moore machine for Life on Mars • What does state table need to show to design controls of C2 to implement pattern recognizer “001”? A. (current input x(t), current state S(t) vs. next state, S(t+1)) B. (current input, current state vs. current output y(t)) C. (current state vs. current output y(t) and next state) D. (current state vs. current output y(t) ) Moore Machine E. None of the above x(t) y(t) C1 C2 input Si Sj Clk output 25

  26. Conversion from Mealy to Moore ① Identify distinct (Next State, y) pair ② Replace each distinct (Next State, y) pair with distinct new states ③ Insert rows of present state = new states ④ Append each present state with its output y Next State Next State Current Current Input Input Output State State 0 1 0 1 S0 S1 S0 0 S0 S1, 0 S0, 0 S1 S2 S0 0 S1 S2, 0 S0, 0 S2 S2 S3 0 S2 S2, 0 S0, 1 S3 26

  27. Poll close in Conversion from Mealy to Moore ① Identify distinct (Next State, y) pair Next State Current Input ② Replace each distinct (Next State, y) pair State 0 1 with distinct new states S0 S1, 0 S0, 0 ③ Insert rows of present state = new states S1 S2, 0 S0, 0 S2 S2, 0 S0, 1 ④ Append each present state with its output y • For the given Moore machine, what are the next states with respect to present state S3? Next State Current Input Output A. S2, S3, 1 State 0 1 B. S2, S0, 1 S0 S1 S0 0 C. S1, S0, 1 S1 S2 S0 0 D. S1, S0. 0 S2 S2 S3 0 S3 E. None of the above. 27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend