Menu. Master-Slave Flip-Flop

Similar documents
Digital Logic Design - Chapter 4

Menu. Part 2 of 3701: Sequential Digital Machines Latches and Flip-Flops: >S-R latches >D latches >T latches. Comb. n. Logic. m Q.

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

Chapter #6: Sequential Logic Design

Problem Set 9 Solutions

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 7 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Topic 8: Sequential Circuits

Time Allowed 3:00 hrs. April, pages

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output of

Sequential Logic Circuits

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

Fundamentals of Digital Design

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

P2 (10 points): Given the circuit below, answer the following questions:

ALU A functional unit

Chapter 4. Sequential Logic Circuits

LOGIC CIRCUITS. Basic Experiment and Design of Electronics

Synchronous Sequential Logic

Chapter 7. Sequential Circuits Registers, Counters, RAM

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

14:332:231 DIGITAL LOGIC DESIGN

Clocked Synchronous State-machine Analysis

Digital Design. Sequential Logic

Lecture 8: Sequential Networks and Finite State Machines

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Lecture 7: Logic design. Combinational logic circuits

Digital Electronics Circuits 2017

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

FSM model for sequential circuits

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

ALU, Latches and Flip-Flops

Sequential Circuit Analysis

ELCT201: DIGITAL LOGIC DESIGN

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Topic 8: Sequential Circuits. Bistable Devices. S-R Latches. Consider the following element. Readings : Patterson & Hennesy, Appendix B.4 - B.

Digital Electronics Sequential Logic

EEE2135 Digital Logic Design

Sequential Circuits Sequential circuits combinational circuits state gate delay

Finite State Machine. By : Ali Mustafa

Menu. EEL3701 Classical Design

Appendix B. Review of Digital Logic. Baback Izadi Division of Engineering Programs

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

Chapter 7. Synchronous Sequential Networks. Excitation for

Total time is: 1 setup, 2 AND, 3 XOR, 1 delay = (1*1) + (2*2) + (3*3) + (1*1) = 15ns

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

ELE2120 Digital Circuits and Systems. Tutorial Note 9

EE 209 Logic Cumulative Exam Name:

Adders allow computers to add numbers 2-bit ripple-carry adder

Chapter 5 Synchronous Sequential Logic

Lecture 10: Synchronous Sequential Circuits Design

Design of Sequential Circuits

Lecture 14: State Tables, Diagrams, Latches, and Flip Flop

Delhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:

Sequential vs. Combinational

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

EET 310 Flip-Flops 11/17/2011 1

Sequential Circuit Design

EE141- Spring 2007 Digital Integrated Circuits

Lecture 3 Review on Digital Logic (Part 2)

Philadelphia University Student Name: Student Number:

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Lecture 9: Sequential Logic Circuits. Reading: CH 7

Sample Test Paper - I

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

Integrated Circuits & Systems

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

EE 330 Lecture 6. Improved Switch-Level Model Propagation Delay Stick Diagrams Technology Files

Designing Sequential Logic Circuits

5. Sequential Logic x Computation Structures Part 1 Digital Circuits. Copyright 2015 MIT EECS

COE 202: Digital Logic Design Sequential Circuits Part 4. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

Adders, subtractors comparators, multipliers and other ALU elements

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified)

on candidate s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept.

Schedule. ECEN 301 Discussion #25 Final Review 1. Date Day Class No. 1 Dec Mon 25 Final Review. Title Chapters HW Due date. Lab Due date.


Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

EECS 270 Midterm 2 Exam Answer Key Winter 2017

COE 202: Digital Logic Design Sequential Circuits Part 3. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

CS61C : Machine Structures

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

Lecture A: Logic Design and Gates

EECS150 - Digital Design Lecture 23 - FSMs & Counters

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Digital Logic Design. Midterm #2

Adders, subtractors comparators, multipliers and other ALU elements

Digital Fundamentals

Chapter 15 SEQUENTIAL CIRCUITS ANALYSIS, STATE- MINIMIZATION, ASSIGNMENT AND CIRCUIT IMPLEMENTATION

Logical design of digital systems

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Fundamentals of Computer Systems

CS61C : Machine Structures

Transcription:

Menu Clocks and Master-lave Flip-Flops J-K and other Flip-Flops Truth table & excitation table Adders (see [Lam: pg 130]) Counters Look into my... 1 CLK Master-lave Flip-Flop Master-lave Latch/Flip-Flop E Complex Circuit CLK t c = time when signals change t w = digital systems do their work here, others finish their work in this phase Most digital systems expect their inputs to be stable very early in the t c phase of the clock. As drawn, it is possible for and/or to change while CLK = 1 (during t c ). (active-high and -low) may change during time t c even though other hardware expect them to be stable!! t c t w 2 1

