Computer Architecture CS 215

Slides:



Advertisements
Similar presentations
EE 5900 Advanced Algorithms for Robust VLSI CAD, Spring 2009 Sequential Circuits.
Advertisements

COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
1 Fundamentals of Computer Science Sequential Circuits.
Classification of Digital Circuits  Combinational. Output depends only on current input values.  Sequential. Output depends on current input values and.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 12 Basic (NAND) S – R Latch “Cross-Coupling” two NAND gates gives the S -R Latch:
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
SYEN 3330 Digital SystemsJung H. Kim 1 SYEN 3330 Digital Systems Chapter 6 – Part 1.
Module 12.  In Module 9, 10, 11, you have been introduced to examples of combinational logic circuits whereby the outputs are entirely dependent on the.
Overview Part 1 - Storage Elements and Analysis
Overview Part 1 - Storage Elements and Analysis
1 CS 151: Digital Design Chapter 5: Sequential Circuits 5-3: Flip-Flops I.
Sequential Circuits : Part I Read Sections 5-1, 5-2, 5-3.
CPEN Digital System Design Chapter 5 Sequential Circuits Storage Elements and Sequential Circuit Analysis C. Gerousis © Logic and Computer Design.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Logic and Computer.
Circuits require memory to store intermediate data
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 1 – Storage.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
Sequential Circuit Analysis & Design Dr. Aiman H. El-Maleh Computer Engineering Department King Fahd University of Petroleum & Minerals Dr. Aiman H. El-Maleh.
1. 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates whose outputs are determined from the current combination of inputs.
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 1 – Storage.
Sequential Circuits. 2 Sequential vs. Combinational Combinational Logic:  Output depends only on current input −TV channel selector (0-9) Sequential.
A clocked synchronous state-machine changes state only when a triggering edge or “tick” occurs on the clock signal. ReturnNext  “State-machine”: is a.
Overview Part 1 - Storage Elements and Sequential Circuit Analysis
So far, all of the logic circuits we have studied were basically based on the analysis and design of combinational digital circuits. The other major aspect.
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 17 Design a clock synchronous sequential circuit with two inputs A, B and a single.
Digital Computer Design Fundamental
Latches, Flip-Flops BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
COE 202: Digital Logic Design Sequential Circuits Part 1
Overview Part 1 Part 2 Sequential Circuit Design
Chapter 5 - Part Sequential Circuit Design Design Procedure  Specification  Formulation - Obtain a state diagram or state table  State Assignment.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
Charles Kime & Thomas Kaminski © 2008 Pearson Education, Inc. (Hyperlinks are active in View Show mode) Chapter 5 – Sequential Circuits Part 2 – Sequential.
Synchronous Sequential Logic Chapter 5. Digital Circuits Sequential Circuits Combinational circuits contains no memory elements the outputs depends.
Chap 4. Sequential Circuits
ENG241 Digital Design Week #6 Sequential Circuits (Part A)
CS 151: Digital Design Chapter 5: Sequential Circuits 5-3: Flip-Flops II.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 11 Binary Adder/Subtractor.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Chapter 10 Flip-Flops and Registers 1. Objectives You should be able to: Explain the internal circuit operation of S-R and gated S-R flip-flops. Explain.
Other Flip-Flop Types: J-K and T flip-flops (Section 5-6)
1 Lecture #11 EGR 277 – Digital Logic Ch. 5 - Synchronous Sequential Logic There are two primary classifications of logic circuits: 1.Combinational logic.
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2007.
EKT 221 / 4 DIGITAL ELECTRONICS II
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
Synchronous Sequential Logic Part I
5 Chapter Synchronous Sequential Circuits 1. Logic Circuits- Review 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates.
Chapter5: Synchronous Sequential Logic – Part 1
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
1. 2 Logic Circuits Sequential Circuits Combinational Circuits Consists of logic gates whose outputs are determined from the current combination of inputs.
4.
FIGURE 5.1 Block diagram of sequential circuit
Digital Design Lecture 9
Synchronous Sequential Circuits
EKT 121 / 4 DIGITAL ELECTRONICS I
Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and so on require.
Sequential logic circuits
Synchronous Sequential Circuits
Reference: Chapter 5 Sequential Circuits Moris Mano 4th Ediditon
Chapter 5 – Sequential Circuits
Sequential Circuit Analysis & Design
Synchronous sequential
Synchronous Sequential
Binary Adder/Subtractor
Chapter 5 Sequential Circuits.
Presentation transcript:

Computer Architecture CS 215 Latches & Flip-flops Computer Architecture CS 215

Sequential Circuits Storage elements Combinatorial Logic Inputs Combinational Logic Storage Elements Inputs Outputs State Next Storage elements Latches or Flip-Flops Combinatorial Logic

Sequential Circuits Inputs Outputs Combinational Logic Storage Elements Inputs Outputs State Next Combinatorial Logic Next state function Next State = f(Inputs, State) Output function (Mealy) Outputs = g(Inputs, State) Output function (Moore) Outputs = h(State) Output function type depends on specification and affects the design significantly

Sequential Circuits Synchronous Asynchronous Behavior defined from knowledge of its signals at discrete instances of time Storage elements observe inputs and can change state only in relation to a timing signal (clock pulses from a clock) Asynchronous Behavior defined from knowledge of inputs an any instant of time and the order in continuous time in which inputs change If clock just regarded as another input, all circuits are asynchronous! Nevertheless, the synchronous abstraction makes complex designs tractable!

Discrete Event Simulation Rules: Gates modeled by an ideal (instantaneous) function and a fixed gate delay Any change in input values is evaluated to see if it causes a change in output value Changes in output values are scheduled for the fixed gate delay after the input change At the time for a scheduled output change, the output value is changed along with any inputs it drives

Simulated NAND Gate  t (ns) A B F(I) F Comment – 1 Example: A 2-Input NAND gate with a 0.5 ns. delay Assume A and B have been 1 for a long time At time t=0, A changes back to 1. to a 0 at t= 0.8 ns, F A B DELAY 0.5 ns. F(Instantaneous) t (ns) A B F(I) F Comment –  1 A=B=1 for a long time Þ Ü F(I) changes to 1 0.5 F changes to 1 after a 0.5 ns delay 0.8 F(Instantaneous) changes to 0 0.13 F changes to 0 after a 0.5 ns delay

Basic (NAND) S–R Latch S (set) “Cross-Coupling” two NAND gates gives the S-R Latch S = 0, R = 0 is forbidden as input pattern Q Q R (reset) Time R S Q Comment 1 ? Stored state unknown “Set” Q to 1 Now Q “remembers” 1 “Reset” Q to 0 1 1 1 Now Q “remembers” 0 1 1 Both go high 1 1 ? ? Unstable!

Basic (NOR) S–R Latch S (set) R (reset) Q Cross-coupling two NOR gates gives the S – R Latch R S Q Comment ? Stored state unknown 1 “Set” Q to 1 Now Q “remembers” 1 “Reset” Q to 0 Now Q “remembers” 0 Both go low Unstable! Time

Clocked S-R Latch Adding two NAND gates to the basic S-R NAND latch gives the clocked S–R latch: Has a time sequence behavior similar to the basic S-R latch except that the S and R inputs are only observed when the line C is high. C means “control” or “clock”. S R Q C

Clocked S-R Latch The Clocked S-R Latch can be described by a table The table describes what happens after the clock [at time (t+1)] based on: current inputs (S,R) and current state Q(t). S R Q C

D Latch Adding an inverter to the S-R Latch, gives the D Latch: Q C Adding an inverter to the S-R Latch, gives the D Latch: Note that there are no “indeterminate” states! Q D Q(t+1) Comment No change 1 Set Q Clear Q No Change C D Q

Flip-Flops Master-slave flip-flop Edge-triggered flip-flop Standard symbols for storage elements

S-R Master-Slave Flip-Flop C S R Q Two clocked S-R latches in series with the clock on the second latch inverted The input is observed by the first latch with C = 1 The output is changed by the second latch with C = 0 The path from input to output is broken by the difference in clocking values (C = 1 and C = 0). The behavior demonstrated by the example with D driven by Y given previously is prevented since the clock must change from 1 to 0 before a change in Y based on D can occur.

