Latches and Flip-Flops

Slides:



Advertisements
Similar presentations
Introduction to Sequential Logic Design Latches. 2 Terminology A bistable memory device is the generic term for the elements we are studying. Latches.
Advertisements

1 Lecture 14 Memory storage elements  Latches  Flip-flops State Diagrams.
Edge Triggered Flip Flops (extended slides). Level-Sensitive Flip-Flop Level-sensitive flip-flop (also called a latch) Q changes whenever clock is high.
Computer Science 210 Computer Organization Clocks and Memory Elements.
Latches CS370 –Spring 2003 Section 4-2 Mano & Kime.
CENG 241 Digital Design 1 Lecture 8 Amirali Baniasadi
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
Sequential circuits The digital circuits considered thus far have been combinational, where the outputs are entirely dependent on the current inputs. Although.
 Seattle Pacific University EE Logic System DesignLatches-1 Feedback Circuits Two inverters, with feedback If the first input is 0, a 0 gets fed.
Sequential logic circuits. 2 Outline Sequential Circuit Models –Asynchronous –Synchronous Latches Flip-Flops.
Sequential Logic Latches & Flip-flops
ReturnNext  Latch : a sequential device that watches all of its inputs continuously and changes its outputs at any time, independent of a clocking signal.
1 CS 151: Digital Design Chapter 5: Sequential Circuits 5-3: Flip-Flops I.
Latches and Flip-Flops Discussion D8.1 Section 13-9.
1. 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates whose outputs are determined from the current combination of inputs.
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
Edge-Triggered D Flip-Flops Discussion D4.2 Example 26.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
Logic Design Fundamentals - 3 Discussion D3.2. Logic Design Fundamentals - 3 Basic Gates Basic Combinational Circuits Basic Sequential Circuits.
Latches Module M10.1 Section 7.1. Sequential Logic Combinational Logic –Output depends only on current input Sequential Logic –Output depends not only.
EECC341 - Shaaban #1 Lec # 13 Winter Sequential Logic Circuits Unlike combinational logic circuits, the output of sequential logic circuits.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
Latches Section 4-2 Mano & Kime. Sequential Logic Combinational Logic –Output depends only on current input Sequential Logic –Output depends not only.
Logic Design Review – 3 Basic Sequential Circuits Lecture L14.3 Verilog.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
Latches Lecture L8.1 Section 7.1 – Book Sect. 8.1– Handout.
Sequential Circuits. 2 Sequential vs. Combinational Combinational Logic:  Output depends only on current input −TV channel selector (0-9) Sequential.
Latches and Flip-Flops Discussion D4.1 Appendix J.
A clocked synchronous state-machine changes state only when a triggering edge or “tick” occurs on the clock signal. ReturnNext  “State-machine”: is a.
Flip-Flops Lecture L8.2 Section 7.1 – Book Sect. 8.1– Handout.
Flip-Flops Section 4.3 Mano & Kime. D Latch Q !Q CLK D !S !R S R X 0 Q 0 !Q 0 D CLK Q !Q Note that Q follows D when the clock in high, and.
Flip Flops. Clock Signal Sequential logic circuits have memory Output is a function of input and present state Sequential circuits are synchronized by.
ETE Digital Electronics Latches and Flip-Flops [Lecture:12] Instructor: Sajib Roy Lecturer, ETE, ULAB.
Lecture #23 Page 1 ECE 4110– Sequential Logic Design Lecture #23 Agenda 1.Latches and Flip-Flops Review Announcements 1.HW #11assigned.
Latch Flip flop.
Introduction to Sequential Logic Design Flip-flops.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
ENG241 Digital Design Week #6 Sequential Circuits (Part A)
D Latch Delay (D) latch:a) logic symbolb) NAND implementationc) NOR implementation.
Unit 11 Latches and Flip-Flops Fundamentals of Logic Design By Roth and Kinney.
Sequential Logic Combinatorial components: the output values are computed only from their present input values. Sequential components: their output values.
Topic: Sequential Circuit Course: Logic Design Slide no. 1 Chapter #6: Sequential Logic Design.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Feb. 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 12: State Elements, Registers, and Memory * Jeremy R. Johnson Mon. Feb.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
1 Synchronous Sequential Logic Sequential Circuits Every digital system is likely to have combinational circuits, most systems encountered in practice.
CEC 220 Digital Circuit Design Latches and Flip-Flops Monday, March 03 CEC 220 Digital Circuit Design Slide 1 of 19.
Sequential logic circuits
CEC 220 Digital Circuit Design VHDL in Sequential Logic Wednesday, March 25 CEC 220 Digital Circuit Design Slide 1 of 13.
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
5 Chapter Synchronous Sequential Circuits 1. Logic Circuits- Review 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates.
Sahar Mosleh PageCalifornia State University San Marcos 1 More on Flip Flop State Table and State Diagram.
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
Dept. of Electrical and Computer Eng., NCTU 1 Lab 8. D-type Flip-Flop Presenter: Chun-Hsien Ko Contributors: Chung-Ting Jiang and Lin-Kai Chiu.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
A latch is a temporary storage device that has two stable states (bistable). It is a basic form of memory. The S-R (Set-Reset) latch is the most basic.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
CENG 241 Digital Design 1 Lecture 7 Amirali Baniasadi
Latches-1 Feedback Circuits Two inverters, with feedback If the first input is 0, a 0 gets fed back into it If the first input is 1, a 1 gets fed back.
Dept. of Electrical Engineering
7. Latches and Flip-Flops Digital Computer Logic.
1. 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates whose outputs are determined from the current combination of inputs.
Week #6 Sequential Circuits (Part A)
LAB #6 Sequential Logic Design (Flip Flops, Shift Registers)
Lecture 8 Dr. Nermi Hamza.
Flip Flops.
Chapter 6 -- Introduction to Sequential Devices
V out1 5 = V in2 V in1 = V out2 7. Latches and Flip-Flops
1) Latched, initial state Q =1
(Sequential-Circuit Building Blocks)
Presentation transcript:

Latches and Flip-Flops Discussion D7.1

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

Sequential Logic Combinational Logic Sequential Logic Output depends only on current input Sequential Logic Output depends not only on current input but also on past input values Need some type of memory to remember the past input values

Cross-coupled Inverters State 1 State 2

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 1 1 1 0 1 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 0 0 0 1 1 0 1 1 1 1 0 1 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 1 1 1 0 1 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 1 1 0 Set 1 0 1 X Y nand 0 0 1 1 0 0 0 1 1 0 1 1 1 0 Set 1 0 1 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 1 0 0 0 1 1 0 1 1 1 0 Set 1 0 1 Store 1 0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 1 0 0 0 1 1 0 1 0 Set 1 1 0 1 Store 1 0 X Y nand 0 0 0 1 1 0 1 1 1 0 Set 0 1 Store 1 0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 1 0 0 0 1 1 0 1 1 1 0 Set 1 0 1 Store 1 0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 0 Set 1 1 0 1 Reset 1 0 1 Store 0 0 0 1 1 0 1 1 1 0 Set 0 1 Reset 1 0 1 Store 1 0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 1 1 0 Set 0 1 Reset 1 1 0 1 Store 0 0 0 1 1 0 1 1 1 0 Set 0 1 Reset 1 1 0 1 Store 1 0 X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 1 1 Disallowed 0 1 1 0 1 0 Set 1 1 0 1 Reset 1 0 0 0 1 1 0 1 1 1 1 Disallowed 1 0 Set 0 1 Reset 1 0 1 Store 1 0 Q0 Q0' X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

SR Latch S' R' Q Q' 1 0 0 0 1 1 0 1 1 1 1 Disallowed 1 0 Set 0 1 Reset 0 0 0 1 1 0 1 1 1 1 Disallowed 1 0 Set 0 1 Reset 1 1 0 1 Store 1 0 Q0 Q0' X Y nand 0 0 1 0 1 1 1 0 1 1 1 0 To close or lock with or as if with a latch, To catch or fasten

SR Latch with Enable S R EN S' R' Q Q' 0 0 1 1 1 Q0 Q0' Store 0 1 1 1 0 0 1 Reset 1 0 1 0 1 1 0 Set 1 1 1 0 0 1 1 Disallowed X X 0 1 1 Q0 Q0' Store

RS Latch RS Latch R S Q Q is set to 1 when S is asserted, and remains unchanged when S is disasserted. Q is reset to 0 when R is asserted, and remains unchanged when R is disasserted. Assertions can be active HIGH or active LOW

R Q RS Latch S Active HIGH library IEEE; use IEEE.STD_LOGIC_1164.all; entity rslatch is port( R : in STD_LOGIC; S : in STD_LOGIC; Q : out STD_LOGIC ); end rslatch; architecture rslatch of rslatch is begin process(R,S) if S = '1' and R = '0' then Q <= '1'; elsif S = '0' and R = '1' then Q <= '0'; end if; end process; RS Latch R S Q Active HIGH

RS Latch -- Active High

R Q RS Latch S Active LOW library IEEE; use IEEE.STD_LOGIC_1164.all; entity rslatch is port( R : in STD_LOGIC; S : in STD_LOGIC; Q : out STD_LOGIC ); end rslatch; architecture rslatch of rslatch is begin process(R,S) if S = '0' and R = '1' then Q <= '1'; elsif S = '1' and R = '0' then Q <= '0'; end if; end process; RS Latch R S Q Active LOW