Master-lave Flip-Flop : How do we solve this problem? A: Use 2 latch s, one master, one slave. ignals do not change during t c. (This is a digital-only solution; the 3 rd option discussed earlier.) : Why? A: Now {(H), (L)} will not change until t w. Hence, inputs to other systems are stable during t c. CLK Master E E lave t c t w CLK Master-lave - Flip-Flop t w t c 3 Master-lave JK FF Gated - Latch (H) re-et (L) E Master-lave J-K FF (Falling Edge Clock) J K E(H) (H) Master E re-clear lave E (H) J-K FF with falling edge-clock J K > With master-slave FFs we have a completely digital solution to the stable input problem. No oscillation occurs!!!! LogicWorks JK_from_M-_*.cct 4 2

Master-lave J-K FF (ising Edge Clock) Master J K E lave J K E Flip-Flops J-K FF with rising edge-clock J K J-K FF with falling edge-clock J K T-FF using JK -FF using JK -FF using T J K J K How about constructing a JK with a? Hint: = J / /K 5 -FF using Two MUXs esigned by Alex Kagioglu, a UF EEL 4712 student, 2008 (H) CLK 2-input MUX 0 Y CLK 1 0 el 2-input MUX 1 el Y (H) d-ff_mux.bdf d-ff_mux.vwf mux2to1.vwf 6 3

J-K Flip-Flop Excitation Table for J-K FF Next tate Truth Table for J-K FF Abbreviated Next tate Truth Table for J-K FF Abbreviated Excitation Table for J-K FF K-Map gives = J / /K ( = / ) 7 ising edge triggered JK-FF Timing iagram J K Lam: Figure 5.2 8 4

ising edge triggered -FF Timing iagram Lam: Figure 5.2 9 Adder Circuits using Memory 1: Is addition sequential? A1: No. (At least not from what we previously learned.) It can be implemented with a combinational circuit. But we CAN make a sequential adder: X i (H) Y i (H) CLK A B C i C i1 FA UM i (H) C i1 (H) > In this circuit a 1-bit FA with a -FF can be used to add an arbitrary N-bit number (e.g., a 32 bit number). But a 32 bit adder without memory requires, for example, eight 74 283 4-bit parallel adders. 10 5

X i (H) Y i (H) CLK Adder Circuits using Memory A B C i C i1 FA UM i (H) C i1 (H) Lam: Figure 5.5 (Ex 5.1) 11 N-bit Adder (Using Memory and 1-bit FA) 2: How big can N be? What is the cost? A2: As big as you want --- same (IC) cost. Observations: >(1) We can often realize complex combinational logic with simple sequential logic >(2) We can realize impossible combinational functions with sequential logic (e.g., counting) >(3) The trade-off is parallel (combinational) vs. sequential circuits, and time vs. hardware complexity arallel circuits obtain a sum in 1 clock tick; serial circuits require N clock ticks. 12 6

teps for Counter esign ecall we mentioned in lecture #2 that counting requires memory. In the next few page we will design a 3-input (8 state or 2 3 ) counter. There are several steps in the design of sequential circuits: > evelop a state diagram > Make a next state truth table (NTT) > ick FFs and get excitation info to NTT > Add outputs to NTT > Get equations for FF inputs and outputs > esign circuits based on the equations A counter turns out to have very simple steps! We will show that some of the steps above are trivial Assumption: A clock pulse is used to clock the counter > (example/analogy) A car counter used by the road department 13 Counter esign tep 1 esign a counter that counts the following sequence: 2 1 0 = 100, 010, 111, 110, 011, 000, 101, 001,100,... tart 001 101 100 010 111 110 Note the strange counting sequence: 4, 2, 7, 6, 3, 0, 5, 1, 4, 2, 7, 000 011 14 7

3-bit counter (with 2 3 =8 states) needs 3 FF s From the desired counter sequence, for 2 (the next state for 2 ) we obtain the sequence, 0 1 1 0 0 1 0 1, i.e., column 2 of the counter sequence but delayed (starting in row 2) by 1 row > 1 : 1 1 1 1 0 0 0 0 > 0 : 0 1 0 1 0 1 1 0 > ut this in a next state truth table (NTT) For each FF, we develop state equations > For -FFs i = i, i.e., what comes in goes out immediately after the clock Notice that the counting order truth table (shown here) is preferred Counter esign tep 2 tart 100 010 111 001 101 110 000 011 Current Next 2 1 0 2 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 15 Counter esign tep 3a 2 2 Using these sequences, we fill 3 K-maps, one for each of 2, 1, & 0. / 2 / 0 2 1 0 2 = / 2 / 0 / 2 / 1 2 1 0 = 2 / 2 / 1 Current Next 2 1 0 2 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 16 8

