Practice Homework Solution for Module 3

Similar documents
Practice Homework Problems for Module 3

P U Q Q*

P U Q Q*

Note that none of the above MAY be a VALID ANSWER.

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 1 1 Stop bits. 11-bit Serial Data format

Advanced Digital Logic Design EECS 303

INTRODUCTION TO SEQUENTIAL CIRCUITS

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

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.

Flip-Flops and Sequential Circuit Design

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Asynchronous (Ripple) Counters

Introduction to Sequential Circuits

Combinational vs Sequential

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

Lecture 8: Sequential Logic

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

Chapter 5: Synchronous Sequential Logic

D Latch (Transparent Latch)

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

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

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

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

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Review of digital electronics. Storage units Sequential circuits Counters Shifters

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

EE 121 June 4, 2002 Digital Design Laboratory Handout #34 CLK

MC9211 Computer Organization

Logic Design II (17.342) Spring Lecture Outline

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

Department of Electrical and Computer Engineering Mid-Term Examination Winter 2012

Finite State Machine Design

Sequential Logic Circuits

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

Course Administration

Unit 11. Latches and Flip-Flops

Digital Fundamentals: A Systems Approach

3 Flip-Flops. The latch is a logic block that has 2 stable states (0) or (1). The RS latch can be forced to hold a 1 when the Set line is asserted.

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

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

SEQUENTIAL LOGIC. Satish Chandra Assistant Professor Department of Physics P P N College, Kanpur

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

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

Switching Theory And Logic Design UNIT-IV SEQUENTIAL LOGIC CIRCUITS

PRE J. Figure 25.1a J-K flip-flop with Asynchronous Preset and Clear inputs

Chapter 5 Synchronous Sequential Logic

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

TMEL53, DIGITALTEKNIK. INTRODUCTION TO SYNCHRONOUS CIRCUITS, FLIP-FLOPS and COUNTERS

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

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

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

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

ASYNCHRONOUS COUNTER CIRCUITS

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Digital Fundamentals

EECS 270 Group Homework 4 Due Friday. June half credit if turned in by June

FPGA Implementation of Sequential Logic

ECE 263 Digital Systems, Fall 2015

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

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

Sequential Design Basics

Combinational / Sequential Logic

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

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

Two types of state machine as classified by output formation

Chapter 11 Latches and Flip-Flops

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

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science SOLUTIONS

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Chapter 2. Digital Circuits

CprE 281: Digital Logic

CPS311 Lecture: Sequential Circuits

Chapter 3. Boolean Algebra and Digital Logic

EKT 121/4 ELEKTRONIK DIGIT 1

Introduction to Microprocessor & Digital Logic

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

Sequencing. Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Fall,

Counter dan Register

PGT104 Digital Electronics. PGT104 Digital Electronics

Unit 9 Latches and Flip-Flops. Dept. of Electrical and Computer Eng., NCTU 1

Vignana Bharathi Institute of Technology UNIT 4 DLD

CHAPTER 4: Logic Circuits

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

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

CHAPTER 4: Logic Circuits

Chapter 5. Introduction

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

EEE2135 Digital Logic Design Chapter 6. Latches/Flip-Flops and Registers/Counters 서강대학교 전자공학과

EE292: Fundamentals of ECE

UNIVERSITI TEKNOLOGI MALAYSIA

EE 109 Homework 6 State Machine Design Name: Score:

EECS 270 Final Exam Spring 2012

More design examples, state assignment and reduction. Page 1

Serial In/Serial Left/Serial Out Operation

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

Digital Fundamentals: A Systems Approach

UNIT IV. Sequential circuit

ELCT201: DIGITAL LOGIC DESIGN

Transcription:

Practice Homework Solution for Module 3. Given the following state transition diagram, complete the timing chart below. d d dd d X Y A B d A B X Y MODULE 3 PRACTICE HOMEWORK SOLUTION Page

