Lesson 12 Sequential Circuits: Flip-Flops



Similar documents
SEQUENTIAL CIRCUITS. Block diagram. Flip Flop. S-R Flip Flop. Block Diagram. Circuit Diagram

Engr354: Digital Logic Circuits

ECE380 Digital Logic

So far we have investigated combinational logic for which the output of the logic devices/circuits depends only on the present state of the inputs.

To design digital counter circuits using JK-Flip-Flop. To implement counter using 74LS193 IC.

Chapter 9 Latches, Flip-Flops, and Timers

CHAPTER 11 LATCHES AND FLIP-FLOPS

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Latches, the D Flip-Flop & Counter Design. ECE 152A Winter 2012

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Sequential Logic Design Principles.Latches and Flip-Flops

Asynchronous Counters. Asynchronous Counters

Chapter 5. Sequential Logic

Flip-Flops and Sequential Circuit Design. ECE 152A Winter 2012

Flip-Flops and Sequential Circuit Design

Memory Elements. Combinational logic cannot remember

Master/Slave Flip Flops

Lecture 8: Synchronous Digital Systems

DIGITAL COUNTERS. Q B Q A = 00 initially. Q B Q A = 01 after the first clock pulse.

BINARY CODED DECIMAL: B.C.D.

7. Latches and Flip-Flops

CSE140: Components and Design Techniques for Digital Systems

WEEK 8.1 Registers and Counters. ECE124 Digital Circuits and Systems Page 1

Module 3: Floyd, Digital Fundamental

Combinational Logic Design Process

CHAPTER 11: Flip Flops

Digital Logic Design Sequential circuits

EE 42/100 Lecture 24: Latches and Flip Flops. Rev B 4/21/2010 (2:04 PM) Prof. Ali M. Niknejad

Lecture-3 MEMORY: Development of Memory:

Flip-Flops, Registers, Counters, and a Simple Processor

CS311 Lecture: Sequential Circuits

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

Chapter 8. Sequential Circuits for Registers and Counters

Counters and Decoders

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

Theory of Logic Circuits. Laboratory manual. Exercise 3

Digital Fundamentals

Counters & Shift Registers Chapter 8 of R.P Jain

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Sequential Logic: Clocks, Registers, etc.

Digital Logic Design. Basics Combinational Circuits Sequential Circuits. Pu-Jen Cheng

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

ENEE 244 (01**). Spring Homework 5. Due back in class on Friday, April 28.

DIGITAL ELECTRONICS. Counters. By: Electrical Engineering Department

Fig1-1 2-bit asynchronous counter

Upon completion of unit 1.1, students will be able to

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

DEPARTMENT OF INFORMATION TECHNLOGY

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

Wiki Lab Book. This week is practice for wiki usage during the project.

PURDUE UNIVERSITY NORTH CENTRAL

DM74LS112A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flop with Preset, Clear, and Complementary Outputs

Digital Controller for Pedestrian Crossing and Traffic Lights

Contents COUNTER. Unit III- Counters

Set-Reset (SR) Latch

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

Asynchronous counters, except for the first block, work independently from a system clock.

Modeling Latches and Flip-flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

CHAPTER 3 Boolean Algebra and Digital Logic

Counters. Present State Next State A B A B

Layout of Multiple Cells

Design Example: Counters. Design Example: Counters. 3-Bit Binary Counter. 3-Bit Binary Counter. Other useful counters:

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

A Lesson on Digital Clocks, One Shots and Counters

Counters are sequential circuits which "count" through a specific state sequence.

Decimal Number (base 10) Binary Number (base 2)

Design: a mod-8 Counter

LAB #4 Sequential Logic, Latches, Flip-Flops, Shift Registers, and Counters

Digital Electronics Detailed Outline

DM7474 Dual Positive-Edge-Triggered D-Type Flip-Flops with Preset, Clear and Complementary Outputs

ASYNCHRONOUS COUNTERS

CHAPTER IX REGISTER BLOCKS COUNTERS, SHIFT, AND ROTATE REGISTERS

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute. 2nd (Spring) term 2012/2013

Sequential Circuit Design

A Lesson on Digital Clocks, One Shots and Counters

Introduction to CMOS VLSI Design (E158) Lecture 8: Clocking of VLSI Systems

EE552. Advanced Logic Design and Switching Theory. Metastability. Ashirwad Bahukhandi. (Ashirwad Bahukhandi)

SN54/74LS192 SN54/74LS193

DM74LS169A Synchronous 4-Bit Up/Down Binary Counter

Latch Timing Parameters. Flip-flop Timing Parameters. Typical Clock System. Clocking Overhead

The components. E3: Digital electronics. Goals:

EXPERIMENT 8. Flip-Flops and Sequential Circuits

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute 5. LECTURE: REGISTERS AND RELATED

