CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Similar documents
Chapter 6. Flip-Flops and Simple Flip-Flop Applications

6. Sequential Logic Flip-Flops

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

(CSC-3501) Lecture 7 (07 Feb 2008) Seung-Jong Park (Jay) CSC S.J. Park. Announcement

CHAPTER 4: Logic Circuits

Unit 11. Latches and Flip-Flops

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Lecture 8: Sequential Logic

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Chapter 11 Latches and Flip-Flops

D Latch (Transparent Latch)

Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

CHAPTER 4: Logic Circuits

INTRODUCTION TO SEQUENTIAL CIRCUITS

The outputs are formed by a combinational logic function of the inputs to the circuit or the values stored in the flip-flops (or both).

CHAPTER1: Digital Logic Circuits

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Logic Design. Flip Flops, Registers and Counters

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Section I: Digital System Analysis and Review

Sequential Logic and Clocked Circuits

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

LATCHES & FLIP-FLOP. Chapter 7

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

Digital Fundamentals: A Systems Approach

Synchronous Sequential Logic

ECE 341. Lecture # 2

Combinational vs Sequential

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

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

Asynchronous (Ripple) Counters

Engr354: Digital Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

Sequential Circuits: Latches & Flip-Flops

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

DIGITAL CIRCUIT LOGIC UNIT 11: SEQUENTIAL CIRCUITS (LATCHES AND FLIP-FLOPS)

Feedback Sequential Circuits

Digital Fundamentals

CHAPTER 1 LATCHES & FLIP-FLOPS

Counter dan Register

Chapter 5: Synchronous Sequential Logic

Review of digital electronics. Storage units Sequential circuits Counters Shifters

Advanced Digital Logic Design EECS 303

ELCT201: DIGITAL LOGIC DESIGN

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

Sequential Logic Circuits

IT T35 Digital system desigm y - ii /s - iii

Experiment 8 Introduction to Latches and Flip-Flops and registers

11. Sequential Elements

Slide Set 7. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

Sequential Logic Basics

Sequential Design Basics

Rangkaian Sekuensial. Flip-flop

Sequential Logic. E&CE 223 Digital Circuits and Systems (A. Kennings) Page 1

Introduction to Sequential Circuits

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

RS flip-flop using NOR gate

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

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

Introduction to Microprocessor & Digital Logic

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

EEE2135 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

ECE321 Electronics I

1. Convert the decimal number to binary, octal, and hexadecimal.

Administrative issues. Sequential logic

Microprocessor Design

211: Computer Architecture Summer 2016

Lec 24 Sequential Logic Revisited Sequential Circuit Design and Timing

EKT 121/4 ELEKTRONIK DIGIT 1

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

MC9211 Computer Organization

! Two inverters form a static memory cell " Will hold value as long as it has power applied

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

Flip-Flops and Sequential Circuit Design

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

CS 261 Fall Mike Lam, Professor. Sequential Circuits

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

Chapter 4. Logic Design

Other Flip-Flops. Lecture 27 1

COMP2611: Computer Organization. Introduction to Digital Logic

Switching Circuits & Logic Design

Memory elements. Topics. Memory element terminology. Variations in memory elements. Clock terminology. Memory element parameters. clock.

Chapter 8 Sequential Circuits

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

RS flip-flop using NOR gate

Chapter 5 Synchronous Sequential Logic

Chapter 5 Flip-Flops and Related Devices

Counters

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Sequential logic circuits

Transcription:

Faculty of Engineering CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Sections 7.1-7.2 Suggested Reading

A Generic Digital Processor Building Blocks for Digital Architectures INPUT - OUTPUT Interconnect: Switches, Arbiters, Bus, RAM, ROM, Registers, MEMORY DATAPATH Arithmetic Unit: Adder, Multiplier, Shifter, Comparator, CPU CONTROL Finite state machine: PLA, Counters, Flipflops, Latches,

Logic Devices Combinational Logic: Current output depends on current input only Gates Decoders Multiplexers ALUs Sequential Logic: Current output depends on past inputsas well as current input; thus has a memory (state). Latches and Flip-Flops State Machines Counters Shift Registers Combinational Logic Sequential Logic Memory

Sequential Logic Definitions STATE: A collection of state variables whose values contain all the information about the past values necessary to account for future behavior. (e.g. a TV tuner with up/down button) Circuit with nbinary state variables has2 n possible states Changes usually synchronized with a system clock Digital sequential logic Also known as a finite state machine (FSM).

Clock Characteristics Clock - the master timing element behind the state changes. State change Active High Period t L t H Frequency = 1/Period Period: time between successive transitions in the same direction State change Duty Cycle = t H /Period Active Low Period t L t H Duty Cycle: the percentage of time that a clock is at its assertion level. = t L /Period

Types of Sequential Logic A Feedback Sequential Circuituses gates with feedback to form memory elements (latches and flip/flops) used in state machines. A Clocked Synchronous State Machineuses clocked flip-flops to form useful sequential logic functions or application.

