Logic Design. Flip Flops, Registers and Counters

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

CHAPTER 4: Logic Circuits

Unit 11. Latches and Flip-Flops

CHAPTER 4: Logic Circuits

ELCT201: DIGITAL LOGIC DESIGN

Experiment 8 Introduction to Latches and Flip-Flops and registers

D Latch (Transparent Latch)

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

MC9211 Computer Organization

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

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.

Engr354: Digital Logic Circuits

ECE 341. Lecture # 2

Counters

ELCT201: DIGITAL LOGIC DESIGN

RS flip-flop using NOR gate

ELE2120 Digital Circuits and Systems. Tutorial Note 7

Flip-Flops and Sequential Circuit Design

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

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

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

LATCHES & FLIP-FLOP. Chapter 7

CHAPTER1: Digital Logic Circuits

Sequential Circuits: Latches & Flip-Flops

Counter dan Register

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

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

Registers and Counters

Vignana Bharathi Institute of Technology UNIT 4 DLD

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

Synchronous Sequential Logic

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

Asynchronous (Ripple) Counters

UNIT IV. Sequential circuit

MODULE 3. Combinational & Sequential logic

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

6. Sequential Logic Flip-Flops

Chapter 3 Unit Combinational

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

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).

Introduction to Sequential Circuits

RS flip-flop using NOR gate

Chapter 5 Synchronous Sequential Logic

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

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

ELE2120 Digital Circuits and Systems. Tutorial Note 8

Chapter 4. Logic Design

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

Flip-Flops and Related Devices. Wen-Hung Liao, Ph.D. 4/11/2001

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

CHAPTER 1 LATCHES & FLIP-FLOPS

Digital Fundamentals: A Systems Approach

Chapter 5: Synchronous Sequential Logic

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

Module -5 Sequential Logic Design

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

Registers and Counters

More on Flip-Flops Digital Design and Computer Architecture: ARM Edition 2015 Chapter 3 <98> 98

Serial In/Serial Left/Serial Out Operation

Lecture 8: Sequential Logic

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

Chapter. Synchronous Sequential Circuits

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

INTRODUCTION TO SEQUENTIAL CIRCUITS

Other Flip-Flops. Lecture 27 1

CPS311 Lecture: Sequential Circuits

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

CHAPTER 11 LATCHES AND FLIP-FLOPS

Sequential circuits. Same input can produce different output. Logic circuit. William Sandqvist

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) COUNTERS

CMSC 313 Preview Slides

Universal Asynchronous Receiver- Transmitter (UART)

Sequential Digital Design. Laboratory Manual. Experiment #3. Flip Flop Storage Elements

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

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

EET2411 DIGITAL ELECTRONICS

Digital Logic Design ENEE x. Lecture 19

Chapter 6 Registers and Counters

Digital Circuits ECS 371

Sequential Logic and Clocked Circuits

Chapter 11 Latches and Flip-Flops

Chapter 7 Counters and Registers

Sequential Logic Circuits

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

Rangkaian Sekuensial. Flip-flop

CprE 281: Digital Logic

Latches, Flip-Flops, and Registers. Dr. Ouiem Bchir

Lecture 12. Amirali Baniasadi

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

UNIVERSITI TEKNOLOGI MALAYSIA

Chapter 2. Digital Circuits

Chapter 8 Sequential Circuits

Introduction to Microprocessor & Digital Logic

Switching Circuits & Logic Design

Chapter 5 Flip-Flops and Related Devices

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

CprE 281: Digital Logic

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

LSN 12 Shift Registers

Transcription:

Logic Design Flip Flops, Registers and Counters

Introduction Combinational circuits: value of each output depends only on the values of inputs Sequential Circuits: values of outputs depend on inputs and past behavior of the circuit Circuit contains storage (memory) elements

Example: an alarm system in which the alarm stays on when triggered even if the sensor output goes to zero Sensor Reset Set Memory element On Off Alarm

Basic Latch Simplest memory element: basic latch Can be built with NAND or NOR gates Reset Set Q

(c) Timing diagram Basic Latch R Q a S R Q a Q b 0 0 0/1 1/0 (no change) 0 1 0 1 1 0 1 0 S Q b 1 1 0 0 (a) Circuit (b) Truth table t 1 t 2 t 3 t 4 t 5 t 6 t 7 t 8 t 9 t 10 R S Q a Q b 1 0 1 0 1 0 1 0?? Time

Basic Latch In basic latch, the state changes when the inputs change In many circuits we cannot control when the inputs change but would like the change in state happens at particular times We add a clock (clk) signal to the basic latch

Gated SR Latch

Gated Latch with NAND Behavior of the circuit is the same as the one with NOR Clock is gated by NAND gates rather than AND gates S and R inputs are reversed S Q Clk R Q

D latch D latch is based on gated SR latch Instead of two inputs, has one input