Counter esign tep 3b 1 1 Using these sequences, we fill 3 K-maps, one for each of 2, 1, & 0. 2 / 0 1 / 0 1 = 2 / 0 1 / 0 2 1 = 1 2 1 Current Next 2 1 0 2 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 17 Counter esign tep 3c 0 0 Using these sequences, we fill 3 K-maps, one for each of 2, 1, & 0. / 2 / 0 1 / 0 2 / 1 0 0 = / 2 / 0 1 / 0 2 / 1 0 = 0 Current Next 2 1 0 2 1 0 0 0 0 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 0 0 1 1 1 1 1 1 1 0 18 9

Counter esign tep 4,5,6 2 = / 2 / 0 2 1 0 / 2 / 1 = f 2 ( 2, 1, 0 ) = 2 1 = 2 / 0 1 / 0 2 1 = f 0 ( 2, 1, 0 ) = 1 2, 1, 0 2, 1, 0 Comb 2 Comb 1 2 1 2 1 0 = / 2 / 0 1 / 0 2 / 1 0 = f 0 ( 2, 1, 0 ) = 0 2, 1, 0 Comb 0 0 0 one! CLK 19 Activation-Levels for tate Bits What if one (or more) of the state bits ( i ) is active-low? >As you may recall, when we first started discussing circuits we feedback, I stated that with these types of circuits it is often easier to deal with voltages rather than with logic. ecommendations: >esign the next state circuits for counters (and other state machines) with all active-high state-bits >Then design the output circuits using the appropriate (specified) activation levels 20 10

tate Machine esign Inputs Inputs Clk s Next tate Comb. Logic Clk Flip- Flops s Output Comb. Logic Outputs s For Moore machines, there are no dashed line Inputs ; Mealy machines have these inputs For counters, state bits ( s) are generally some of the outputs, but might be active-low or active-high 21 Another Counter esign: tep 1 esign a counter that counts the following sequence: 1 2 3 = 000, 001, 101, 100, 010, 110, 111, 011, 000,... Note that naming of the state bits ( 1 2 3 ) different than 1st example Observation: imple! Each bubble (node) is a state. The only input is a pulse,. Note the counting sequence: 0, 1, 5, 4, 2, 6, 7, 3, 0, 1, 5, tart 000 011 111 001 110 010 101 100 22 11

Another Counter esign: tep 2 3 bit counter (8 states or 2 3 =8) 3 FF s From the desired counter sequence, for 1 (the next state from 1 ) we obtain the sequence, 0 1 1 0 1 1 0 0, i.e., column 1 of the counter sequence but delayed (starting in row 2) by 1 row. > 2 : 0 0 0 1 1 1 1 0 > 3 : 1 1 0 0 0 1 1 0 > ut this in a next state truth table (NTT) For each FF, we develop state equations > For -FFs i = i, i.e., what comes in goes out Counting: 0, 1, 5, 4, 2, 6, 7, 3, 0, 1, 5, 1 2 3 1 2 3 0 0 0 0 0 1 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 0 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 23 Another Counter esign: tep 3 1 Using these sequences we fill 3 K-maps, one for each of 1, 2, & 3. 1 1 2 2 3 2 3 2 3 1 3 1 2 1 2 1 = 2 3 2 3 = 2 3 = 1 2 = 1 2 1 3 2 3 = 2 3 = 1 2 1 2 = ( 1 2 ) = 1 2 = 3 24 12

Another Counter esign: tep 4-5 1 1 TE 3 TE 4 Choose FF s to realize i, i=1,2,3. Choose -FF because i = i. imple!!! 1 = 1, 2 = 2, and 3 = 3. What are the output equations? O 1 = 1, O 2 = 2, and O 3 = 3 imple! You could get the outputs from i, but the i s are better with regard to a starting count 2 3 2 3 25 Another Counter esign: tep 6 TE 5 ealize using -FF, T-FF, -FF or JK-FFs Observation: This circuit contains feedback! ince the flip-flops are edge triggered, after the signal propagates through the combinational network, they do not feedback around to change the states. counter2.cct 2 3 1 2 1 / 3 2 / 3 1 2 Combinational Network 1 2 3 CLK 1 2 3 Vcc eset GN 26 13

Another Counter esign: tep 6 TE 6 Check it with LogicWorks >Build it >imulate it Counter2.cct BOUNCING!! 27 witch Bouncing 28 14

witch Bouncing 29 igital witch ebounce Circuit (with T) The - latch should be made with NAN s or NO s > - latch below is made with a -FF used as an - latch 5V Vcc ON OFF C CLN_IN(H) CLN_IN(L) ebounced_witch.cct 30 15

