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

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

LATCHES & FLIP-FLOP. Chapter 7

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

RS flip-flop using NOR gate

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

Sequential Logic and Clocked Circuits

Rangkaian Sekuensial. Flip-flop

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and 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.

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

Other Flip-Flops. Lecture 27 1

ELCT201: DIGITAL LOGIC DESIGN

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

Introduction to Microprocessor & Digital Logic

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.

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

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

Sequential Circuits: Latches & Flip-Flops

CPS311 Lecture: Sequential Circuits

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

Synchronous Sequential Logic

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

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)

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

ELCT201: DIGITAL LOGIC DESIGN

COMP2611: Computer Organization. Introduction to Digital Logic

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

MODULE 3. Combinational & Sequential logic

RS flip-flop using NOR gate

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

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

CSE 352 Laboratory Assignment 3

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

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

D Latch (Transparent Latch)

5: Sequential Logic Latches & Flip-flops

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

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

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

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

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

FLIP-FLOPS AND RELATED DEVICES

Counter dan Register

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

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

The NOR latch is similar to the NAND latch

ECE 341. Lecture # 2

Chapter 11 Latches and Flip-Flops

Digital Circuits 4: Sequential Circuits

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

Sequential Logic Circuits

Logic. Andrew Mark Allen March 4, 2012

ELE2120 Digital Circuits and Systems. Tutorial Note 7

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

INTRODUCTION TO SEQUENTIAL CIRCUITS

DIGITAL CIRCUIT COMBINATORIAL LOGIC

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

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

Introduction to Sequential Circuits

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Counters

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.

(Refer Slide Time: 2:05)

CHW 261: Logic Design

Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits

Registers and Counters

6. Sequential Logic Flip-Flops

PHYSICS 5620 LAB 9 Basic Digital Circuits and Flip-Flops

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

Switching Circuits & Logic Design

Chapter 5: Synchronous Sequential Logic

Slide 1. Flip-Flops. Cross-NOR SR flip-flop S R Q Q. hold reset set not used. Cross-NAND SR flip-flop S R Q Q. not used reset set hold 1 Q.

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Chapter. Synchronous Sequential Circuits

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.

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

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

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

Module -5 Sequential Logic Design

SEQUENTIAL CIRCUITS THE RELAY CIRCUIT

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Sequential Logic Basics

EET2411 DIGITAL ELECTRONICS

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

CHAPTER 4: Logic Circuits

Engr354: Digital Logic Circuits

Digital Circuits ECS 371

Module for Lab #16: Basic Memory Devices

Transcription:

Computer Science 324 Computer Architecture Mount Holyoke College Fall 2009 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? It should be always 0, right? But think about what happens when the input changes from 0 to 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, an 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. We can hook this up in Logisim: /home/jteresco/shared/cs324/examples/logisim/simpleclock.circ 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. More on this in a minute. 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. 3

/home/jteresco/shared/cs324/examples/logisim/slowerclock.circ his is a cheap, quick way to build a clock. Latches and Flip-Flops S-R Latches and Flip-Flops We will build on the idea of the bistable circuit to construct circuits that can remember values. First notice that a NOR gate can be set up as a controllable inverter : 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: /home/jteresco/shared/cs324/examples/logisim/srlatch.circ 4

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 you ll do it in lab). 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): /home/jteresco/shared/cs324/examples/logisim/clockedsrlatch.circ 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 (the brief moment when it switches from 0 to 1). We do this by inserting a leading edge detector after the clock. 5

his is a Clocked S-R Flip-Flop. It is a provided building block in Logisim. 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: /home/jteresco/shared/cs324/examples/logisim/dtypeflipflop.circ his is the Clocked D-type Flip-Flop. 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: 6

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 Flip-Flops Consider this approach, which augments the S-R Latch: /home/jteresco/shared/cs324/examples/logisim/jklatch.circ 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? 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. 7

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 leading edge-detected input named CLK. We have a very flexible device that allows 4 possibilities when the CLK input goes high: 1. J = 0, K = 0: remains unchanged 2. J = 1, K = 0: set to 1 3. J = 0, K = 1: set to 0 4. J = 1, K = 1: toggle -type Flip-Flops 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. 8

Counters Here s one way to use -type flip-flops: 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)) 9

UP/DOWN A D1 D0 MUX A D1 D0 MUX A D1 D0 MUX phi0 phi1 phi2 phi3 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): 10

CLK asynch counter D D D D (register) 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? 11