CSE370 HW6 Solutions (Winter 2010)

Similar documents
Introduction to Digital Logic

Week-5. Sequential Circuit Design. Acknowledgement: Most of the following slides are adapted from Prof. Kale's slides at UIUC, USA.

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Latches. October 13, 2003 Latches 1

Sequential Logic. Rab Nawaz Khan Jadoon DCS. Lecturer COMSATS Lahore Pakistan. Department of Computer Science

Unit 7 Sequential Circuits (Flip Flop, Registers)

EET 310 Flip-Flops 11/17/2011 1

PGT104 Digital Electronics. PGT104 Digital Electronics

Computers also need devices capable of Storing data and information Performing mathematical operations on such data

Sequential Circuit Analysis

Design of Sequential Circuits

Design at the Register Transfer Level

Boolean Algebra and Digital Logic 2009, University of Colombo School of Computing

CS61C : Machine Structures

ECE 341. Lecture # 3

Memory Elements I. CS31 Pascal Van Hentenryck. CS031 Lecture 6 Page 1

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

CS61C : Machine Structures

Digital Logic: Boolean Algebra and Gates. Textbook Chapter 3

FSM model for sequential circuits

Sequential Circuits Sequential circuits combinational circuits state gate delay

CPE100: Digital Logic Design I

EE40 Lec 15. Logic Synthesis and Sequential Logic Circuits

Sequential Logic (3.1 and is a long difficult section you really should read!)

S.E. Sem. III [ETRX] Digital Circuit Design. t phl. Fig.: Input and output voltage waveforms to define propagation delay times.

Show that the dual of the exclusive-or is equal to its compliment. 7

CSE370 HW3 Solutions (Winter 2010)

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

ELCT201: DIGITAL LOGIC DESIGN

6. Finite State Machines

CprE 281: Digital Logic

Introduction EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 6: Sequential Logic 3 Registers & Counters 5/9/2010

The Design Procedure. Output Equation Determination - Derive output equations from the state table

CSCI 2150 Intro to State Machines

15.1 Elimination of Redundant States

Vidyalankar S.E. Sem. III [ETRX] Digital Circuits and Design Prelim Question Paper Solution

ELE2120 Digital Circuits and Systems. Tutorial Note 10

Chapter #7: Sequential Logic Case Studies Contemporary Logic Design

Chapter 1 Review of Equations and Inequalities

ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN. Week 9 Dr. Srinivas Shakkottai Dept. of Electrical and Computer Engineering

Sequential Logic Worksheet

Chapter 3 Digital Logic Structures

ELEC Digital Logic Circuits Fall 2014 Sequential Circuits (Chapter 6) Finite State Machines (Ch. 7-10)

CE1911 LECTURE FSM DESIGN PRACTICE DAY 1

Synchronous Sequential Circuit Design

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

Synchronous Sequential Logic

Chapter 7. Sequential Circuits Registers, Counters, RAM

Lecture 17: Designing Sequential Systems Using Flip Flops

Logic Design II (17.342) Spring Lecture Outline

EE 209 Logic Cumulative Exam Name:

Analysis of Clocked Sequential Circuits

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI

10/12/2016. An FSM with No Inputs Moves from State to State. ECE 120: Introduction to Computing. Eventually, the States Form a Loop

Q: Examine the relationship between X and the Next state. How would you describe this circuit? A: An inverter which is synched with a clock signal.

Digital Fundamentals

CS/COE1541: Introduction to Computer Architecture. Logic Design Review. Sangyeun Cho. Computer Science Department University of Pittsburgh

EECS150 - Digital Design Lecture 11 - Shifters & Counters. Register Summary

Let s now begin to formalize our analysis of sequential machines Powerful methods for designing machines for System control Pattern recognition Etc.

SIR C.R.REDDY COLLEGE OF ENGINEERING ELURU DIGITAL INTEGRATED CIRCUITS (DIC) LABORATORY MANUAL III / IV B.E. (ECE) : I - SEMESTER