2. Given the following state transition diagram, determine the next state equations it represents in minimum sum-of-products form. d d dd X Y A B d d X Y A B X* Y* X* and Y* are shorthand for the next state of X and Y X X X X B B A A B B A A B B Y Y Y Y Y Y X* = X Y + X Y + A Y* = A X Y + B X Y + A B X + A B X Y MODULE 3 PRACTICE HOMEWORK SOLUTION Page 2

3. Given the timing diagram, below, for a state machine that has one input (EN) and two state variables (Q and Q), derive a state transition diagram: CLK Q Q EN EN Q Q MODULE 3 PRACTICE HOMEWORK SOLUTION Page 3

4. Given the following state transition diagram, determine: A XY (a) The next state equation for X if the state machine is designed for minimum cost X* = A Y (b) The next state equation for X if the state machine is designed for minimum risk X* = A Y (c) The next state equation for Y if the state machine is designed for minimum cost Y* = A + Y (d) The next state equation for Y if the state machine is designed for minimum risk Y* = A X + Y 5. A new type of flip-flop, the RG ( Raul Good ), is described by the following PS-NS table. Derive its next state equation and excitation table. R G Q Q* Q* = R Q + G Q Excitation table: Q Q* R G d d d d MODULE 3 PRACTICE HOMEWORK SOLUTION Page 4

6. Given the following timing chart for an edge-triggered D flip-flop, determine the following based on the excitation signals (D and CLK) depicted: D 5 ns CLK Q Q_L (a) The nominal setup time provided for the D flip-flop ns (b) The nominal hold time provided for the D flip-flop 5 ns (c) The nominal clock pulse width provided for the D flip-flop 5 ns (d) The t PHL(C Q) of the D flip-flop 5 ns (e) The t PLH(C Q) of the D flip-flop ns MODULE 3 PRACTICE HOMEWORK SOLUTION Page 5

7. Complete the timing chart, below, for a D latch, and answer the questions that follow. Assume each gate has 5 ns of delay (t PLH and t PHL ), and that each division is 5 ns. D 2 DN C 2 2 3 3 2 3 X 2 3 XN Q QN D DN C X XN Q QN (a) Determine the minimum time input C should be asserted (while the D input remains stable) to ensure reliable operation of the latch. ns (b) Determine the nominal setup time provided for the D latch. 2 ns (c) Determine the nominal hold time provided for the D latch. 3 ns (d) Determine the t PLH(C Q) of the D latch. ns (e) Determine the t PHL(D Q) of the D latch. 2 ns MODULE 3 PRACTICE HOMEWORK SOLUTION Page 6

8. Implement a dorm-room alarm that accommodates eight sensor inputs, labeled S through S7, plus an ARM/DISARM pushbutton than can be used to toggle the state of the alarm system (a GREEN LED should be illuminated if the system is armed, and a YELLOW LED should be illuminated if the system is disarmed). If any sensors are asserted while the alarm is armed, the number of the highest sensor input asserted should be displayed on a 7-segment LED and a RED LED (that indicates the alarm has been tripped) should start blinking (at a Hz rate, based on a clock signal provided by the function generator). The RED LED should stop blinking when the alarm is disarmed, and the 7-segment display should be blank (the 7-segment display should also be blank if the alarm is armed and none of the sensor inputs are asserted). Draw a Moore model for the arm/disarm state machine, and a separate Moore model for the alarm tripped state machine. Create an ABEL source file for your design, with all inputs and outputs clearly defined. Create the following: a. Moore model of arm/disarm state machine b. Moore model of alarm tripped state machine c. ABEL source file listing Digital Dorm Alarm S7 S6 S5 S4 S3 S2 S S Armed Disarmed Alarm Tripped Hz Clock Highest Number Active Sensor Arm/Disarm PB The DDA (Digital Dorm Alarm) in action. The GREEN LED indicates the alarm is in the armed state, the blinking RED LED indicates the alarm has been tripped, and the 7-segment display indicates the highest number sensor that is active. The Arm/Disarm pushbutton toggles the alarm between the armed and disarmed states. The 7-segment display is blank if the alarm is disarmed or, if armed, none of the sensor inputs are asserted. MODULE 3 PRACTICE HOMEWORK SOLUTION Page 7