Lecture 7: Clocking of VLSI Systems

PROGETTO DI SISTEMI ELETTRONICI DIGITALI. Digital Systems Design. Digital Circuits Advanced Topics

Lecture 10 Sequential Circuit Design Zhuo Feng. Z. Feng MTU EE4800 CMOS Digital IC Design & Analysis 2010

ECE124 Digital Circuits and Systems Page 1

Digital Logic Elements, Clock, and Memory Elements

Chapter 7. Registers & Register Transfers. J.J. Shann. J. J. Shann

Registers & Counters

Timing Methodologies (cont d) Registers. Typical timing specifications. Synchronous System Model. Short Paths. System Clock Frequency

Topics of Chapter 5 Sequential Machines. Memory elements. Memory element terminology. Clock terminology

Digital Electronics Part I Combinational and Sequential Logic. Dr. I. J. Wassell

NOTE: The Flatpak version has the same pinouts (Connection Diagram) as the Dual In-Line Package.

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

A New Paradigm for Synchronous State Machine Design in Verilog

Transcription:

Lesson 12 Sequential Circuits: Flip-Flops 1. Overview of a Synchronous Sequential Circuit We saw from last lesson that the level sensitive latches could cause instability in a sequential system. This instability can be reduced by adding a control/enable signal throughout the system, with each latch only permitted to switch states when enabled. This single enable signal, which periodically activates, thereby enabling all of the devices at the same instant, ensuring that all state shifts are synchronized, is called a clock signal. A system of sequential elements that all change their states at the same time is termed synchronous systems. A general block diagram of a synchronous sequential system is shown below. In a synchronous system, all memory elements (flip flops) can change state only once per periodic clock signal, and no elements can alter their states between clock signals. Clock signals, such as those shown below, are periodic signals characterized by two values. The period, T, which is the length of one cycle. The frequency of the clock is defined as 1. T The duty cycle, which is the percentage of the period that the clock signal is active (i.e., 1 for active high, 0 for active low). 1

The two signals above have the same period but different duty cycles. Do you think that we want clocks to have a high frequency or a low frequency (or it doesn t matter)? High frequency! All computer operations are based on state changes. State changes only occur once per clock cycle. The more clock cycles per second, the more state changes per second, and the more a computer can do per second. As we saw from the previous lesson, the SR latch with an enable signal will respond to the input signals when the enable single is active (level sensitive). The problem with this while the enable signal is active, the latch will respond to new input values and a new output may occur. This leads to unpredictable situation since the state of the latches may keep changing due to the different propagation delay of the input signals. The key to proper operation in a sequential system is that all the elements should change state at the same time during the clock signal transition. These transitions are known as clock edges. Example of the level response, positive edge (or rising edge = 0 to 1 transition) response, and negative edge (or falling edge = 1 to 0 transition) response are shown below. Memory elements that operate based on clock signal transitions are call edged-triggered flip-flops. In this lesson, we will look at three types of flip flops: D flip-flop JK flip-flop T flip-flop 2. D Flip Flop 2

As mentioned in the previous lesson, the SR latches are rarely used in practical applications but they are the building blocks for flip-flops. The construction of a D flip-flop based on two D latches is shown below. When the clock is 1, the output Y of the master latch is set to the correct value (based on the input value of D), and this value is then passed to the output via the second latch, the slave, when the clock goes from 1 to 0. This is termed a negative-edge triggered D flip-flop since the output of the device changes when the clock goes from 1 to 0. Note that the change in the output of the flip-flop can only be triggered by and during the transition of the clock (e.g. negative/falling edge in the above block diagram). For example, once the clock has transitioned to the negative level, the master latch is disabled; hence the output Y of the master latch will remain stable regardless of the input D. Therefore, the output of the flip-flop will also remain stable. Notes: There is a minimum time called the setup time during which the input D must stay constant right before the clock edge. There is also a minimum time called the hold time during which the input D must stay constant right after the clock edge. There is a propagation delay associated with a flip-flop which is defined as the time interval between the active clock edge and the stabilization of the output. All of these parameters are specified in the device datasheet produced by the manufacturers. For timing analysis in this class, we will only consider the propagation delay. Symbol The logic symbols for positive-edge and negative-edge triggered D flip-flop are shown below. 3

Characteristic Table Characteristic tables are used to define the operations of the flip-flops. For a D flip-flop, we consider the input D at time t = 0 and the output will be after the circuit delay (next state). We will denote the next state as (t+1). Write the state table for the D flip-flop: So, in summary, what does the D flip flop do? The input at D shows up as the output at the next active clock transition. Put another way The next state of the D flip flop is equal to the value of D before the clock transition. Characteristic Equation The function of a D flip-flop can also be described as (t+1) = D which states that next state of the output will be equal to the value of the input D after the clock transition. Timing Diagram Another way to illustrate the behavior of the D flip flop is to use a timing diagram. The important point: evaluate the output of the each flip-flop based on the current input right before the active clock edge (e.g. negative/falling edge). 4

