Exercises. 162 CHAPTER THREE Sequential Logic Design

Similar documents
Digital Logic & Computer Design CS Professor Dan Moldovan Spring Chapter 3 :: Sequential Logic Design

give sequence to events have memory (short-term) use feedback from output to input to store information

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

Flip-Flops and Sequential Circuit Design

Principles of Computer Architecture. Appendix A: Digital Logic

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Logic Design ( Part 3) Sequential Logic (Chapter 3)

YEDITEPE UNIVERSITY DEPARTMENT OF COMPUTER ENGINEERING. EXPERIMENT VIII: FLIP-FLOPS, COUNTERS 2014 Fall

Page 1. Some Definitions. Chapter 3: Sequential Logic. Sequential Logic. The Combinational Logic Unit. A NOR Gate with a Lumped Delay

RS flip-flop using NOR gate

Lecture 8: Sequential Logic

RS flip-flop using NOR gate

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

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

Computer Architecture and Organization

cascading flip-flops for proper operation clock skew Hardware description languages and sequential logic

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

Chapter 6. sequential logic design. This is the beginning of the second part of this course, sequential logic.

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

Chapter 5 Sequential Circuits

Introduction to Sequential Circuits

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

6. Sequential Logic Flip-Flops

`COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Fundamentals of Computer Systems

Chapter 5 Synchronous Sequential Logic

UNIT 11 LATCHES AND FLIP-FLOPS

COSC 243. Sequential Logic. COSC 243 (Computer Architecture) Lecture 5 - Sequential Logic 1

12/31/2010. Overview. 12-Latches and Flip Flops Text: Unit 11. Sequential Circuits. Sequential Circuits. Feedback. Feedback

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

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

Sequential logic. Circuits with feedback. How to control feedback? Sequential circuits. Timing methodologies. Basic registers

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Fundamentals of Computer Systems

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

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

Digital Fundamentals: A Systems Approach

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

CPS311 Lecture: Sequential Circuits

Asynchronous (Ripple) Counters

CSE115: Digital Design Lecture 23: Latches & Flip-Flops

Read-only memory (ROM) Digital logic: ALUs Sequential logic circuits. Don't cares. Bus

Chapter 5: Synchronous Sequential Logic

! Two inverters form a static memory cell " Will hold value as long as it has power applied

Sequential Logic. Sequential Circuits. ! Timing Methodologies " Cascading flip-flops for proper operation " Clock skew

ELCT201: DIGITAL LOGIC DESIGN

Software Engineering 2DA4. Slides 9: Asynchronous Sequential Circuits


EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

Introduction to Microprocessor & Digital Logic

DALHOUSIE UNIVERSITY Department of Electrical & Computer Engineering Digital Circuits - ECED 220. Experiment 4 - Latches and Flip-Flops

Logic Design. Flip Flops, Registers and Counters

Chapter 3 Unit Combinational

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Sequential Logic. Analysis and Synthesis. Joseph Cavahagh Santa Clara University. r & Francis. TaylonSi Francis Group. , Boca.Raton London New York \

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

Basis of sequential circuits: the R-S latch

LATCHES & FLIP-FLOP. Chapter 7

Switching Circuits & Logic Design

Chapter 3. Boolean Algebra and Digital Logic

Combinational vs Sequential

CHAPTER 4: Logic Circuits

Experiment 8 Introduction to Latches and Flip-Flops and registers

Finite State Machine Design

Last time, we saw how latches can be used as memory in a circuit

Digital System Design

ELE2120 Digital Circuits and Systems. Tutorial Note 8

ASYNCHRONOUS COUNTER CIRCUITS

1.b. Realize a 5-input NOR function using 2-input NOR gates only.

IT T35 Digital system desigm y - ii /s - iii

Sequential Circuits. Sequential Logic. Circuits with Feedback. Simplest Circuits with Feedback. Memory with Cross-coupled Gates.

COMP sequential logic 1 Jan. 25, 2016

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

Sri Vidya College of Engineering And Technology. Virudhunagar Department of Electrical and Electronics Engineering

Counters

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

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

2 Sequential Circuits

ALGORITHMS IN HW EECS150 ALGORITHMS IN HW. COMBINATIONAL vs. SEQUENTIAL. Sequential Circuits ALGORITHMS IN HW

Sequential Circuits: Latches & Flip-Flops

MC9211 Computer Organization

Lecture 11: Synchronous Sequential Logic

Chapter. Synchronous Sequential Circuits

Course Administration

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.

Switching Circuits & Logic Design

Slide Set 7. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

CHAPTER 6 COUNTERS & REGISTERS

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District DEPARTMENT OF INFORMATION TECHNOLOGY CS 2202 DIGITAL PRINCIPLES AND SYSTEM DESIGN

Chapter 5. Introduction

Chapter 4. Logic Design

Logic Design II (17.342) Spring Lecture Outline

Chapter 11 State Machine Design

ECE 263 Digital Systems, Fall 2015

CS 151 Final. Instructions: Student ID. (Last Name) (First Name) Signature

P U Q Q*

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: Sequential Circuits

Report on 4-bit Counter design Report- 1, 2. Report on D- Flipflop. Course project for ECE533

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

LAB #4 SEQUENTIAL LOGIC CIRCUIT

Transcription:

162 CHPTE THEE equential Logic Design Exercises Exercise 3.1 Given the input waveforms shown in Figure 3.61, sketch the output,, of an latch. Figure 3.61 Input waveforms of latch for Exercise 3.1 Exercise 3.2 Given the input waveforms shown in Figure 3.62, sketch the output,, of an latch. Figure 3.62 Input waveforms of latch for Exercise 3.2 Exercise 3.3 Given the input waveforms shown in Figure 3.63, sketch the output,, of a D latch. D Figure 3.63 Input waveforms of D latch or flip-flop for Exercises 3.3 and 3.5 Exercise 3.4 Given the input waveforms shown in Figure 3.64, sketch the output,, of a D latch. D Figure 3.64 Input waveforms of D latch or flip-flop for Exercises 3.4 and 3.6

Exercises 163 Exercise 3.5 Given the input waveforms shown in Figure 3.63, sketch the output,, of a D flip-flop. Exercise 3.6 Given the input waveforms shown in Figure 3.64, sketch the output,, of a D flip-flop. Exercise 3.7 Is the circuit in Figure 3.65 combinational logic or sequential logic? Explain in a simple fashion what the relationship is between the inputs and outputs. What would you call this circuit? Figure 3.65 Mystery circuit Exercise 3.8 Is the circuit in Figure 3.66 combinational logic or sequential logic? Explain in a simple fashion what the relationship is between the inputs and outputs. What would you call this circuit? Figure 3.66 Mystery circuit D Exercise 3.9 The toggle (T) flip-flop has one input,, and one output,. On each rising edge of, toggles to the complement of its previous value. Draw a schematic for a T flip-flop using a D flip-flop and an inverter. Exercise 3.10 JK flip-flop receives a clock and two inputs, J and K. On the rising edge of the clock, it updates the output,. IfJ and K are both 0, retains its old value. If only J is 1, becomes 1. If only K is 1, becomes 0. If both J and K are 1, becomes the opposite of its present state. Construct a JK flip-flop using a D flip-flop and some combinational logic. Construct a D flip-flop using a JK flip-flop and some combinational logic. Construct a T flip-flop (see Exercise 3.9) using a JK flip-flop.

164 CHPTE THEE equential Logic Design Exercise 3.11 The circuit in Figure 3.67 is called a Muller C-element. Explain in a simple fashion what the relationship is between the inputs and output. Figure 3.67 Muller C-element weak C Exercise 3.12 Design an asynchronously resettable D latch using logic gates. Exercise 3.13 Design an asynchronously resettable D flip-flop using logic gates. Exercise 3.14 Design a synchronously settable D flip-flop using logic gates. Exercise 3.15 Design an asynchronously settable D flip-flop using logic gates. Exercise 3.16 uppose a ring oscillator is built from N inverters connected in a loop. Each inverter has a minimum delay of t cd and a maximum delay of t pd.ifn is odd, determine the range of frequencies at which the oscillator might operate. Exercise 3.17 Why must N be odd in Exercise 3.16? Exercise 3.18 Which of the circuits in Figure 3.68 are synchronous sequential circuits? Explain. Figure 3.68 Circuits (d) Exercise 3.19 You are designing an elevator controller for a building with 25 floors. The controller has two inputs: UP and DOWN. It produces an output indicating the floor that the elevator is on. There is no floor 13. What is the minimum number of bits of state in the controller?

Exercises 165 Exercise 3.20 You are designing an FM to keep track of the mood of four students working in the digital design lab. Each student s mood is either HPPY (the circuit works), D (the circuit blew up), UY (working on the circuit), CLUELE (confused about the circuit), or LEEP (face down on the circuit board). How many states does the FM have? What is the minimum number of bits necessary to represent these states? Exercise 3.21 How would you factor the FM from Exercise 3.20 into multiple simpler machines? How many states does each simpler machine have? What is the minimum total number of bits necessary in this factored design? Exercise 3.22 Describe in words what the state machine in Figure 3.69 does. Using binary state encodings, complete a state transition table and output table for the FM. Write oolean equations for the next state and output and sketch a schematic of the FM. eset 0 : 0 1 : 0 2 : 1 Figure 3.69 tate transition diagram Exercise 3.23 Describe in words what the state machine in Figure 3.70 does. Using binary state encodings, complete a state transition table and output table for the FM. Write oolean equations for the next state and output and sketch a schematic of the FM. eset /0 /0 0 1 2 /0 /1 /0 + /0 Figure 3.70 tate transition diagram Exercise 3.24 ccidents are still occurring at the intersection of cademic venue and ravado oulevard. The football team is rushing into the intersection the moment light turns green. They are colliding with sleep-deprived C majors who stagger into the intersection just before light turns red. Extend the traffic

166 CHPTE THEE equential Logic Design light controller from ection 3.4.1 so that both lights are red for 5 seconds before either light turns green again. ketch your improved Moore machine state transition diagram, state encodings, state transition table, output table, next state and output equations, and your FM schematic. Exercise 3.25 lyssa P. Hacker s snail from ection 3.4.3 has a daughter with a Mealy machine FM brain. The daughter snail smiles whenever she slides over the pattern 1101 or the pattern 1110. ketch the state transition diagram for this happy snail using as few states as possible. Choose state encodings and write a combined state transition and output table using your encodings. Write the next state and output equations and sketch your FM schematic. Exercise 3.26 You have been enlisted to design a soda machine dispenser for your department lounge. odas are partially subsidized by the student chapter of the IEEE, so they cost only 25 cents. The machine accepts nickels, dimes, and quarters. When enough coins have been inserted, it dispenses the soda and returns any necessary change. Design an FM controller for the soda machine. The FM inputs are Nickel, Dime, and uarter, indicating which coin was inserted. ssume that exactly one coin is inserted on each cycle. The outputs are Dispense, eturnnickel, eturndime, and eturntwodimes. When the FM reaches 25 cents, it asserts Dispense and the necessary eturn outputs required to deliver the appropriate change. Then it should be ready to start accepting coins for another soda. Exercise 3.27 Gray codes have a useful property in that consecutive numbers differ in only a single bit position. Table 3.23 lists a 3-bit Gray code representing the numbers 0 to 7. Design a 3-bit modulo 8 Gray code counter FM with no inputs and three outputs. ( modulo N counter counts from 0 to N 1, then Table 3.23 3-bit Gray code Number Gray code 0 0 0 0 1 0 0 1 2 0 1 1 3 0 1 0 4 1 1 0 5 1 1 1 6 1 0 1 7 1 0 0

Exercises 167 repeats. For example, a watch uses a modulo 60 counter for the minutes and seconds that counts from 0 to 59.) When reset, the output should be 000. On each clock edge, the output should advance to the next Gray code. fter reaching 100, it should repeat with 000. Exercise 3.28 Extend your modulo 8 Gray code counter from Exercise 3.27 to be an UP/DOWN counter by adding an UP input. If UP = 1, the counter advances to the next number. If UP = 0, the counter retreats to the previous number. Exercise 3.29 Your company, Detect-o-rama, would like to design an FM that takes two inputs, and, and generates one output, Z. The output in cycle n, Z n, is either the oolean ND or O of the corresponding input n and the previous input n-1, depending on the other input, n : Z n = n n 1 if n = 0 Z n = n + n 1 if n = 1 ketch the waveform for Z given the inputs shown in Figure 3.71. Is this FM a Moore or a Mealy machine? Design the FM. how your state transition diagram, encoded state transition table, next state and output equations, and schematic. Figure 3.71 FM input waveforms Exercise 3.30 Design an FM with one input,, and two outputs, X and Y. X should be 1 if has been 1 for at least three cycles altogether (not necessarily consecutively). Y should be 1 if has been 1 for at least two consecutive cycles. how your state transition diagram, encoded state transition table, next state and output equations, and schematic. Exercise 3.31 nalyze the FM shown in Figure 3.72. Write the state transition and output tables and sketch the state transition diagram. Describe in words what the FM does.

168 CHPTE THEE equential Logic Design X Figure 3.72 FM schematic Exercise 3.32 epeat Exercise 3.31 for the FM shown in Figure 3.73. ecall that the s and r register inputs indicate set and reset, respectively. Figure 3.73 FM schematic reset s r r Exercise 3.33 en itdiddle has designed the circuit in Figure 3.74 to compute a registered four-input XO function. Each two-input XO gate has a propagation delay of 100 ps and a contamination delay of 55 ps. Each flip-flop has a setup time of 60 ps, a hold time of 20 ps, a clock-to- maximum delay of 70 ps, and a clock-to- minimum delay of 50 ps. (d) If there is no clock skew, what is the maximum operating frequency of the circuit? How much clock skew can the circuit tolerate if it must operate at 2 GHz? How much clock skew can the circuit tolerate before it might experience a hold time violation? lyssa P. Hacker points out that she can redesign the combinational logic between the registers to be faster and tolerate more clock skew. Her improved circuit also uses three two-input XOs, but they are arranged differently. What is her circuit? What is its maximum frequency if there is no clock skew? How much clock skew can the circuit tolerate before it might experience a hold time violation? Figure 3.74 egistered four-input XO circuit

Exercises 169 Exercise 3.34 You are designing an adder for the blindingly fast 2-bit epentium Processor. The adder is built from two full adders such that the carry out of the first adder is the carry in to the second adder, as shown in Figure 3.75. Your adder has input and output registers and must complete the addition in one clock cycle. Each full adder has the following propagation delays: 20 ps from C in to C out or to um (), 25 ps from or to C out, and 30 ps from or to. The adder has a contamination delay of 15 ps from C in to either output and 22 ps from or to either output. Each flip-flop has a setup time of 30 ps, a hold time of 10 ps, a clockto- propagation delay of 35 ps, and a clock-to- contamination delay of 21 ps. If there is no clock skew, what is the maximum operating frequency of the circuit? How much clock skew can the circuit tolerate if it must operate at 8 GHz? How much clock skew can the circuit tolerate before it might experience a hold time violation? C 0 C in C out 0 0 Figure 3.75 2-bit adder schematic 1 C in 1 1 Cout Exercise 3.35 field programmable gate array (FPG) uses configurable logic blocks (CLs) rather than logic gates to implement combinational logic. The Xilinx partan 3 FPG has propagation and contamination delays of 0.61 and 0.30 ns, respectively, for each CL. It also contains flip-flops with propagation and contamination delays of 0.72 and 0.50 ns, and setup and hold times of 0.53 and 0 ns, respectively. If you are building a system that needs to run at 40 MHz, how many consecutive CLs can you use between two flip-flops? ssume there is no clock skew and no delay through wires between CLs. uppose that all paths between flip-flops pass through at least one CL. How much clock skew can the FPG have without violating the hold time? Exercise 3.36 synchronizer is built from a pair of flip-flops with t setup = 50 ps, T 0 = 20 ps, and τ = 30 ps. It samples an asynchronous input that changes 10 8 times per second. What is the minimum clock period of the synchronizer to achieve a mean time between failures (MTF) of 100 years?

170 CHPTE THEE equential Logic Design Exercise 3.37 You would like to build a synchronizer that can receive asynchronous inputs with an MTF of 50 years. Your system is running at 1 GHz, and you use sampling flip-flops with τ = 100 ps, T 0 = 110 ps, and t setup = 70 ps. The synchronizer receives a new asynchronous input on average 0.5 times per second (i.e., once every 2 seconds). What is the required probability of failure to satisfy this MTF? How many clock cycles would you have to wait before reading the sampled input signal to give that probability of error? Exercise 3.38 You are walking down the hallway when you run into your lab partner walking in the other direction. The two of you first step one way and are still in each other s way. Then you both step the other way and are still in each other s way. Then you both wait a bit, hoping the other person will step aside. You can model this situation as a metastable point and apply the same theory that has been applied to synchronizers and flip-flops. uppose you create a mathematical model for yourself and your lab partner. You start the unfortunate encounter in the metastable state. The probability that you remain in this state after t seconds is e t τ: τ indicates your response rate; today, your brain has been blurred by lack of sleep and has τ = 20 seconds. How long will it be until you have 99% certainty that you will have resolved from metastability (i.e., figured out how to pass one another)? You are not only sleepy, but also ravenously hungry. In fact, you will starve to death if you don t get going to the cafeteria within 3 minutes. What is the probability that your lab partner will have to drag you to the morgue? Exercise 3.39 You have built a synchronizer using flip-flops with T 0 = 20 ps and τ = 30 ps. Your boss tells you that you need to increase the MTF by a factor of 10. y how much do you need to increase the clock period? Exercise 3.40 en itdiddle invents a new and improved synchronizer in Figure 3.76 that he claims eliminates metastability in a single cycle. He explains that the circuit in box M is an analog metastability detector that produces a HIGH output if the input voltage is in the forbidden zone between V IL and V IH. The metastability detector checks to determine whether the first flip-flop has produced a metastable output on D2. If so, it asynchronously resets the flip-flop to produce a good 0 at D2. The second flip-flop then samples D2, always producing a valid logic level on. lyssa P. Hacker tells en that there must be a bug in the circuit, because eliminating metastability is just as impossible as building a perpetual motion machine. Who is right? Explain, showing en s error or showing why lyssa is wrong. Figure 3.76 New and improved synchronizer D r D2 M