The arm/disarm state machine can be realized with a single flip-flop (configured as a T ); note that it is clocked by the arm/disarm bounceless switch (this state machine has no inputs): X D A X is state variable D is disarmed (yellow) LED A is armed (green) LED Note no input variables The alarm tripped state machine can also be realized with a single flip-flop (configured as a T ); it has a single input (STROBE) from the priority encoder and it is clocked by the (external) Hz clock: STROBE d Y T Y is state variable T is tripped (red) LED STROBE is input variable MODULE 3 PRACTICE HOMEWORK SOLUTION Page 8

MODULE dormalm TITLE 'Digital Dorm Alarm with 7-segment Display' DECLARATIONS " Note all LED outputs are active low (current sinking configuration) ACLOCK pin; " arm/disarm bounceless switch clock input (need explicit pin assignment) TCLOCK pin; " tripped Hz (external) clock input (need explicit pin assignment) S..S7 pin; " sensor inputs!tripped pin istype 'reg'; " TRIPPED ff/output indicator!armed pin istype 'reg'; " ARMED ff/output indicator (also input to priority encoder)!disarmed pin istype 'com'; " DISARMED is just the complement of ARMED STROBE pin istype 'com'; " STROBE output of encoder - used to enable TRIPPED state machine!la,!lb,!lc,!ld,!le,!lf,!lg pin istype 'com'; " 7-segment display outputs d =.X.; " short hand for don't care TRUTH_TABLE ([ARMED,S7, S6, S5, S4, S3, S2, S, S] -> [STROBE, LA, LB, LC, LD, LE, LF, LG]) [, d, d, d, d, d, d, d, d] -> [,,,,,,, ]; " off [,,,,,,,, ] -> [,,,,,,, ]; " off [,,,,,,,, ] -> [,,,,,,, ]; " [,,,,,,,, d] -> [,,,,,,, ]; " [,,,,,,, d, d] -> [,,,,,,, ]; " 2 [,,,,,, d, d, d] -> [,,,,,,, ]; " 3 [,,,,, d, d, d, d] -> [,,,,,,, ]; " 4 [,,,, d, d, d, d, d] -> [,,,,,,, ]; " 5 [,,, d, d, d, d, d, d] -> [,,,,,,, ]; " 6 [,, d, d, d, d, d, d, d] -> [,,,,,,, ]; " 7 EQUATIONS DISARMED =!ARMED; ARMED :=!ARMED; ARMED.CLK = ACLOCK; TRIPPED :=!TRIPPED & STROBE; TRIPPED.CLK = TCLOCK; END MODULE 3 PRACTICE HOMEWORK SOLUTION Page 9

9. Given the following state transition diagram, determine: (a) Assuming the state machine depicted is initialized to state, determine the output sequence generated by the input sequence (b) Determine the embedded binary sequence recognized by this state machine. Inspired by the (ancient) Beach Boys hit single, Fun Fun Fun, you wish to implement a T-Bird Tail Light Turn Signal Controller (TBTLTSC) hoping, at long last, you ve found something that your friends can actually relate to (maybe not the Beach Boys, though ). Here, each tail light will consist of three LEDs, which will be illuminated in a building dot mode to indicate the turn direction (either left or right, selected by a DIP switch). An emergency flash mode (in which all the tail lights alternate between the on and off states) will be controlled by a second DIP switch. The overall taillight enable will be controlled by a third DIP switch; if disabled (EN=), all LEDs should be off. Create the following: a. Mealy model of state machine b. ABEL source file listing T-Bird Tail Light Turn Signal Controller L2 L L Left Signal Left Right Flash Norm On ff R R R2 DIR EMERG ENABL Right Signal Hz Clock The TBTLTSC taking a left turn, for which the output sequence should be: (a) L, (b) L and L, (c) L, L, and L2, (d) all off. This sequence should continuously repeat as long as the enable signal is asserted (ENABL=). If the emergency flash mode is selected, the six lights should alternate between the all on and all off states (DIR is ignored). When disabled (ENABL=), all LEDs should be off. MODULE 3 PRACTICE HOMEWORK SOLUTION Page

