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

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

Lecture 8: Sequential Logic

Logic Design. Flip Flops, Registers and Counters

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

LATCHES & FLIP-FLOP. Chapter 7

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

RS flip-flop using NOR gate

Sequential Logic and Clocked Circuits

Rangkaian Sekuensial. Flip-flop

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

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

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

Asynchronous (Ripple) Counters

CHAPTER 1 LATCHES & FLIP-FLOPS

Chapter 5 Flip-Flops and Related Devices

Figure 1 shows a simple implementation of a clock switch, using an AND-OR type multiplexer logic.

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

ELCT201: DIGITAL LOGIC DESIGN

Introduction to Microprocessor & Digital Logic

EKT 121/4 ELEKTRONIK DIGIT 1

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

Digital Fundamentals: A Systems Approach

Synchronous Sequential Logic

Experiment 8 Introduction to Latches and Flip-Flops and registers

Unit 11. Latches and Flip-Flops

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

MODULE 3. Combinational & Sequential logic

RS flip-flop using NOR gate

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

CPS311 Lecture: Sequential Circuits

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

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

Other Flip-Flops. Lecture 27 1

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

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

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

Sequential Circuits: Latches & Flip-Flops

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

D Latch (Transparent Latch)

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

5: Sequential Logic Latches & Flip-flops

Digital Fundamentals. Lab 5 Latches & Flip-Flops CETT Name: Date:

ELCT201: DIGITAL LOGIC DESIGN

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

BISHOP ANSTEY HIGH SCHOOL & TRINITY COLLEGE EAST SIXTH FORM CXC CAPE PHYSICS, UNIT 2 Ms. S. S. CALBIO NOTES lesson #39

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

Chapter 1: Switching Algebra Chapter 2: Logical Levels, Timing & Delays. Introduction to latches Chapter 9: Binary Arithmetic

Counter dan Register

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

The NOR latch is similar to the NAND latch

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Chapter 11 Latches and Flip-Flops

Logic. Andrew Mark Allen March 4, 2012

CSE 352 Laboratory Assignment 3

Digital Circuits 4: Sequential Circuits

Sequential Logic Circuits

Multiplexor (aka MUX) An example, yet VERY useful circuit!

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

DIGITAL CIRCUIT COMBINATORIAL LOGIC

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

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Counters

FLIP-FLOPS AND RELATED DEVICES

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

(Refer Slide Time: 2:05)

Logic Gates, Timers, Flip-Flops & Counters. Subhasish Chandra Assistant Professor Department of Physics Institute of Forensic Science, Nagpur

CHW 261: Logic Design

Review of Flip-Flop. Divya Aggarwal. Student, Department of Physics and Astro-Physics, University of Delhi, New Delhi. their state.

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

COMP2611: Computer Organization. Introduction to Digital Logic

Switching Circuits & Logic Design

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

ELE2120 Digital Circuits and Systems. Tutorial Note 7

ECE 341. Lecture # 2

INTRODUCTION TO SEQUENTIAL CIRCUITS

Chapter. Synchronous Sequential Circuits

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

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

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.

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits

Sequential Logic Basics

Introduction to Sequential Circuits

EET2411 DIGITAL ELECTRONICS

3 Flip-Flops. The latch is a logic block that has 2 stable states (0) or (1). The RS latch can be forced to hold a 1 when the Set line is asserted.

Engr354: Digital Logic Circuits

6. Sequential Logic Flip-Flops

UNIT IV. Sequential circuit

EKT 121/4 ELEKTRONIK DIGIT 1

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

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

Digital Fundamentals: A Systems Approach

Chapter 5: Synchronous Sequential Logic

COMP sequential logic 1 Jan. 25, 2016

Last time, we saw how latches can be used as memory in a circuit

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

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

Chapter 8 Sequential Circuits

Transcription:

Computer Science 324 Computer Architecture Mount Holyoke College Fall 2007 opic Notes: Sequential Circuits Let s think about how life can be bad for a circuit. Edge Detection Consider this one: What is the output here? Should be always 0, right? But think about what happens when the input was a 0 then it becomes a 1. When it s 0, the inverter is feeding a 1 and the direct input is feeding 0 to the AND. Switch the input to 1, and the 1 gets to the AND right away, it s just a wire, but it takes some time for the inverter to react to its new input (gate delay), so the AND is seeing 2 1 s for a brief time, and produces a 1. But soon after, the inverter does its thing and the AND gate gets a 0 from the inverter and things go back to the expected output of 0. If the input is switched 0 to 1 and back over time, here s what happens: in 1 0 out 1 0 he length of time that the output is 1 after the switch of the input from 0 to 1 depends on the gate delay of the inverter.

If we wanted it to stay 1 a little longer, we could do that by putting a few (odd number of) inverters in series. We have built a leading edge detector (LED). On a chip, a LED is denoted: in So this gate delay that seemed mostly like an annoyance when we were computing something with a circuit might actually be beneficial. However, if we are building a circuit and this kind of behavior comes up unintentionally, it can be seen as a glitch in our circuit. Why might we want this? If we want a one-time pulse out of a signal that is going to be high for a while. We ll see applications soon. How about trailing edge detection (ED)? Can we just invert the input to get one? his seems kind of weird. Do we really want to depend on this kind of thing? Clocks Now consider this circuit: 2