Edge-Triggered D Flip-Flop C S R Q D The edge-triggered D flip-flop is the same as the master- slave D flip-flop It can be formed by: Replacing the first clocked S-R latch with a clocked D latch or Adding a D input and inverter to a master-slave S-R flip-flop The delay of the S-R master-slave flip-flop can be avoided since the 1s-catching behavior is not present with D replacing S and R inputs The change of the D flip-flop output is associated with the negative edge at the end of the pulse It is called a negative-edge triggered flip-flop

Positive-Edge Triggered D Flip-Flop Formed by adding inverter to clock input Q changes to the value on D applied at the positive clock edge within timing constraints to be specified Our choice as the standard flip-flop for most sequential circuits C S R Q D

Standard Symbols for Storage Elements Master-Slave: Postponed output indicators Edge-Triggered: Dynamic indicator (a) Latches S R SR D with 0 Control D C D with 1 Control (b) Master-Slave Flip-Flops Triggered D Triggered SR (c) Edge-Triggered Flip-Flops

State Diagrams The sequential circuit function can be represented in graphical form as a state diagram with the following components: A circle with the state name in it for each state A directed arc from the Present State to the Next State for each state transition A label on each directed arc with the Input values which causes the state transition, and A label: On each circle with the output value produced, or On each directed arc with the output value produced.

State Diagrams Label form: On circle with output included: state/output Moore type output depends only on state On directed arc with the output included: input/output Mealy type output depends on state and input

State Diagram: SR Latch

Other Flip-Flop Types J-K and T flip-flops Behavior Implementation Basic descriptors for understanding and using different flip-flop types Characteristic tables Characteristic equations Excitation tables For actual use, see Reading Supplement - Design and Analysis Using J-K and T Flip-Flops

J-K Flip-flop Behavior Same as S-R flip-flop with J analogous to S and K analogous to R Except that J = K = 1 is allowed, and For J = K = 1, the flip-flop changes to the opposite state As a master-slave, has same “1s catching” behavior as S-R flip-flop If the master changes to the wrong state, that state will be passed to the slave E.g., if master falsely set by J = 1, K = 1 cannot reset it during the current clock cycle

J-K Flip-flop Build this! J C K JK=10 or 11 JK=00 D J Q = 0 Q = 1 K C Implementation To avoid 1s catching behavior, one solution used is to use an edge-triggered D as the core of the flip-flop J C K Build this! D C K J Q = 0 Q = 1 JK=00 JK=10 or 11 JK=01 or 11

T Flip-flop Behavior Same as a J-K flip-flop with J = K = T Has a single input T For T = 0, no change to state For T = 1, changes to opposite state Same as a J-K flip-flop with J = K = T As a master-slave, has same “1s catching” behavior as J-K flip-flop Cannot be initialized to a known state using the T input Reset (asynchronous or synchronous) essential

T Flip-flop Build this! T C T = 1 T=0 D T Q = 0 Q = 1 C Implementation To avoid 1s catching behavior, one solution used is to use an edge-triggered D as the core of the flip-flop T C Build this! Q = 0 Q = 1 T=0 T = 1 C D T

Basic Flip-Flop Descriptors Used in analysis Characteristic table - defines the next state of the flip-flop in terms of flip-flop inputs and current state Characteristic equation - defines the next state of the flip-flop as a Boolean function of the flip-flop inputs and the current state Used in design Excitation table - defines the flip-flop input variable values as function of the current state and next state

D Flip-Flop Descriptors Characteristic Table Characteristic Equation Q(t+1) = D Excitation Table D 1 Operation Reset Set Q(t 1) + Q(t +1) 1 D Operation Reset Set

T Flip-Flop Descriptors Characteristic Table Characteristic Equation Q(t+1) = T Å Q Excitation Table No change Complement Operation 1 T Q(t 1) Q ( t ) + Q(t + 1) Q ( t ) 1 T No change Complement Operation

S-R Flip-Flop Descriptors Characteristic Table Characteristic Equation Q(t+1) = S + R Q, S.R = 0 Excitation Table 1 Operation S R No change Reset Set Undefined ? Q(t + 1) Q ( t ) Operation No change Set Reset S X 1 Q(t+ 1) Q(t) R

J-K Flip-Flop Descriptors Characteristic Table Characteristic Equation Q(t+1) = J Q + K Q Excitation Table 1 No change Set Reset Complement Operation J K Q(t + 1) Q ( t ) Q(t + 1) 1 Q(t) Operation X K J No change Set Reset No Change