RS Latch -- Active Low

How can you make this RS latch from gates? Q Q is set to 1 when S is asserted, and remains unchanged when S is disasserted. Q is reset to 0 when R is asserted, and remains unchanged when R is disasserted. Assertions can be active HIGH or active LOW

Q is set to 1 when S is asserted (1), and remains unchanged when S is disasserted (0). Q is reset to 0 when R is asserted (1), and remains unchanged when R is disasserted (0). R S Q Q 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 R SQ 00 01 11 10 1 store 1 1 1 set 1 reset store Q = R'Q + R'S + SQ RS Latch R S Q

RS Latch Q = R'Q + R'S + SQ R S Q Q 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 1 1 1 1 store set reset store RS Latch R S Q Q = R'Q + R'S + SQ

use IEEE.STD_LOGIC_1164.all; entity rslatchgates is port( library IEEE; use IEEE.STD_LOGIC_1164.all; entity rslatchgates is port( R : in STD_LOGIC; S : in STD_LOGIC; Q : out STD_LOGIC ); end rslatchgates; architecture rslatchgates of rslatchgates is signal Q1: std_logic; begin Q1 <= (not R and Q1) or (not R and S) or (S and Q1); Q <= Q1; Q1

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

D Latch D Latch D EN Q Q follows D when EN is high, and remains unchanged when EN is low..

D Q D Latch EN library IEEE; use IEEE.STD_LOGIC_1164.all; entity dlatch is port( D : in STD_LOGIC; EN : in STD_LOGIC; Q : out STD_LOGIC ); end dlatch; architecture dlatch of dlatch is begin process(D,EN) if EN = '1' then Q <= D; end if; end process; D Latch D EN Q

D Latch

D Latch S S' R' R S R EN Q Q' D EN Q Q' 0 0 1 Q0 Q0' Store 0 1 0 1 0 1 1 0 1 Reset 1 0 1 1 0 Set 1 1 1 1 1 Disallowed X X 0 Q0 Q0' Store 0 1 0 1 1 1 1 0 X 0 Q0 Q0' D EN Q Q'

D Latch S S' R' R D EN Q Q' Note that Q follows D when EN in high, 0 1 0 1 1 1 1 0 X 0 Q0 Q0' D EN Q Q' Note that Q follows D when EN in high, and is latched when EN goes to zero.

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

D Flip-Flop D gets latched to Q on the rising edge of the clock. clk D Q Q' 0 0 1 1 1 0 X 0 Q0 Q0' D clk Q Q' Positive edge triggered D gets latched to Q on the rising edge of the clock. Behavior if rising_edge(clk) then Q <= D; end if;

D Q clk Q' library IEEE; use IEEE.STD_LOGIC_1164.all; entity dflipflop is port( D : in STD_LOGIC; clk : in STD_LOGIC; Q : out STD_LOGIC; NotQ : out STD_LOGIC ); end dflipflop; architecture dflipflop of dflipflop is signal QS: STD_LOGIC; begin process(D,clk) if rising_edge(clk) then QS <= D; end if; end process; Q <= QS; NotQ <= not QS; clk D Q Q'

D Flip-Flop

D Q clk Q' library IEEE; use IEEE.STD_LOGIC_1164.all; entity dflipflop is port( D : in STD_LOGIC; clk : in STD_LOGIC; Q : out STD_LOGIC; NotQ : out STD_LOGIC ); end dflipflop; architecture dflipflop of dflipflop is signal QS: STD_LOGIC; begin process(D,clk) if clk'event and clk = '1' then QS <= D; end if; end process; Q <= QS; NotQ <= not QS; clk D Q Q'

D Flip-Flop

Master-Slave D Flip-Flop

Master-Slave D Flip-Flop

Recall the SR Latch S' R' Q Q' 1 0 0 1 1 Disallowed 0 1 1 0 1 0 Set 1 0 0 0 1 1 0 1 1 1 1 Disallowed 1 0 Set 0 1 Reset 1 0 1 Store 1 0 Q0 Q0' X Y nand 0 0 1 0 1 1 1 0 1 1 1 0

Edge-triggered D Flip-flop 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1 1

Edge-triggered D Flip-flop 1 1 1 1 1

Spartan 3 CLB slices

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

J-K Flip-flops J K Qnext 0 0 Q 0 1 0 1 0 1 1 1 Q' Qnext = JQ' + K'Q

J-K Flip-flops J K Qnext 0 0 Q 0 1 0 1 0 1 1 1 Q'

Latches and Flip-Flops SR Latch D Latch Flip-Flops D Flip-Flop JK Flip-Flop T Flip-Flop

T Flip-flops T Qnext 0 Q 1 Q'

T Flip-flops T Qnext 0 Q 1 Q'