In this lecture we will work through a design example from problem statement to digital circuits.

Similar documents
D Latch (Transparent Latch)

CPS311 Lecture: Sequential Circuits

The reduction in the number of flip-flops in a sequential circuit is referred to as the state-reduction problem.

Asynchronous (Ripple) Counters

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

MC9211 Computer Organization

WEEK 10. Sequential Circuits: Analysis and Design. Page 1

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

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

ELCT201: DIGITAL LOGIC DESIGN

Synchronous Sequential Logic. Chapter 5

DIGITAL TECHNICS. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Chapter 5: Synchronous Sequential Logic

Counter dan Register

Unit 11. Latches and Flip-Flops

ELCT201: DIGITAL LOGIC DESIGN

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

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

Chapter 5 Synchronous Sequential Logic

CHAPTER 4: Logic Circuits

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

Synchronous Sequential Logic

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

Vignana Bharathi Institute of Technology UNIT 4 DLD

EE292: Fundamentals of ECE

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

Chapter 3. Boolean Algebra and Digital Logic

UNIT IV. Sequential circuit

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

Synchronous Sequential Logic

Lecture 11: Synchronous Sequential Logic

Chapter 8 Sequential Circuits

CHAPTER 4: Logic Circuits

Chapter 9 Counters. Clock Edge Output Q 2 Q 1 Q

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

Chapter 11 State Machine Design

LATCHES & FLIP-FLOP. Chapter 7

Lecture 12. Amirali Baniasadi

A Review of logic design

Analysis of Clocked Sequential Circuits

RS flip-flop using NOR gate

FPGA Implementation of Sequential Logic

Logic Design. Flip Flops, Registers and Counters

1. Convert the decimal number to binary, octal, and hexadecimal.

RS flip-flop using NOR gate

Synchronous Sequential Logic

More design examples, state assignment and reduction. Page 1

Combinational / Sequential Logic

Dr.Mohamed Elmahdy Winter 2015 Eng.Yasmin Mohamed. Problem Set 6. Analysis and Design of Clocked Sequential Circuits. Discussion: 7/11/ /11/2015

Chapter. Synchronous Sequential Circuits

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Digital Logic Design I

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

Chapter 9 Introduction to Sequential Logic

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Sequential Circuits: Latches & Flip-Flops

MODEL QUESTIONS WITH ANSWERS THIRD SEMESTER B.TECH DEGREE EXAMINATION DECEMBER CS 203: Switching Theory and Logic Design. Time: 3 Hrs Marks: 100

To design a sequential logic circuit using D-Flip-flop. To implement the designed circuit.

Logic Design II (17.342) Spring Lecture Outline

Other Flip-Flops. Lecture 27 1

Lecture 8: Sequential Logic

Chapter 5 Synchronous Sequential Logic

Digital Circuit And Logic Design I. Lecture 8

DIGITAL TECHNICS II. Dr. Bálint Pődör. Óbuda University, Microelectronics and Technology Institute

Digital Circuit And Logic Design I

ECE 341. Lecture # 2

11.1 As mentioned in Experiment 10, sequential logic circuits are a type of logic circuit where the output

Administrative issues. Sequential logic

Physics 120 Lab 10 (2018): Flip-flops and Registers

Lecture 12: State Machines

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

VTU NOTES QUESTION PAPERS NEWS RESULTS FORUMS Registers

Flip-flop and Registers

How to Design a Sequential Counter

SEMESTER ONE EXAMINATIONS 2002

Chapter 4. Logic Design

Chapter 5 Sequential Circuits

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

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

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

REPEAT EXAMINATIONS 2002


Digital Fundamentals: A Systems Approach

Introduction to Sequential Circuits

UNIT-3: SEQUENTIAL LOGIC CIRCUITS

B.Tech CSE Sem. 3 15CS202 DIGITAL SYSTEM DESIGN (Regulations 2015) UNIT -IV

Department of CSIT. Class: B.SC Semester: II Year: 2013 Paper Title: Introduction to logics of Computer Max Marks: 30

Synchronous Sequential Logic

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

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Sequential Logic Circuits

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Digital Circuits 4: Sequential Circuits

Combinational vs Sequential

Final Exam review: chapter 4 and 5. Supplement 3 and 4

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

Chapter 5 Sequential Circuits

2 Sequential Circuits

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

Transcription:

Lecture : A Design Example - Traffic Lights In this lecture we will work through a design example from problem statement to digital circuits. The Problem: The traffic department is trying out a new system of traffic lights based on the usual European model. We have to design a synchronous digital circuit, a Moore Machine, which operates this new type of traffic light at a simple road crossing. R A G N-S (SAFE) AMBER E-W AMBER (UNSAFE) G2 A2 R2 AMBER AMBER There are six lights to operate. The Red, Amber, and Green lights in the North-South direction will be designated as R, A, G. Similarly, the lights in the East-West direction will be called R2, A2, and G2. When the digital signals are in the Logic- state they turn their respective lights on, otherwise the lights are off. A digital clock signal will be supplied and at each clock pulse the lights should change according the schedule given above. There are two types of road crossing: safe ones that require one sequence, and dangerous ones that require another (delayed green) sequence. One digital input signal called SAFE will indicate whether the road crossing is safe. Thus, we have a one-input, six-output synchronous system to design. Step : Understand the problem and decide how many states you need. Here, "understanding the problem" refers to the understanding of the verbally described problem and its translation into digital circuit terms. Usually, the determination of the number of required states is not a trivial problem; and the determination of the minimum number of states may be very difficult. Probably, a reasonable approach is to find a number of states for which a state transition diagram can be constructed and then look at the problem again because, possibly, we can discover that some states are duplicated and thus can be eliminated. Our problem is simple enough, so this will not happen here. SAFE= SAFE= SAFE CLOCK Traffic light controller R A G R2 A2 G2 <--> <-2-> <--> <-2-> R A G R A G R A G R A G Looking at the transition table, we see that there are six states in the first column (dangerous intersection) and four states in the second. However we do not need ten states because all four states in the second column (the same six outputs) are included in the six states of the first column. Hooray! We need only six states. Let us number them to 6 in the order they are shown in the state transition table. Step 2. Construct the state transition diagram (ignore outputs) DOC2: Computer Hardware Lecture 9 Page

N-S E-W STATE <--> <-2-> R A G R A G 2 3 (A) 4 5 6 (B) 5 6 2 Two states (3 and 6), labelled A and B, have exactly the same traffic light outputs. Could they be merged as one state? The answer is no, unfortunately, because the state after 3 is 4 while the state after 6 is. Step 3: Select the type and number of flip-flops for the circuit. Since the number of states is equal to six, the minimum number of flip-flops, which can support six states, is three. The maximum number of flip-flops one may use is six (one flip-flop per state). For this design example we will use three D-type flip-flops. There will be two unused states. Step 4: Assign state numbers to flip-flop outputs and construct the transition table. While there are some heuristic rules for assigning states to flip-flop outputs, they are difficult to apply and do not guarantee a minimum circuit. We will minimise the K-maps only for. Therefore, we will not use the two states and, which will be the two unused states 7 and 8. The idea behind this choice is that a large number of s may provide easier minimisation so we use states with few s for the unused states. The rest of the flip-flop outputs are assigned in order while constructing the transition table. SAFE State(t n ) --> State(t n+ ) SAFE Q (t n), 4, 3 Flip-Flop Q (t ) i i n+ 2 (7) 2 3 (8) 3 4 () --> (2) 4 5 (2) --> (3) 5 6 (3) --> (4) 6 (4) --> (5) 7 U (5) --> (6) 8 U (6) --> () 2 (7) 2 4 (8) 3 U () --> (2) 4 5 (2) --> (4) 5 (3) 6 U (4) --> (5) 7 U (5) --> () 8 U (6) State Transitions Using State Numbers Assignment of Flip-flop Outputs We may go now to the next step directly (fill out K-maps and minimise). But in order to avoid errors in transferring the data from the transition table to the K-maps, a rearranged transition table is constructed first. The order of the signals S (SAFE) and Q i (the flip-flop outputs) are rearranged according to the sequence they are entered into the table (instead of ->->-> we use ->->->). Also, since we are using D-type flip-flops, the terms Q i (t n+ ) become simply D i DOC2: Computer Hardware Lecture 9 Page 2

D3 S QQ2Q3 DD2D3 S,Q D D2 S,Q S,Q Step 5: Fill in K-Maps and determine the minimised expressions (see above). The next step is to determine the required logic expressions for the three flip-flop inputs D, D 2, and D 3. We use graphical method, i.e. the K-maps for the minimisation; however, any minimising algorithm can be used. One piece of caution should be mentioned here: we have to construct nine (!) combinational logic circuits. In addition to the three circuits for the flip-flop inputs, six simpler (only three-input) output control circuits must be built for the six traffic light signals R to G2. The K-Maps minimise each circuit individually; however, when multiple outputs are required, minimisation can arise by reusing expressions. For example, if for one circuit the term S' Q Q3' appears, which appears for another circuit as well, this part of the circuit has to be built only once and the signal used as many times as needed. For this reason, we will not try to factorise the expressions until we have all nine expressions. Also, we have to check whether the circuit works. DOC2: Computer Hardware Lecture 9 Page 3

