Lecture 5 5. Sequential functions and circuits 5.1 Introduction

Slides:



Advertisements
Similar presentations
Types of Logic Circuits
Advertisements

Lecture 8 Clock-Mode Sequential Machines Gas burner start up (application example)
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.
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
1 Sequential Ckts, Latches and Timing Issues Today: Sequential Circuits, LatchesFirst Hour: Sequential Circuits, Latches –Section of Katz’s Textbook.
Digital Logic Design ESGD2201
Digital Electronics Lecture 7 Sequential Logic Circuit Design.
ECE 331 – Digital System Design Latches and Flip-Flops (Lecture #17) The slides included herein were taken from the materials accompanying Fundamentals.
Sequential Circuits1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
Introduction to Sequential Logic Design Bistable elements Latches.
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.
CP208 Digital Electronics Class Lecture 11 May 13, 2009.
1 © 2014 B. Wilkinson Modification date: Dec Sequential Logic Circuits – I Flip-Flops A sequential circuit is a logic components whose outputs.
Sequential circuit Digital electronics is classified into combinational logic and sequential logic. In combinational circuit outpus depends only on present.
Chapter 11_2 (10_2 edition 8) Sequential Circuits etc.
Sequential Circuits and Finite State Machines Prof. Sin-Min Lee
1 Chapter 4 Combinational and Sequential Circuit.
EE 4271 VLSI Design, Fall 2010 Sequential Circuits.
Contemporary Logic Design Sequential Logic © R.H. Katz Transparency No Chapter #6: Sequential Logic Design Sequential Switching Networks.
Sequential logic and systems
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.
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.
Programming with Function Blocks
Digital Logic Design CHAPTER 5 Sequential Logic. 2 Sequential Circuits Combinational circuits – The outputs are entirely dependent on the current inputs.
Flip Flops. Clock Signal Sequential logic circuits have memory Output is a function of input and present state Sequential circuits are synchronized by.
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Sequential Circuits Chapter 4 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer,  S.
Lecture 10 Topics: Sequential circuits Basic concepts Clocks
Digital Computer Design Fundamental
Introduction to Digital Logic Design Appendix A of CO&A Dr. Farag
Some Useful Circuits Lecture for CPSC 5155 Edward Bosworth, Ph.D. Computer Science Department Columbus State University.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Flip Flop
Rabie A. Ramadan Lecture 3
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
1 Boolean Algebra & Logic Gates. 2 Objectives Understand the relationship between Boolean logic and digital computer circuits. Learn how to design simple.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
CHAPTER-2 Fundamentals of Digital Logic. Digital Logic Digital electronic circuits are used to build computer hardware as well as other products (digital.
SEQUENTIAL LOGIC By Tom Fitch. Types of Circuits Combinational: Gates Combinational: Gates Sequential: Flip-Flops Sequential: Flip-Flops.
Hamming Code,Decoders and D,T-flip flops Prof. Sin-Min Lee Department of Computer Science.
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.
Synchronous Sequential Logic Part I
Sahar Mosleh PageCalifornia State University San Marcos 1 More on Flip Flop State Table and State Diagram.
CO5023 Latches, Flip-Flops and Decoders. Sequential Circuit What does this do? The OUTPUT of a sequential circuit is determined by the current output.
Instructor: Alexander Stoytchev CprE 281: Digital Logic.
How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.
Chapter5: Synchronous Sequential Logic – Part 1
CS151 Introduction to Digital Design Chapter 5: Sequential Circuits 5-1 : Sequential Circuit Definition 5-2: Latches 1Created by: Ms.Amany AlSaleh.
4–1. BSCS 5 th Semester Introduction Logic diagram: a graphical representation of a circuit –Each type of gate is represented by a specific graphical.
COMBINATIONAL AND SEQUENTIAL CIRCUITS Guided By: Prof. P. B. Swadas Prepared By: BIRLA VISHVAKARMA MAHAVDYALAYA.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
Sequential Logic Circuit Design Eng.Maha Alqubali.
Actuators and Control, Part 4 Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning.
Flip-Flop Flip-flops Objectives Upon completion of this chapter, you will be able to :  Construct and analyze the operation of a latch flip-flop made.
Sequential logic circuits First Class 1Dr. AMMAR ABDUL-HAMED KHADER.
FLIP FLOPS Binary unit capable of storing one bit – 0 or 1
Clocks A clock is a free-running signal with a cycle time.
LECTURE 15 – DIGITAL ELECTRONICS
How does the CPU work? CPU’s program counter (PC) register has address i of the first instruction Control circuits “fetch” the contents of the location.
CSE 370 – Winter Sequential Logic - 1
Instructor: Alexander Stoytchev
FLIP-FLOPS.
Synchronous sequential
Synchronous Sequential
ECE 352 Digital System Fundamentals
Lecture 14: State Tables, Diagrams, Latches, and Flip Flop
Week 11 Flip flop & Latches.
Presentation transcript:

Lecture 5 5. Sequential functions and circuits 5.1 Introduction 5.2 Feedback, memory, state 5.3 Sequential functions and circuits 5.4 Flip-flops 5.5 The S-R flip-flop 5.6 Examples

5.1 Introduction In the preceding chapters we have discussed various types and aspects of combinational functions, whose outputs are determined completely by their inputs. An important property ot that functions and circuits, where these functions are implemented, is that there is no feedback from the output to the input

5.2 Feedback, memory, state The moment we introduce this feedback, we get a new type of function or circuit with a new capability: -The capability to store bits of information. In other words the circuit also acquires memory. Depending on the contents of its memory, we say that the circuit is in a certain state

Feedback, memory, state - 2 Therefore a change in the contents of the memory implies a change in the state of the circuit. The output of such a circuit with memory is not always the same for the same input, as is the case with a combinational circuit but also depends on its present state.

Feedback, memory, state - 3 Note, that we have used the word „present“ in the last sentence. This means that the next state as well as the output depend not only on the present input but also the present state. Hence the element of time also comes in. Such combinational functions (circuits) with feedback , having memory of internal states, are called sequental functions (circuits).

5.3 Sequential functions and circuits Such combinational functions (circuits) with feedback , having memory of internal states, are called sequental functions (circuits). A formal definition of sequential circuits or the more general term sequential machines (automatons) will be given later.

Sequential functions and circuits -1 There are three special types of sequential machines: Flip-flops Counters Shift registers The building blocks of all these sequential circuits are the flip-flops, which we discuss in this lecture.

5.4 Flip-flops A flip-flop is the most elementary sequential machine having only two states. These are therefore bistable circuits. Although the flip-flops may differ in their electronic compositions, they exhibit certain definite logical properties.

Flip-flops - 2 In fact, all flip-flops, irrespective of their internal circuit implementation, can be classsified into a few types according to their logical behavior. The R-S flip-flop The J-K flip-flop The D flip-flop The T flip-flop

Flip-flops - 3 In subsequent sections we first discuss a few typical types of flip-flops and then we seehow theese flip-flops produce various types of conters and shift registers depending on their interconnections

Flip-flops - 4 In PLC we usually have some of these flip-flops at disposal (mostly RS flip -flop and /or SR flip-flop) as co called „function blocks“ (SW function blocks). We only program these blocks, that means we connect them with other blocks in one of the programming languages for PLCs named „Function block diagram - FBD“ (see e.g. LOGO! )

5.5 The S-R flip-flop Consider the circuit shown in the figure: Z1 S >=1 G1 NQ >=1 G2 Q R Z2

The S-R flip-flop - 2 It is a combinational circuit with feedback Z1 S >=1 G1 It has only two NOR gates,G1 and G2, with the output of one gate being fed to the input of the other NQ >=1 G2 Q R Z2

The S-R flip-flop - 3 Now let us study the outputs of the circuit Z1 and Z2 for the four different combinations 00,01,10,11 of the input lines S and R. 1.When S=0, Z1 becomes 1(0) depending on if Z2=0(1): Z1=N(S+Z2)=NS.NZ2=1.NZ2=NZ2 Z1=1.1…….Z2=0 Z1=1.0…….Z2=1

The S-R flip-flop - 4 2. Similarly, when R=0, Z2=NZ1, since Z2=N(R+Z1)=NR.NZ1=1.NZ1=NZ1 3. Thus when SR=00, the values of Z1and Z2 depend only on them and it is always Z1=NZ2. It can now be verified, that with SR=00, if Z1Z2=01 or Z1Z2=10, they retain these output values. In other words, the outputs remain unchanged.

The S-R flip-flop - 5 4.However the situation changes if S=1 and R=0, then the 1 on the S-line will force the output Z1 to be 0, irrespective of the value of Z2. Therefore Z1 becomes 0. This forces Z2 to become 1, as both input lines of gate G2 become 0. Hence when SR=10, the circuit has a stable state with Z1Z2=01.

The S-R flip-flop - 6 5. Similarly it can be found, that the circuit has another stable state with SR=01 and Z1Z2 becoming 10. 6. Now, let us investigate what happens, if SR=11. In this situation, the 1 on the S-line will force Z1 to be 0, and the 1 on the R-line will force Z2 to be 0. So under this conditions, when SR=11, the output will be Z1Z2=00 and this will also be a stable state.

The S-R flip-flop - 7 7. Now, let S and R both become 00 simultanously. Then both NOR gates, G1 and G2, will „see“ 00 at their inputs simultaneously, and their outputs will tend to become 11. Now let the output Z1 of gate G1 change to 1much earlier than Z2 of gate G2. Then the 1 at Z1 will prevent Z2 to become 1 and Z2 will continue to remain 0. Now it can be easily checked that the output Z1Z2=10 with SR=00 is also a stable state.

The S-R flip-flop - 8 8. However, when S and R become 00 simultaneously, if Z2 would have become 1 much earlier than Z1, the output will stabilize at the value of Z1Z2=01. Thus the outputs become unpredictable and depend on the operating delays of the gates G1 and G2.

The S-R flip-flop - 9 Even if these two delays are identical, there is a serious problem. In that case it can beverified that the outputs will oscillate between the values 11 and 00. These are very undesirable operating conditions for the flip-flop.

The S-R flip-flop - 10 Thus although SR=11 and Z1Z2=0 is a stable state, it may introduce serious anomalous situations in operation of the flip-flop. Hence to eliminate this possibility entirely, an aditional restriction, that the S- and R-lines should not be made 1 simultanously, is accepted in the definition of an S-R flip-flop.

S-R flip-flop - 11 Definition: An S-R flip-flop has two input lines, S and R. When S is 1, the flip flop is set to state 1. When R becomes 1, the flip –flop is reset to state 0. When both S and R are 0, the flip-flop continues to be in the same state. The S- and R-lines are never made 1 simultaneously. When the flip-flop is in state 0(1), the output of the flip-flop Q is also 0(1).

S-R flip-flop - 12 This definition yields the truth table,(next snap), where q denotes the present state and Q the next state of the flip-flop. The truth table defines Q as a function of the three variables S, R, and q: Q=f(S,R,q)

S-R flip-flop - 13 The truth table of S-R- flip-flop As a sum of minterms it can be expressed as: Q=(S,R,q)=SUM(1,4,5)+ +x SUM(6,7) =NS.NR.q+S.NR.Nq+S.NR.q+ ???(assume, that x=1)…..+ +S.R.nq+S.R.q=S+NR.q S R q Q 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 x 1 1 1 x This function is known as the characteristic function of the RS flip-flop.

The S-R flip-flop – 14 Theory says all this ….but what about praxis??? In practical applications, we must solve the situation when S=1 and R=1 simultaneously There are two types of SR flip-flops (both HW and SW applications) SR - with prior setting (if SR=11, then Q=1) RS - with prior reseting (if SR=11, then Q=0)

The S-R flip-flop - 15 The truth table of S-R- flip-flop with prior setting (x=1) As a sum of minterms it can be expressed as: Q=(S,R,q)=SUM(1,4,5,6,7)= =NS.NR.q+S.NR.Nq+S.NR.q+ +S.R.nq+S.R.q=NS.NR.q+ +S.(NR.Nq+NR.q+R.Nq+R.q)= =NS.NR.q+S(NR+R)= =NS.NR.q+S=NR.q+S= =S+NR.q S R q Q 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 1

The R-S Flip-flop - 16 The truth table of R-S flip-flop with prior resetting (x=0) As a sum of minterms it can be expressed as: Q=(S,R,q)=SUM(1,4,5)= =NS.NR.q+S.NR.Nq+S.NR.q==NS.NR.q+S.NR= =NR.(NS.q+S)= =NR.(q+S) S R q Q 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 0 1 1 0 1 1 1 0 0 1 1 1 0

The S-R Flip-flops - 17 Practical summary of the RS-flip-flops function: RS(SR) flip-flop (RS(SR) memory) has two inputs: S input – for setting the output Q (Q=1) R input – for reseting the output Q (Q=0) If both R and S inputs are 0, output remains on its last value. If on both S and R inputs are 1 simultaneously, the value of output depends on the type of the flip flop (SR …Q=1,RS…Q=0) Very often the R-S flip-flop blocks have the second output, negation of the output Q, NQ.

The S-R Flip-flop - 18 Block diagram and function table (function table is not the same as the true table, it serves for the function description ) S R Q NQ 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 1 0 S Q SR NQ R

The R-S Flip-flop - 19 Block diagram and function table S R Q NQ 0 1 0 0 1 0 0 0 1 0 0 1 0 1 0 0 0 1 1 1 0 1 S Q RS NQ R

5.6 Examples Example 1: If sensor B1 has a 1-signal, this indicates an error status in the system. A horn H1 is sounded. The horn can only be switched off by actuating push button S1. It is possible to switch off the horn, even if the B1-signal continues to be applied.

Example 1 - 2 Block diagram of the system: The control system has two inputs, from B1,S1 one output to the H1

Example 1 - 3 Let’s try to solve the task intuitively: We use SR flip-flop in the control system first. Horn H1 will be connected to the output Q of the flip-flop. This output should be switched on (set) by error status (indicated by the sensor B1) …thus we connect sensor B1 to the S-input of the flip-flop. This output should be switched off (reset) by push button S1…thus we connect push button S1 to the R-input of the flip-flop.

Example 1 - 4 The first solution: B1 S Q H1 SR S1 R NQ The basic function is OK, but the last sentence of the task definition cannot be fulfilled by this type of flip-flop. If the B1-signal continues to be applied, (this is Set signal for SR flip-flop), it is not possible to reset this flip-flop by its reset signal S1!

Example 1 - 5 Let’s try the second type of the flip-flop, the RS-one. Horn H1 will be connected to the output Q of the flip-flop. This output should be switched on (set) by error status (indicated by the sensor B1) …thus we connect sensor B1 to the S-input of the flip-flop. This output should be switched off (reset) by push button S1…thus we connect push button S1 to the R-input of the flip-flop.

Example 1 - 6 The second solution: B1 S Q H1 RS S1 R NQ The basic function is OK. Also the last sentence of the task definition is fulfilled by this type of flip-flop. If the B1-signal continues to be applied, (this is Set signal for RS flip-flop), it is possible to reset this flip-flop by its reset signal S1 and thus switch off the horn. This solution is the right one.

Example 2 Example 2: Pressing of the start button S2 is to cause the piston of a cylinder to advance (if it is in initial position, that is retracted) – signal Y1=1. This mechanism is to be used to clamp workpieces. When the piston has advanced fully, it is to remain in this position for 20 seconds. (Signal Time_out from the special „timer“ block is on).The cylinder then returns to its initial position signal Y1=0. Sensor B1 indicates, that cylinder is retracted, sensor B2 indicates, that cylinder is advanced.

Example 2 - 2 Block diagram of the system: S2 Y1 B1 B2 Time_out

Example 2 - 3 We use SR flip-flop in the control system. Signal for cylinder Y1 will be connected to the output Q of the SR flip-flop. This output should be switched on (set) by pressing the start button S2 if the piston is in retracted position (indicated by the sensor B1) … thus we connect conjunction of the signals S2 and B1 to the S-input of the SR flip-flop.

Example 2 - 4 This output should be switched off (reset) when the piston has advanced fully (indicated by sensor B2) and has remained there for 20 seconds (signal from timer Time_out)…. thus we connect conjunction of the signals S2 and Time_out to the R-input of the SR flip-flop.

Example 2 - 5 S2 B1 & S Q Y1 SR R NQ B2 & Time_out

Literature Nripendra N. Biswas: Logic Design Theory,Prentice Hall International,1993,ISBN 0-13-010695-X

6. The smallest control systems (PLCs)–“Programmable modules“