Example. Sketch the output of a negative-edge triggered D flip flop whose inputs are shown below. Example. Sketch the output of a positive-edge triggered D flip flop whose inputs are shown below. Example. Consider the circuit below. Sketch the behavior of the intermediate signal q and the value of the output r for the input signal D shown below. R 5

Preset and Clear Signals Sometimes, a flip-flop has direct inputs that bring the flip-flop to a known starting state at initialization. These direct inputs are force the output of the flip-flop to a known state independent of the clock signal. These direct inputs are called Clear () and Preset (PRE) signals. A symbol of a D flip flop with active-low and PRE inputs is shown below. D PRE CLK These two new inputs work as follows: The and PRE inputs affect the flip flop immediately, overriding the clock input. When the signal is active (i.e., = 0), the output of the flip flop is forced to 0 immediately When the PRE input is active (PRE = 0), the output of the flip flop is forced to 1 immediately. When would the D flip flop operate as described before? When = 1 and PRE = 1. Can you see a situation that is not permitted? = 0 and PRE = 0 (both can NOT be active at the same time). Example. Sketch the output of a negative-edge triggered D flip flop whose inputs are shown below. PRE 6

3. JK Flip Flop Another type of flip-flop is JK flip-flop which is built based on a D flip-flop. The circuit diagram and symbol of a JK flip-flop is shown below. A symbol of a JK flip flop with active-low and PRE inputs is shown below. Characteristic Table J K PRE CLK Let s explore the operation of this flip flop by building the state table. Suppose is 0 (and is 1), J is 0, and K is 0. What will be the next state (t+1)? Suppose is 1 (and is 0), J is 0, and K is 0. What will be the next state (t+1)? D is 0. So, (t+1)=0 D is 1. So, (t+1)=1. Bottom line: When J and K are both 0, the J-K flip flop Suppose is 0 (and is 1), J is 0, and K is 1. What will be the next state (t+1)? holds its current output. D is 0. So, (t+1)=0. 7

Suppose is 1 (and is 0), J is 0, and K is 1. What will be the next state (t+1)? D is 0. So, (t+1) = 0. Bottom line: When J = 0 and K = 1, the J-K flip flop resets to (t+1)=0. Suppose is 0 (and is 1), J is 1, and K is 0. What will be the next state (t+1)? D is 1. So, (t+1) = 1. Suppose is 1 (and is 0), J is 1, and K is 0. What will be the next state (t+1)? D is 1. So, (t+1) = 1 Bottom line: When J = 1 and K = 0, the J-K flip flop sets to (t+1) = 1. Suppose is 0 (and is 1), J is 1, and K is 1. What will be the next state (t+1)? D is 1. So, (t+1) = 1. Suppose is 1 (and is 0), J is 1, and K is 1. What will be the next state (t+1)? D is 0. So, (t+1) = 0. Bottom line: When J = 1 and K = 1, the J-K flip flop Toggles! It will complement its output! The characteristic table for the J-K flip flop is presented below Characteristic Equation The characteristic equation for a JK flip-flop is determined based on the current state of the flip-flop and inputs J and K. The characteristic table for the a JK flip-flop can be rewritten as 8

J K (t+1) We can then derive the characteristic equation of a JK flip-flop using a 3-variable K-map. JK 00 01 11 10 0 1 (t+1) = J + K Timing Diagram The behavior of a JK flip-flop can be illustrated with a timing diagram. Example: Show the output of the J-K flip flop whose input is shown below (assume negative-edge triggered with active-low signal). 9

Example: How would the example above change if we also had an active-low preset signal shown below. PRE 4. T Flip Flop The last type of flip-flop is the T(toggle) flip-flop which is a complementing flip-flop. The T flip-flop can be obtained from a JK flip-flop (J and K inputs tied together) or a D flip-flop (with a XOR gate) as shown below. A symbol of a JK flip flop with active-low and PRE inputs is shown below. T PRE CLK 10

Characteristic Table Explain the operation of this flip flop. When T = 0, the flip flop holds its state. When T = 1, the flip flop toggles The characteristic table for the J-K flip flop is presented below. Characteristic Equation The characteristic equation for a T flip-flop is determined based on the current state of the flip-flop and input T. The characteristic equation for a T flip-flop is (t+1) = T (t) Timing Diagram The behavior of a T flip-flop can be illustrated with a timing diagram. Example: Show the output of the T flip flop whose input is shown below (assume negative-edge triggered with active-low signal). 11