Step 6: Construct the Diagram for all States (including don't cares). Once minimisation of the K-Maps is determined and the indicated grouping of s and s are shown, we can replace the "don't care" outputs with the actual outputs (since this is exactly what the grouping show). Thus, we have now a completely defined sequential circuit and before we determine the Boolean expressions for the flipflop inputs we should check whether the system behaves correctly even if it starts from one of the unused state. A convenient way of checking this is by constructing the complete transition diagram in which the unused states and by states 7 and 8 respectively. S,Q D S,Q S QQ2Q3 DD2D3 (7) (4) (8) (3) (2) (3) () (2) (3) (4) (4) (5) (6) () (5) (6) (3) (3) (4) (5) (6) () (5) () (7) (4) (8) (4) (2) (4) () (2) D2 7 8,, 6 S,Q 5, D3, 2 4 3 Disaster struck! If the SAFE input is logic (safe crossing) and the system finds itself in state 3 then it will be stuck in state 3. We cannot allow this, we have to go back and change some "don't care" bit(s) since we chose one value for it but could have chosen another. The state in trouble is State 3, flip-flop outputs and K-map entry. Looking at the K-maps, we can see that by changing the indicated for this term in the K-map for D3 to a will cause minimal damage (i.e. will add one extra term to the expression. The changed table is shown below. If we check in the transition table the entry for will change to and the system will move to State 4 from State 3 regardless of the SAFE input. We have repaired our system. All other illegal states ultimately end up in a proper state so we have a working system. It would be possible to make a bit safer system by requiring that all illegal states must go immediately to State 3 or State 6 (R=R2=) in which case we have to go back to the K-maps and change other "don't care" entries to satisfy these conditions. We will not complicate our problem with this extra work. DOC2: Computer Hardware Lecture 9 Page 4

S QQ2Q3 DD2D3 (7) (4) (8) (3) (2) () (3) (2) (3) (4) (4) (5) (6) () (5) (6) (3) (4) (4) (5) (6) (5) () () (7) (8) (4) (4) (2) (4). () (2) S,Q D3 Step 7: Construct the Output Circuits in G Unfortunately, there are six such circuits but fortunately they have three inputs only (Moore Machine). Their K- Maps can be filled out by the requirements of lights to be either ON or OFF for each given state. Here again we will start by ignoring the two unused states which will provide "don't care" outputs to find the minimised circuits. Again, filling out the K-maps with the selected s and s will give us the actual operation of the lights for states 7 and 8. We will have to look at these whether they are safe. STATE Q Q2 Q3 R A G R2 A2 G2 2 3 4 6 5 Q Q Q R = Q' + Q2' Q3' + Q2 Q3 A = Q Q2 Q3' G = Q2' Q3 Q Q Q2,Q 3 Q R2 = Q A2 = Q' Q3 G2 = Q' Q3' In summary we have the following circuits to build: DOC2: Computer Hardware Lecture 9 Page 5

D = Q2' + S' Q Q3' + Q' Q3 D2 = Q Q3 + Q2 Q3' D3 = Q2' Q3' + S' Q3' + S Q' R = Q' + Q2' Q3' + Q2 Q3 A = Q Q2 Q3' or Q2 Q Q3' The common terms are underlined G = Q2' Q3 R2 = Q A2 = Q' Q3 G2 = Q' Q3' A Different State Assignment If we want to try to find a simpler overall circuit, we may try different flip-flop assignments for the states. One idea is to minimise the output circuitry. We could, for example, make R=Q and R2=Q2, if these simple assignments will give us a correct complete state assignment. The third output, Q3 has to be assigned such that all used states are distinct. One possible set of assignments are shown below: Q Q2 Q3 R A G R2 A2 G2 STATE 7 8 4 5 2 3 6 Q Q Q Q R=Q A=Q' Q3' G=Q' Q3 Q Q R2=Q2 A2=Q2' Q3 G2=Q2' Q3' The output circuits require only two-input NAND gates. But of course, we have to redesign the input circuitry with the new flip-flop assignments. DOC2: Computer Hardware Lecture 9 Page 6

D3 S QQ2Q3 DD2D3 (7) (8) (4) (5) (5) (6) () (2) (2) (3) (3) (4) (6) () () (2) (2) (4) (3) (6) (7) (8) (4) (5) (5) () S,Q S,Q D S,Q D2 This circuit seems to be simpler than the first one. D = S' Q2' + Q3' D2 = S' Q' + Q3 D3 = Q2' + Q Q3 R = Q A = Q' Q3' G = Q' Q3 7 8, 2 3, R2 = Q2 A2 = Q2' Q3 G2 = Q2' Q3', 6 5, 4 DOC2: Computer Hardware Lecture 9 Page 7

And the final circuit is: S D Q R Q' A G D3 Q3 Q3' G2 D2 Q2 R2 Q2' A2 DOC2: Computer Hardware Lecture 9 Page 8