D Latch

D Latch Since the output of gated D latch is controlled by the level of clock, it is called level sensitive In the window of clk=1, the output Q tracks the changes of input D. This is undesirable. It is possible to design storage elements for which the output changes only when clock changes from one value to the other. Those circuits are called edge triggered

Propagation delay D latch: stores the value of D input at the time clock goes from 1 to 0. It operates properly if input is stable (not changing) at the time clk goes from 1 to 0. t su t h Clk D Q

Master-slave D flip-flop Master-slave D flip-flop: two gated D latches First one, called master, changes its state when clk=1 Second one, called slave, changes its state when clk=0 From external point of view, master-slave flip-flop changes its state at the negative edge of clock

Master-slave D flip-flop D Master D Q Q m D Slave Q Q s Q Clock Clk Q Clk Q Q (a) Circuit Clock D Q m Q = Q s (b) Timing diagram D Q Q (c) Graphical symbol

Edge-triggered D flip-flop

D flip-flop with clear and preset An example of application of flip-flops: counters We should be able to clear the counter to zero We should be able to force the counter to a known initial count Clear: asynchronous, synchronous Asynchronous clear: flip-flops are cleared without regard to clock signal Synchronous clear: flip-flops are clear with the clock signal

Edge triggered D flip flop with clear & preset

T Flip-Flop

D=JQ +K Q JK flip flop When J=S and K=R it will behave like a SR flip-flop

Summary Basic latch- a feedback connection of two NOR or NAND gates to store 1-bit information. S»1; R»0. Gated latch- a basic latch with a control (clk). clk =0: the existing state maintains; clk=1: the existing state may change Gated SR latch. S»1; R»0. Gated D latch. The D input forces the state to be the same as D Flip-flop- a storage element. Its output state changes only on the edge of clk. Edge-triggered flip-flop Master-slave flip-flop. The master is active in 1 st half of a clock cycle; The slave active in 2 nd half. Regardless how many times the D input to the master changes, the slave output can only change at the negative edge of clk.

Registers Register: a set of n flip-flops used to store n bits of information A common clock is used for all the flip-flops A register that provides the ability to shift its contents is called a shift register To implement a shift register, it is necessary to use edgetriggered or master-slave flip-flops

Shift register

In computer systems it is often necessary to transfer n-bit data Using n separate wires: parallel transmission Using a single wire and performing the transfer one bit at a time in n consecutive cycles: serial transmission

Parallel access shift register

Counters Counter: a circuit that can increment or decrement a count by 1 Applications: generating time intervals, count the number of occurrence of an event,. Counters can be build using T and D flip-flops

Up counter with T flip-flop

Up counter with T flip-flop Clock Q 0 Q 1 Q 2 Count 0 1 2 3 4 5 6 7 0

The counter has three flip flops Only the first one is directly connected to the clock The other two respond after a delay For this reason it is called an asynchronous counter

Down counter with T flip-flops

Synchronous counters Problem with asynchronous counters: long delays for large number of bits Solution: clock all the flip-flops at the same time (synchronous counter) Clock cycle 0 1 2 3 4 5 6 7 0 0 0 0 1 1 1 1 8 0 Q 2 Q 1 Q 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 1 0 0 Q 1 changes Q 2 changes

Q0 changes on each clock cycle Q1 changes only when Q0=1 Q2 changes only when Q1=1 and Q0=1 T 0 =1; T 1 =Q 0 T 2 =Q 0 Q 1 T 3 =Q 0 Q 1 Q 2

Enable and clear capability

Synchronous counter with D flip flop Formal method: chapter 8 D 0 Q 0 Enable D 1 Q 1 Q 0.Enable D 2 Q 2 Q 1.Q 0.Enable D 3 Q 3 Q 2.Q 1.Q 0.Enable

Synchronous Counter with D Flip Flop

Counter with parallel load Sometimes it is desirable to start the counter with an initial value

Counter with parallel load

Reset Synchronization How can we design a counter that counts modulo some base that is not a power of 2 (e.g., modulo-6 counter counting 0, 1, 2, 3, 4, 5, 0, 1,.) Detect 5 and then load zero into the counter

BCD counter In a BCD counter, the counter should be reset after the count of 9 has been obtained

BCD Counter

Ring Counter In all the previous counters the count is indicated by the state of the flip-flops in the counter It is possible to design a counter in which each flip-flop reaches the state of Qi=0 for exactly one count while for other counts Qi=0 This is called a ring counter and it can be built from a shift register

Ring Counter

Johnson Counter If instead of Q output we take the Q output of the last stage in a ring counter and feed it back to the first stage we get a Johnson counter. It counts to a sequence of length 2n For example for 4-bit the sequence would be: 0000, 0001, 1100, 1110, 1111, 0111, 0011, 0001, 0000.

Johnson counter