CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay2 The D FlipFlop A 1-bit register is called a D flipflop. When.

Slides:



Advertisements
Similar presentations
Registers Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may.
Advertisements

CS1Q Computer Systems Lecture 12 Simon Gay. Lecture 12CS1Q Computer Systems - Simon Gay 2 Design of Sequential Circuits The systematic design of sequential.
Changes in input values are reflected immediately (subject to the speed of light and electrical delays) on the outputs Each gate has an associated “electrical.
1 Introduction Sequential circuit –Output depends not just on present inputs (as in combinational circuit), but on past sequence of inputs Stores bits,
Sequential Logic ENEL 111. Sequential Logic Circuits So far we have only considered circuits where the output is purely a function of the inputs With.
COE 202: Digital Logic Design Sequential Circuits Part 1 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office: Ahmad Almulhem, KFUPM.
Sequential Logic Building Blocks – Flip-flops
A. Abhari CPS2131 Sequential Circuits Most digital systems like digital watches, digital phones, digital computers, digital traffic light controllers and.
Flip-Flops Computer Organization I 1 June 2010 © McQuain, Feng & Ribbens A clock is a free-running signal with a cycle time. A clock may be.
1 Fundamentals of Computer Science Sequential Circuits.
Flip-Flops, Registers, Counters, and a Simple Processor
Classification of Digital Circuits  Combinational. Output depends only on current input values.  Sequential. Output depends on current input values and.
Digital Logic Chapter 5 Presented by Prof Tim Johnson
Multiplexors Sequential Circuits and Finite State Machines Prof. Sin-Min Lee Department of Computer Science.
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.
1 Lecture 20 Sequential Circuits: Latches. 2 Overview °Circuits require memory to store intermediate data °Sequential circuits use a periodic signal to.
Sequential Logic Flip Flops Lecture 4.
Flip - flops. We begin our study of such circuits be discussing the elements necessary to implement the “storage” portion of sequential systems. I present.
Dr. ClincyLecture1 Appendix A – Part 2: Logic Circuits Current State or output of the device is affected by the previous states Circuit Flip Flops New.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
EKT 124 / 3 DIGITAL ELEKTRONIC 1
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
Digital Logic Design Lecture 23. Announcements Homework 8 due Thursday, 11/20 Exam 3 coming up on Tuesday, 11/25.
Sequential Logic Flip-Flops and Related Devices Dr. Rebhi S. Baraka Logic Design (CSCI 2301) Department of Computer Science Faculty.
ENGIN112 L20: Sequential Circuits: Flip flops October 20, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 20 Sequential Circuits: Flip.
Overview Logic Combinational Logic Sequential Logic Storage Devices SR Flip-Flops D Flip Flops JK Flip Flops Registers Addressing Computer Memory.
11/10/2004EE 42 fall 2004 lecture 301 Lecture #30 Finite State Machines Last lecture: –CMOS fabrication –Clocked and latched circuits This lecture: –Finite.
CS 151 Digital Systems Design Lecture 20 Sequential Circuits: Flip flops.
A.Abhari CPS2131 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers:
Sequential Circuit  It is a type of logic circuit whose output depends not only on the present value of its input signals but on the past history of its.
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
ECE 301 – Digital Electronics Flip-Flops and Registers (Lecture #15)
Registers and Counters
COE 202: Digital Logic Design Sequential Circuits Part 1
Flip Flop
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 9 Sequential.
CS1Q Computer Systems Lecture 10 Simon Gay. Lecture 10CS1Q Computer Systems - Simon Gay2 Combinational Circuits All the circuits we have seen so far are.
Rabie A. Ramadan Lecture 3
CS1Q Computer Systems Lecture 8
Chap 4. Sequential Circuits
CS 151: Digital Design Chapter 5: Sequential Circuits 5-3: Flip-Flops II.
1 Lecture 22 Sequential Circuits Analysis. 2 Combinational vs. Sequential  Combinational Logic Circuit  Output is a function only of the present inputs.
 Counters are sequential circuits which "count" through a specific state sequence. They can count up, count down, or count through other fixed sequences.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Chapter 3 Digital Logic Structures. 3-2 Combinational vs. Sequential Combinational Circuit always gives the same output for a given set of inputs  ex:
1 COMP541 Sequential Circuits Montek Singh Feb 1, 2012.
CS1Q Computer Systems Lecture 11 Simon Gay. Lecture 11CS1Q Computer Systems - Simon Gay 2 The D FlipFlop The RS flipflop stores one bit of information.
Sequential logic circuits
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.
Sequential Logic Computer Organization II 1 © McQuain A clock is a free-running signal with a cycle time. A clock may be either high or.
CS1Q Computer Systems Lecture 8
Synchronous Sequential Logic A digital system has combinational logic as well as sequential logic. The latter includes storage elements. feedback path.
Chapter 6 – Digital Electronics – Part 1 1.D (Data) Flip Flops 2.RS (Set-Reset) Flip Flops 3.T Flip Flops 4.JK Flip Flops 5.JKMS Flip Flops Information.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
A latch is a temporary storage device that has two stable states (bistable). It is a basic form of memory. The S-R (Set-Reset) latch is the most basic.
Synchronous Sequential Circuits by Dr. Amin Danial Asham.
Latches, Flip Flops, and Memory ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin – Madison.
REGISTER TRANSFER LANGUAGE (RTL) INTRODUCTION TO REGISTER Registers1.
1 Registers A register is a group of n flip-flops each of them capable of storing one bit of information There are two types of registers: parallel and.
Clocks A clock is a free-running signal with a cycle time.
Sequential Logic and Flip Flops
ECE Digital logic Lecture 16: Synchronous Sequential Logic
Registers and Counters Register : A Group of Flip-Flops. N-Bit Register has N flip-flops. Each flip-flop stores 1-Bit Information. So N-Bit Register Stores.
LECTURE 15 – DIGITAL ELECTRONICS
Sequential Logic and Flip Flops
COMP541 Sequential Circuits
FLIP-FLOPS.
Presentation transcript:

CS1Q Computer Systems Lecture 11 Simon Gay

Lecture 11CS1Q Computer Systems - Simon Gay2 The D FlipFlop A 1-bit register is called a D flipflop. When considering the D flipflop as an individual component, it is common to make both the output Q and its inverse Q available. Here it is (without the Reset input, which we do not need for the next few examples).

Lecture 11CS1Q Computer Systems - Simon Gay3 The D FlipFlop A register can be viewed as a collection of D flipflops. Here is a 4 bit register (without the Reset input). Note that all 4 flipflops are connected to the same clock input.

Lecture 11CS1Q Computer Systems - Simon Gay4 The T FlipFlop If the Q output of a D flipflop is connected to the D input, the resulting circuit changes state (from 0 to 1, or from 1 to 0) at every clock tick. This is a T (for trigger) flipflop. DQ Q T This is an example of the general structure of a sequential circuit. There is one bit of memory, and at each clock cycle, the memory is updated by storing the negated output from the previous cycle.

Lecture 11CS1Q Computer Systems - Simon Gay5 A Binary Counter When counting in binary, each bit changes its value when the bit to its right changes from 1 to 0 (i.e. at a negative edge) a negative edge causes the bit on the left to change

Lecture 11CS1Q Computer Systems - Simon Gay6 A Binary Counter T flipflops can be used to build a circuit which counts in binary, advancing by 1 on each clock cycle. Assuming that the flipflops are positive edge triggered, we need to convert a negative edge on an output into a positive edge on the next clock input. TTT CLOCK not Q0Q1Q2 a 3 bit counter the same idea works for any number of bits

Lecture 11CS1Q Computer Systems - Simon Gay7 A Binary Counter This design is sometimes called a ripple counter because of the way that the change in output propagates from bit to bit. When the outputs are 111, the next clock cycle changes the state to 000. The design can be extended to any number of bits.

Lecture 11CS1Q Computer Systems - Simon Gay8 A Counter Application A 2 bit counter can be used to complete the design of a traffic light controller. The counter generates the binary numbers from 0 to 3 in sequence, and the circuit from Lecture 9 converts these numbers into the correct outputs for the Red, Amber and Green lights. Exercise: Why is this not quite a perfect traffic light controller?

Lecture 11CS1Q Computer Systems - Simon Gay9 The Prime Number Machine Again Recall our design of the circuit which outputs the sequence 2, 3, 5, 7, 11, 13 as 4 bit binary numbers. The design works but has a couple of undesirable features: a 4 bit register is used, but there are only 6 states and therefore only 3 bits of storage should be necessary it seems to be a fluke that the “Reset problem” can be solved so easily; this technique might be hard to generalise The idea for an alternative design is to assume that we have a 3 bit counter as a standard component. It has a clock input and an asynchronous reset input. Q2Q1Q0 Reset Clock

Lecture 11CS1Q Computer Systems - Simon Gay10 PNM Second Design Assuming that we make use of states 0 to 5 (i.e. 000 to 101) of the counter, we need a circuit to calculate the outputs P3,P2,P1,P0 according to this truth table: Q2Q1Q0P3P2P1P XXXX XXXX Easy to design the circuit for P3,P2,P1,P0 (exercise).

Lecture 11CS1Q Computer Systems - Simon Gay11 PNM Second Design States 110 and 111 are not needed. We would like the counter to advance from state 101 to state 000. This can be achieved by connecting the Reset input to a small circuit which will activate Reset when the state reaches 110. If Reset is active high, then we can use If Reset is active low, then we need

Lecture 11CS1Q Computer Systems - Simon Gay12 PNM Second Design reset circuit Q2Q1Q0 Reset Clock output circuit P0P1P2 Exercise: complete the circuit.

Lecture 11CS1Q Computer Systems - Simon Gay13 Implementing Memory/Registers With current integrated circuit technology, memory can be implemented by taking advantage of capacitance - the tendency for electric charge to persist in part of a circuit. The electric current representing a 1 input to a register causes a tiny electric charge to build up in the circuit, and this charge will remain for a short time. If the contents of the register are only needed for the next clock cycle, and the clock speed is sufficiently high, then nothing more needs to be done. Registers (known as latches) which are used for temporary storage, have this property. In the case of a CPU’s general registers, and the RAM of a computer, the contents must be refreshed in order to preserve them for longer periods.

Lecture 11CS1Q Computer Systems - Simon Gay14 Implementing Memory/Registers It is also interesting that memory can be built from the purely logical properties of the basic gates that we are familiar with. We will now look at the step-by-step development of the D flipflop from a circuit called the RS flipflop, which just consists of two NOR gates.

Lecture 11CS1Q Computer Systems - Simon Gay15 The RS FlipFlop Using two NOR gates we can build a circuit which is able to store one bit of information: either 0 or 1. nor2 R S Q Q Note the essential use of feedback (connections from outputs to inputs), which takes us beyond combinational circuits.

Lecture 11CS1Q Computer Systems - Simon Gay16 The RS FlipFlop: Summary The RS flipflop has two stable states: Q = 0, Q = 1 Q = 1, Q = 0 If R (reset) becomes 1 then Q becomes 0 and Q becomes 1, and this state is maintained when R returns to 0. If S (set) becomes 1 then Q becomes 1 and Q becomes 0, and this state is maintained when S returns to 0. If R and S become 1 simultaneously then the behaviour of the circuit is not defined (in practice, one of R and S would remain at 1 for slightly longer than the other, and the last one to change would determine the subsequent state of the flipflop).

Lecture 11CS1Q Computer Systems - Simon Gay17 The RS FlipFlop The RS flipflop is a basic unit of memory: it can store one bit, and the stored bit can be changed by means of the R and S inputs. Some refinements are needed before the RS flipflop becomes a useful component for digital circuits. The first issue is that it is an asynchronous component: the R and S inputs can be used at any time. As we are interested in synchronous circuits, we need to introduce a clock, in such a way that setting R or S causes the state to change at the next clock cycle, rather than immediately. The first step is to introduce an enable input.

Lecture 11CS1Q Computer Systems - Simon Gay18 The Gated RS FlipFlop A gated or enabled RS flipflop only responds to its inputs when the Enable input is 1. This is done by passing the inputs through AND gates. Diagrammatically:

Lecture 11CS1Q Computer Systems - Simon Gay19 The Clocked RS FlipFlop If the clock is connected to the Enable input of a gated RS flipflop, the result is a flipflop which responds to its inputs when the clock is high (has value 1) and ignores its inputs when the clock is low (has value 0). A sequential circuit built in this way can only change state while the clock is high. This is a good start, but there are a number of engineering reasons why it is preferable for state changes to occur at a clock edge. A circuit can be designed to use either the positive edge (the transition from 0 to 1) or the negative edge (the transition from 1 to 0). negative edgepositive edge clock high clock low

Lecture 11CS1Q Computer Systems - Simon Gay20 The Master-Slave Circuit Two gated RS flipflops connected together: R S Q QE R S Q QE R SQ Q Clock MASTERSLAVE

Lecture 11CS1Q Computer Systems - Simon Gay21 The Master-Slave Circuit: Summary When the clock is 1, the master flipflop is enabled and responds to its inputs. It can therefore be set or reset by the S and R inputs. The slave flipflop is not enabled, because it receives the inverted clock, which is 0. Therefore the outputs of the circuit, corresponding to the value stored in the slave flipflop and are not affected by the S and R inputs. When the clock changes to 0, the master flipflop is no longer enabled, so its stored value is fixed according to whether the S or R input was the last one to have value 1. The slave flipflop is now enabled, so the outputs of the master flipflop set or reset the value stored in the slave. Therefore as the clock changes from 1 to 0, the value represented by the inputs to the master flipflop is transferred to the slave flipflop. Once the slave has received this value, its outputs are fixed until the next time the clock changes from 1 to 0. This circuit is a negative edge-triggered RS flipflop.

Lecture 11CS1Q Computer Systems - Simon Gay22 RS FlipFlop with Clear It is useful to be able to reset a flipflop to 0 at any time, even when it is not enabled. (For example, because an electronic flipflop enters a random state when power is first applied, and needs to be initialised.) A Clear input can be added to the basic gated RS flipflop circuit like this: A master-slave circuit built from two flipflops with Clear, by connecting the Clear inputs together, gives a clocked flipflop with an asynchronous Clear input.

Lecture 11CS1Q Computer Systems - Simon Gay23 Positive or Negative? We will use the following diagram for a clocked RS flipflop. When studying synchronous circuits, we don’t care whether components are triggered by the positive or negative clock edge; actually, we can even forget about whether they are edge-triggered or level-triggered. All we need to know is that the clock “ticks” regularly, and a state change is possible at each tick.