Exam for Physics 4051, October 31, 2008

Sequential vs. Combinational

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

EECS150 - Digital Design Lecture 25 Shifters and Counters. Recap

DE58/DC58 LOGIC DESIGN DEC 2014

Prove that if not fat and not triangle necessarily means not green then green must be fat or triangle (or both).

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

( c) Give logic symbol, Truth table and circuit diagram for a clocked SR flip-flop. A combinational circuit is defined by the function

Written reexam with solutions for IE1204/5 Digital Design Monday 14/

Logic design? Transistor as a switch. Layered design approach. CS/COE1541: Introduction to Computer Architecture. Logic Design Review.

ALU, Latches and Flip-Flops

CSE140: Digital Logic Design Registers and Counters

CPE100: Digital Logic Design I

WORKBOOK. Try Yourself Questions. Electrical Engineering Digital Electronics. Detailed Explanations of

Digital Electronics Sequential Logic

XI STANDARD [ COMPUTER SCIENCE ] 5 MARKS STUDY MATERIAL.

Lecture 10: Synchronous Sequential Circuits Design

CSE140: Components and Design Techniques for Digital Systems. Midterm Information. Instructor: Mohsen Imani. Sources: TSR, Katz, Boriello & Vahid

Digital Logic Design - Chapter 4

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

or 0101 Machine

Analysis of clocked sequential networks

King Fahd University of Petroleum and Minerals College of Computer Science and Engineering Computer Engineering Department

Time Allowed 3:00 hrs. April, pages

Learning Objectives:

Vidyalankar S.E. Sem. III [CMPN] Digital Logic Design and Analysis Prelim Question Paper Solution

Digital Logic and Design (Course Code: EE222) Lecture 19: Sequential Circuits Contd..

Philadelphia University Student Name: Student Number:

CDA 3200 Digital Systems. Instructor: Dr. Janusz Zalewski Developed by: Dr. Dahai Guo Spring 2012

CS/COE0447: Computer Organization

Chapter 14 Sequential logic, Latches and Flip-Flops

EECS Components and Design Techniques for Digital Systems. FSMs 9/11/2007

EE 209 Spiral 1 Exam Solutions Name:

Homework Assignment #1 Solutions EE 477 Spring 2017 Professor Parker

ALU A functional unit

Combinational Logic Design Combinational Functions and Circuits

Chapter 5 Synchronous Sequential Logic

ELCT201: DIGITAL LOGIC DESIGN

3. Complete the following table of equivalent values. Use binary numbers with a sign bit and 7 bits for the value

Transcription:

SE370 HW6 Solutions (Winter 2010) 1. L2e, 6.10 For this problem we are given a blank waveform with clock and input and asked to draw out the how different flip-flops and latches would behave. LK a) b) c) d) For (a) and (b), both are negative edge triggered which means that we can basically sample each negative edge of the clock. Those are the only locations that the waveform can change. For (c), a positive edge triggered flip-flop, we only sample at each positive edge and so that is the only time that the output can change. For (d), this is a latch so that means the output can change at any time changes while the clock is 1. 2. L2e, 6.17 For this problem we need to show how to implement a T flip-flop using just a flip-flop. The behavior of a T flip-flop is to toggle its output whenever the clock ticks and the input is 1. Therefore we get the following truth table to describe the behavior (let T be the input, be the current output, and + be the next output): T + 0 0 0 0 1 1 1 0 1 1 1 0 We can minimize this to show that + = T XR. Now if want to build this circuit out of a flipflop we can use the process we ve been using for building state machines. Let the flip-flop hold the current output (the state ). Then the next state can be described by the current state