Assume switch in down position =, up position = Mealy model can be realized with 4 states that has 3 inputs, 6 outputs, and 2 state variables (many solution variants possible Moore model would require more flip-flops but would be conceptually simpler) note the simplification exploited here that a newly selected sequence does not necessarily have to start at its beginning T-Bird Tail Light Turn Signal Controller L2 L L Left Right Flash Norm On ff R R R2 Left Signal DIR EMERG ENABL Right Signal Hz Clock DIR EMERG ENABL L2 L L R R R2 Q Q d d d d d d d d d MODULE 3 PRACTICE HOMEWORK SOLUTION Page

MODULE TBTLTSC TITLE 'T-Bird Tail Light Turn Signal Controller - Mealy Model' DECLARATIONS Q..Q pin istype 'reg'; L2..L pin istype 'com'; R2..R pin istype 'com'; DIR, EMERG, ENABL pin; CLOCK pin; TRUTH_TABLE ([Q,Q,DIR,EMERG,ENABL] :> [Q,Q]) [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; [,,,, ] :> [, ]; Q.D = ( ENABL &!EMERG &!Q.PIN & Q.PIN # ENABL &!EMERG & Q.PIN &!Q.PIN # ENABL & EMERG &!Q.PIN &!Q.PIN ); " ISTYPE 'INVERT' Q.C = ( CLOCK ); Q.D = ( ENABL &!EMERG &!Q.PIN # ENABL &!Q.PIN &!Q.PIN ); " ISTYPE 'INVERT' Q.C = ( CLOCK ); L2 L L R R R2 = ( EMERG & Q.PIN & Q.PIN # ENABL & DIR & Q.PIN & Q.PIN ); = ( ENABL &!EMERG & DIR & Q.PIN # EMERG & Q.PIN & Q.PIN ); = ( ENABL &!EMERG & DIR & Q.PIN # ENABL &!EMERG & DIR & Q.PIN # EMERG & Q.PIN & Q.PIN ); = ( ENABL &!EMERG &!DIR & Q.PIN # ENABL &!EMERG &!DIR & Q.PIN # EMERG & Q.PIN & Q.PIN ); = ( ENABL &!EMERG &!DIR & Q.PIN # EMERG & Q.PIN & Q.PIN ); = ( EMERG & Q.PIN & Q.PIN # ENABL &!DIR & Q.PIN & Q.PIN ); TRUTH_TABLE ([Q,Q,DIR,EMERG,ENABL] -> [L2,L,L,R,R,R2]) [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; EQUATIONS [Q..Q].CLK = CLOCK; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; [,,,, ] -> [,,,,, ]; END MODULE 3 PRACTICE HOMEWORK SOLUTION Page 2

. Design a 3-bit, self-correcting RING counter with glitch-free decoded outputs. Draw a state transition diagram to prove your design is self-correcting. NOTE: The initial state should be, and the counter should SHIFT LEFT. Create the following: a. Moore model of state machine, clearly showing the self-correcting mechanism b. ABEL source file listing RING sequence SELF-CORRECTING sequence MODULE ring_cnt TITLE 'Self-Correcting 3-bit RING Counter' DECLARATIONS CLOCK pin; R2..R pin istype 'reg'; EQUATIONS R2 := R; R := R; R :=!(R # R); [R..R2].CLK = CLOCK; END NOTE: The flip-flop outputs [R..R2] are the glitch-free decoded outputs of interest. By definition, NOTHING needs to be done to decode them! The SELF-CORRECTING mechanism is of most interest in this problem make sure that the feedback for self-correction specified in the ABEL file matches the one indicated in the state transition diagram MODULE 3 PRACTICE HOMEWORK SOLUTION Page 3