he electrons can go around the wire from the output back to the input very quickly something around half the speed of light, maybe more. However, the gate delay of the inverter will take some time. So what happens? A clock! An oscillating circuit that cycles back and forth between 0 and 1 at a fixed rate. How about this one? his has two possible states. 0 on the left, 1 on the right, or 1 on the left, 0 on the right. his is a bistable circuit. If we put a 1 on one side for a bit, that side gets 1, the other gets 0. If we ground one side for a bit, that side gets 0, the other gets 1. So after a short delay, it remembers the value put on. his is the simplest latch device. Add a third inverter? We get a clock with a period three times longer than the original, since there are three gate delays instead of one. his is a cheap, quick way to build a clock. S-R Latches and Flip-Flops We will build on the idea of the bistable circuit. First notice that a NOR gate can be set up as a controllable inverter : 3

If the control is 0, this behaves like an inverter. When control is 1, the output is always 0. With this, we can build an S-R Latch: At any given time, it has a stable value when S and R are 0. If R is presented a 1, it will make = 0, = 1 When R is returned to 0, it maintains that value. S is the mirror image, and setting S to 1, becomes 1 and becomes 0. When S is 0 again, the value remains. hey are so named because S is a set and R is a reset. here is no extra cost to getting both and out of the latch, which is convenient when this is feeding a circuit that may want an input and its inverse both available. We can save an inverter. It is also possible to build an S-R Latch from NAND gates (think about how). We can augment our S-R Latch to change input only when a clock signal is high (to make sure we only set or reset when we really mean to do so): 4

his is a Clocked S-R Latch. It changes value only when the clock is high. But we may want to be even more restrictive and have the S and R lines interpreted only on the rising edge of the clock (when it switches from 0 to 1). We do this by inserting a LED after the clock. his is a Clocked S-R Flip-Flop. In all of these S-R latches and flip-flops, what happens if we have both S and R high at the same time? Both and will be 0 when those inputs are being presented. When the inputs both go back to 0, a race condition will occur and the circuit will fall into one state or the other. D-ype Flip-Flops he race condition is not a desirable feature. An alternative: his is the Clocked D-type Flip-Flop. 5

We present the desired output onto D and it makes sure we feed in appropriate values to the S and R parts of our circuit. he symbol for the D-type Flip-Flop: D CLK hese are the main component of SRAM (typically used in L2 cache). Since one of D and D must be 1, every leading edge attempts to set the state of the circuit. his means that the input D must be present for every clock cycle. his is OK, as long as you only send a clock pulse when there is an appropriate value on D. J-K and -type Flip-Flops Consider this approach, which augments the S-R Latch: his is a J-K Latch. he feedback from and : 1. Allows input J to pass through to S if is low and the clock goes high, and 2. allows input K to pass through to R if is high and the clock goes high. So if is set, it allows a reset. If is set, it allows a set. So what happens if both J and K are set when the clock goes high? 6

oggle! So this makes more sense as a flip-flop, where the CLK input is being provided by a LED. he inputs J and K are sampled briefly on the leading edge of the clock. Otherwise, the J and K both 1 case will lead to continued toggling. Here s our symbol for the J-K Flip-Flop: J CLK K hat >CLK means an LED input named CLK. So suppose we connect it up like this: 1 1 J CLK K he input is so-named because it will toggle the outputs. his is a -type flip-flop. We could build these out of J-K flip-flops, or reduce the number of inputs to the AND gates. Counters Here s one way to use -type flip-flops: 7

phi0 phi1 phi2 phi3 he output is a 4-bit counter! Up/Down Counters What if we connect up output instead of to the subsequent clocks? phi0 phi1 phi2 phi3 Everything changes on the leading edge. So we have a countdown device! We can actually take our counter and make it a count up/down device by adding another input line called UP/DOWN. We pass along if we have a 1 on this line, pass along if we have a 0. Insert a 2-way MUX: (( AND UP/DOWN) OR ( AND UP/DOWN)) UP/DOWN A D1 D0 MUX A D1 D0 MUX A D1 D0 MUX phi0 phi1 phi2 phi3 8

Synchronous Counters But let s look carefully at the timing of this. CLK Phi0 Phi1 Phi2 here is really a short gate delay period before each output digit updates in response to a rising edge. his could be very bad if we re waiting for a particular value (maybe 0) to come up, and we see it too soon. his skew grows as the number of bits in the counter grows. So this is called an asynchronous counter. o fix this, we can feed our output of the aynchronous counter into a register (a bunch of D flipflops): CLK asynch counter D D D D (register) 9

he values can come out of the top counter asynchronously, but we don t put them into our register until the clock goes back down. he asynchronous counter is triggered on the leading edge, while the register is triggered on the trailing edge. his whole thing is a synchronous counter. Something to think about: we can easily count up to powers of 2, but what if we want to count in base 10? 10