Bouncing with T 6V 4V 2V 0V 0ms 1ms 2ms 31 ebounce Circuit esponse 6V 4V 2V 0V 0ms 1ms 2ms 32 16

Wrong Time cale for Bouncing with T 6V 4V 2V 0V 0ns 50ns 100ns 150ns 200ns 33 Analog witch ebounce Circuit (with T) Not a good solution, but one that will probably work for HC chips. hould use a chmitt Trigger (74 14) with below Vcc ebounced witch.cct 34 17

& A : Can we obtain a cheaper solution using other FF s? A: ossibly. ome like to use JK FFs because you can make any FF using JK. : But shouldn t you use T or -vs- JK because they are slightly faster? A: It is true that a master/slave JK is slightly slower. Typical t 20 ~ 50 ns. Inverters (level shifters) have t 5-10 ns. Unless you have a very high frequency 20 ~ 50 ns (1 ns = 10-9 sec) it is still fast (50-20MHz)! : You start the counter at 000. Anywhere else? A: Yes. The i s are pre-cleared to start at 000. Any other state is relatively simple to obtain using pre-clear/pre-set. : Who would build such a counter? (i.e., to go 0 1 5 4 2 6 7 3 0) A: Nobody (probably). I wanted to show you that it can be designed using any count sequence you wish. this is a pedagogical example! 35 rocedure for equential tate Machine esign evelop a state diagram > Use bubbles for states, arrows for transitions Create a next state truth table ick FF and add to NTT Add outputs to NTT Use K-maps to find equations to drive the FF inputs to generate the required outputs esign the circuit based on the equations >Use selected FF s and other logic gates 36 18

s 0 000 s 7 011 tate Machine Counter esign teps art 1 s 1 001 s 2 101 s 5 110 s 6 111 Next state truth table just adds a i = i s 3 100 Fill up K-Maps for i using the original order {0 1 5 4 2 6 7 3 0} s 4 010 1 2 3 (ex) When 1 2 3 =000, 1 =0, 2 =0, and 3 =1 1 2 3 =101, 1 =1, 2 =0, and 3 =0 37 tate Machine Counter esign teps art 2 ince using -FF (because i = i ) then = 1 = 1, 2 = 2, and 3 = 3. 1 = 2 3, 2 = 1 2 1 3 2 / 3, and 3 = /( 1 2 ) ince the outputs are the s, i.e., O i = i (or O i = i ) O 1 = 1, O 2 = 2, and O 3 = 3 ET 38 19

tate Machine Counter esign w/ FF s Let s do it with FF s. CLK ince we only want to count, O i = i O 1 = 1, O 2 = 2, and O 3 = 3. 39 tate Machine Counter esign w/ FFs [Example] esign the counter{0 1 5 4 2 6 7 3 0} From the previous example we have: 1 1 2 2 3 3 Use Excitation Table to Complete the esign 40 20

tate Machine Counter esign w/ FFs [Example] esign the counter{0 1 5 4 2 6 7 3 0} From the previous example we have: 41 tate Machine Counter esign w/ FFs 0 1 5 4 2 6 7 3 0 start ecall: 1 goes 0 0 1 1 0 1 1 0 0 Each arrow is an 1 goes 0 1 1 0 1 1 0 0 entry in the K-map next For 1 = f( i s) For 1 = f( i s) 1 = 2 3 1 = / 1 = /( 2 3 ) 42 21

tate Machine Counter esign w/ FFs For 1 For 1 1 = 2 3 1 = / 1 = /( 2 3 ) 2 3 This is a -FF! CLK 1 o you suppose that we can trivially obtain 2, 2 and 3, 3 since we see a -FF? ulse Now do similar for 2 and 3 43 U esign an Up/own Counter Let us design a more general Up/own Counter 00 11 U U 01 10 This is a 2-input 4-state system. * Inputs:, U * tates: 1, 0 U = own ulse U = Up ulse U 1 U 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 1 0 1 0 1 1 0 1 0 0 0 1 1 1 0 0 1 0 0 1 1 0 0 X X 1 1 0 1 X X 44 22

esign an Up/own Counter 1 U 00 11 U U 01 10 U = own ulse U = Up ulse U 1 Could add an output when the count is at a certain value > Modify NTT > Get new equation 0 45 Next tate Truth Table You can make a next state truth table >Inputs: 1 and 0 (the state), U, >Intermediate outputs: 1 and 0 (the next state) >Outputs depend on type of flip-flop(s) desired and will require use of excitation tables and use of i & i If using JK-FFs: Outputs: J 1, K 1 and J 0, K 0 If using -FFs Outputs: 1, 0 If using one JK-FF for MB and one -FF for LB Outputs: J 1, K 1 and 0 This option is very common in exams! 46 23

The End! 47 24