and the inputs. n this case the logic is described by our equation. Now we have the state and combinational logic so we can realize the circuit: T 1 U1 FlipFlop LK 3. L2e, 6.25 We saw this example in class so will pretty much repeat what the professor said and try to expand on any points that might be of interest. Remember the basic problem is to take the 74194 (a universal 4-bit shift register) and then implement some additional logic on top of it. To begin we ll review what is in the 74194. t has a block diagram as follows: and are two bits that select the operation that the shifter performs. 00 = Hold, 01 = Shift Right, 10= Shift left, 11 = Load. LS is Left Shift n which is the value to shift into the right-most position if we do a shift left. Similarly RS is Right Shift n and gives the value to put in for a shift right. A are new inputs to store if the register is set to load. LK is the clock. LR clears the shift register. Finally, A- are the outputs of the registers. nternally, the shift register has the following circuit diagram:

where each block is a sub-circuit around a flip-flop: The MUX handles whether we are doing the hold, shift-right, shift-left, or load. With this basic building block we need to build a circuit with other types of shift operations. Namely, we need to implement: hold, circular shift right, circular shift left, logical shift right, logical shift left, arithmetic shift right, arithmetic shift left, and load. Load and hold seem pretty straight forward since our 194 has this built right in. Also notice that for all the other shifts, the only thing we really need to worry about is what to shift into the register when we do the shift. For circular shifts we take the value we are shifting out. For the logic shifts, we will be shifting in 0 s. For the arithmetic shifts left, we will be shifting in 0 s, but for shift-right we will shift in the previous value of that register (0 causes a 0 to shift in, 1 causes a 1). More generally, we want to build the following:

Many of the inputs can be connected directly up (-A, -A, and LK): So now we just need to figure out the logic from the outer inputs to the 194 inputs and we can use a truth table for this: uter nner peration LS RS s1 s0 LR 0 0 0 Hold X X 0 0 0 0 0 1 ircular shift right A X 1 0 0 0 1 0 ircular shift left X 0 1 0 0 1 1 Logical shift right 0 X 1 0 0 1 0 0 Logical shift left X 0 0 1 0 1 0 1 Arithmetic shift right X 1 0 0 1 1 0 Arithmetic shift left X 0 0 1 0 1 1 1 Parallel load X X 1 1 0 LR is always 0. s1 is just in the outer block. s0 can be minimized with a K-map: s0 0 1 1 1 0 0 1 0 This minimizes to: s0 = + + We got LS and RS by just looking at what the behavior should be for each of the operations. For hold and load we don t care. For shift lefts we don t care about LS and for right shifts we don t care about RS. For the logical shifts we always shift in 0 s. For the circular shifts we always shift from the opposite end (A for right shift, for left shift). Finally, for arithmetic shifts we either shift in a 0 for the left shift or the value of the high order bit for right shift. Now, how do we get logic for LS and RS. RS is easier, look at the first four rows when =0. We have three X s and let s assign all the X s to and now we see that when =0 then RS=. Similarly, looking at the bottom four rows we can set the X s to 0 and now when =1, RS=0. So we can choose between and 0 for the input to RS based on this is exactly what a MUX does! So we use a 2:1 MUX with as the select bit and for the and 0 for 1.

For LS, we need a 4:1 MUX based on and. Notice that row pairs 0/1, 2/3, 4/5, and 6/7 each have a don t care. Let s set the don t care to the other value in the pair: A/A, 0/0, /, X/X. Now we can choose between these four values based on and. Thus we use a 4:1 MUX with / as the input and A, 0,, and 0 as the inputs. Putting it all together now we get the following circuit: 1 A G N G N 1 1 1 2 3 2 1 A L S A A A R S 0 G N 1 L R universalshift LK G N 4. L2e, 7.5 This question is asking about a 4-bit Johnson counter. We need to go through the sequential circuit decision process and show that the resulting circuit is that same as the one in Figure 7.2. The first step is to draw out the state diagram for the counter: 0000 1000 1100 1110 0001 0011 0111 1111 nce we have the state diagram, we can go ahead and draw the state transition table/truth table:

urrent Next A A+ + + + 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 X X X X 0 0 1 1 0 0 0 1 0 1 0 0 X X X X 0 1 0 1 X X X X 0 1 1 0 X X X X 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 X X X X 1 0 1 0 X X X X 1 0 1 1 X X X X 1 1 0 0 1 1 1 0 1 1 0 1 X X X X 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 Now from this we can go ahead and minimize our next state logic using K-maps. A+ A 1 X 1 1 0 X X X 0 0 0 X X X 1 X + A 0 X 1 1 0 X X X 0 0 1 X X X 1 X + A 0 X 1 0 0 X X X 0 1 1 X X X 1 X + A 0 X 0 0 0 X X X 1 1 1 X X X 1 X Giving us the following minimized functions: A+ = + = A + = + = Now from this we can go ahead and implement the circuit using flip-flops and a tiny bit of logic:

A LK This is the same as Figure 7.2! 5. L2e, 7.6 n 7.5 we made some decisions about how to assign the don t cares and that led us to a simple circuit at the end. Let s see how these decisions for the don t care effect the state diagram. This time we will want to draw all 16 potential states that our counter could start out in. The first step is to take our truth table from 7.5, but we will take all the values that were don t cares and assigned them as we did in or K-maps. This gives the following truth table: urrent Next A A+ + + + 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 1 0 0 1 0 1 0 0 1 0 0 1 1 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 1 1 nce we have the truth table, we can create the state diagram. This is simply a matter of writing out each state and connecting them to the appropriate next state. Here is the result (with all the states laid out nicely):

0000 1000 1100 1110 0001 0011 0111 1111 0010 1001 0100 1010 0101 1011 0110 1101 We can see that this state diagram has two loops, the one we want and the one that would result if we started in an invalid state. Therefore, it is not self starting. To fix this, we need to break the loop, our only flexibility is in how we assigned the don t cares. To do this we need to look at the un-shaded rows in the truth table and change one of the 1 s to 0 s or vice versa so that the next state is a valid counter state. am going to choose the last un-shaded row 1101 0110. will change the first 0 to a 1, giving 1101 1110. Now have to recalculate the function for A+: A+ A 1 1 1 1 0 0 1 0 0 0 0 0 1 1 1 1 A+ = + A Giving us the following new self-starting state diagram:

A 0000 1000 1100 1110 0001 0011 0111 1111 0010 1001 0100 1010 0101 1011 0110 1101 And new self-starting circuit: LK 2 1 1 6. L2e, 7.9 A counter is just a binary counter that goes from 0-9 and then starts back around at 0 again. For this problem, it ends up that the book has almost the exact thing that we need. asically, we need a variation on Figure 7.21 ounter with limit. This counter works because when it reaches the limit value the LR goes active (0) and so the counter goes back to 0. We can do the same thing where we go back to 0, after the output in 9 (1 b1001). This gives the following circuit diagram.

LK V V G N hip163 P T R A A 3 2 1 A R V L o ad L R Notice that also added logic for the R output. This will go high when we are about to go back to 0, which is the exact behavior we want. We can now chain several counters together by noticing that the second counter we only want to increment when the first counter goes back to 0. The signal that enables our counter tick is T, and so if we hook up the T for the second counter to the R of the first, it second counter will only tick when R is high! Giving the following circuit: LK V V G N V hip163 P T R A A L o ad 3 2 1 A V LK G N hip163 P T R 3 2 1 2 2 2 A2 R L R A A V L o ad L R This design should generalize to more digits by chaining more of the circuits together. Note: t is also possible attach the R to the LK input of the next stage. The tradeoff being that using T allows each component to have the same synchronized clock. n the other hand, using LK lets you get rid of the enable input to your component. n general, clock inputs should only be used for the clock, not for signals! ut you may be forced to use the clock though if the component you are using doesn t have an enable input.