BistableElement The simplest possible feedback sequential logic circuit: It is bistable because it has two stable states: State 1: If Q (Q=V out1 =V in2 ) is high, the bottom inverter output (/Q =V out2 =V in1 ) is low, which keeps the top inverter output Q high. State 2: If Q is low, the bottom inverter output /Q is high, which keeps the top inverter output Q low.

BistableElement The simplest sequential circuit Two states One state variable, Q HIGH LOW LOW HIGH

Analog Analysis of Bistable Top Inverter alone Bottom Inverter alone Q V out1 V in2 V in1 V out2 /Q Complete Bistable V out1 =V in2 Stable High Metastable Stable Low V in1 =V out2

Bistableand Metastability There are not two stable states, but 3 states (a problem!) Metastable point occurs when both outputs are halfway between high and low not a valid logic level!!! Could last forever, but noise pushes towards a stable state.

Metastability

Latches and Flip-flops Common feedback sequential circuits Latch Single-bit storage (memory) Changes state at any timedue to input change Flip-flop Also single-bit storage Changes state ONLYwhen a clockedge or pulse is applied

Types of Latches and Flip-flops Latches S-R Latch /S-/R Latch S-R Latch with Enable D Latch Flip-flops Edge-Triggered D Flip-Flop Master/Slave S-R Flip-Flop Master/Slave J-K Flip-Flop Edge-Triggered J-K Flip-Flop T Flip-Flop

Back to the Bistable. How to control it? Screwdriver Control inputs S-R latch (set-reset)

S-R Latch Function Table Symbol S R Q /Q Set S Q Q Hold 0 0 Last Q Last /Q Reset 0 1 0 1 Reset R Q /Q Set 1 0 1 0 ILLEGAL 1 1 0 0 R Schematic Q Consider: 1. Timing Diagram 2. Propagation delay S /Q 3. Minimum pulse width 4. Oscillation

S-R latch Operation Schematic 10 R 0 Q 0? 10 S 0 /Q 0? Metastability is possible if S and R are negated simultaneously.

S-R latch Timing Parameters Propagation delay Minimum pulse width

S-R latch Symbols

S-R latch using NAND gates:/s-/r Latch Function Table /S /R Q /Q Illegal 0 0 1 1 Set 0 1 1 0 Reset 1 0 0 1 Hold 1 1 Last Q Last /Q

S-R Latch with Enable /S /R C Q /Q S C R Q Q 0 0 1 Last Q Last /Q 0 1 1 0 1 1 0 1 1 0 1 1 1 1 1 x x 0 Last Q Last /Q Only sensitive to S and R when enabled (C=1) Same oscillation problem

D Latch D Q C Q Store a data bit, not set/reset Transparent latch Setup and Hold time

D-latch Timing Parameters Propagation delay from C or D D should not change during: t setup (before C edge) +t hold (after C edge) Setup time Hold time

Positive-Edge-Triggered D Flip-Flop

D Flip-Flop Timing Parameters Propagation delay from CLK D should not change during: t setup (before C edge) +t hold (after C edge) Setup time Hold time

D flip-flop Versus Latch

Negative-edge triggered Other D flip-flop Variations Clock Enable Scan

Scan Flip-Flops --for testing TE = 0 normal operation TE = 1 test operation All of the flip-flops are hooked together in a daisy chain from external test input TI. Load up ( scan in ) a test pattern, do one normal operation, shift out ( scan out ) result on TO.

Asynchronous Inputs Most flip-flops have two asynchronous inputs Preset and Reset(or Clear) Directly set or reset the /S-/R latches Operate independent of clock USE asynchronous inputs for logic functions ONLY for system INITIALIZATION to a known state

Master/Slave S-R Flip-Flop S R C Q /Q x x 0 Last Q Last /Q S C R Q Q 0 0 Last Q Last /Q 0 1 0 1 1 0 1 0 1 1 Undef undef S C R Q Q S C R Q Q Pulse-triggered S-R flip-flop Pulse-catching behavior

J-K Flip-flops Not used much anymore

T (toggle) Flip-Flop T flip-flop changes state on every clock tick. Important for counters

Sequential PALs

Analysis of State Machines Characteristic Equations Describe the next state (QN) of a flip-flop as function of current state (Q) and inputs: QN = f (Q, inputs) [or Q * = f (Q, inputs)] Derived from basic function table for a given flip-flop type

Characteristic Equations Input Present state Next state D Q Q* 0 0 0 0 1 0 1 0 1 1 1 1 Q* = D Input Present state Q* = S + R Q Next state S R Q Q* 0 0 0 0 0 0 1 1 0 1 x 0 1 0 x 1 1 1 x x State Machine Analysis

Characteristic Equations J K Q Q* 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 0 Q* = J Q + K Q hold reset set toggle EN Q Q * 0 0 0 0 1 1 1 0 1 1 1 0 Q* = EN Q + EN Q

Characteristic Equations Summary Device Type Characteristic Eq. S-R latch Q* = S + R Q D latch Q* = D Edge-triggered D flip-flop Q* = D Master/slave S-R flip-flop Q* = S + R Q Master/slave J-K flip-flop Q* = J Q + K Q Edge-triggered J-K flip-flop Q* = J Q + K Q T flip-flop Q* = Q T flip-flop with enable Q* = EN Q + EN Q