Preparation of Examination Questions and Exercises: Solutions

Similar documents
LOGIC CIRCUITS. Basic Experiment and Design of Electronics

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Department of Electrical Engineering and Computer Sciences

Digital Control of Electric Drives

LOGIC CIRCUITS. Basic Experiment and Design of Electronics. Ho Kyung Kim, Ph.D.

CHW 261: Logic Design

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

Digital Circuits ECS 371

Sequential Logic Circuits

MAHARASHTRA STATE BOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC Certified) State any two Boolean laws. (Any 2 laws 1 mark each)

UMBC. At the system level, DFT includes boundary scan and analog test bus. The DFT techniques discussed focus on improving testability of SAFs.

CPE100: Digital Logic Design I

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

Lab 3 Revisited. Zener diodes IAP 2008 Lecture 4 1

Unit 16 Problem Solutions

S.Y. Diploma : Sem. III [CO/CM/IF/CD/CW] Digital Techniques

ALU, Latches and Flip-Flops

Different encodings generate different circuits

Chapter 4. Sequential Logic Circuits

Digital Electronics Circuits 2017

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

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

7 Multipliers and their VHDL representation

CprE 281: Digital Logic

Sequential vs. Combinational

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

Chapter 9. Counters and Shift Registers. Counters and Shift Registers

EECS150 - Digital Design Lecture 18 - Counters

EECS150 - Digital Design Lecture 18 - Counters

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

S.Y. Diploma : Sem. III [DE/ED/EI/EJ/EN/ET/EV/EX/IC/IE/IS/IU/MU] Principles of Digital Techniques

EECS150 - Digital Design Lecture 23 - FSMs & Counters

COEN 312 DIGITAL SYSTEMS DESIGN - LECTURE NOTES Concordia University

Synchronous Sequential Circuit

Synchronous Sequential Circuit Design. Digital Computer Design

EECS150 - Digital Design Lecture 17 - Sequential Circuits 3 (Counters)

Digital Fundamentals

Appendix A: Digital Logic. Principles of Computer Architecture. Principles of Computer Architecture by M. Murdocca and V. Heuring

Adders, subtractors comparators, multipliers and other ALU elements

Lecture 7: Logic design. Combinational logic circuits

ELEN Electronique numérique

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec09 Counters Outline.

CPE100: Digital Logic Design I

Review: Designing with FSM. EECS Components and Design Techniques for Digital Systems. Lec 09 Counters Outline.

DE58/DC58 LOGIC DESIGN DEC 2014

Adders allow computers to add numbers 2-bit ripple-carry adder

PGT104 Digital Electronics. PGT104 Digital Electronics

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

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

Topic 8: Sequential Circuits

Design of Sequential Circuits

EXPERIMENT Bit Binary Sequential Multiplier

Topics. CMOS Design Multi-input delay analysis. John A. Chandy Dept. of Electrical and Computer Engineering University of Connecticut

EE 209 Logic Cumulative Exam Name:

Sample Test Paper - I

Chapter 5. Digital systems. 5.1 Boolean algebra Negation, conjunction and disjunction

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


Chapter 7 Sequential Logic

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

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

Ch 7. Finite State Machines. VII - Finite State Machines Contemporary Logic Design 1

Digital Design. Sequential Logic

Written exam with solutions IE Digital Design Friday 21/

COE 328 Final Exam 2008

University of Toronto Faculty of Applied Science and Engineering Edward S. Rogers Sr. Department of Electrical and Computer Engineering

Philadelphia University Student Name: Student Number:

ENGG 1203 Tutorial _03 Laboratory 3 Build a ball counter. Lab 3. Lab 3 Gate Timing. Lab 3 Steps in designing a State Machine. Timing diagram of a DFF

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

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

Sequential Circuits. Circuits with state. Silvina Hanono Wachman Computer Science & Artificial Intelligence Lab M.I.T. L06-1

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

Design of Datapath Controllers

State Machines ELCTEC-131

CPS 104 Computer Organization and Programming Lecture 11: Gates, Buses, Latches. Robert Wagner

Finite State Machine (FSM)

DIGITAL LOGIC CIRCUITS

ELCT201: DIGITAL LOGIC DESIGN

Adders, subtractors comparators, multipliers and other ALU elements

Digital Fundamentals

ECE 448 Lecture 6. Finite State Machines. State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code. George Mason University

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

ECE 341. Lecture # 3

Stop Watch (System Controller Approach)

Digital Electronics Sequential Logic

Review for B33DV2-Digital Design. Digital Design

Programmable Logic Devices II

EECS150 - Digital Design Lecture 16 Counters. Announcements

EEE2135 Digital Logic Design

ELCT201: DIGITAL LOGIC DESIGN

Spiral 2-1. Datapath Components: Counters Adders Design Example: Crosswalk Controller

Models for representing sequential circuits

Written exam with solutions IE1204/5 Digital Design Monday 23/

CprE 281: Digital Logic

CS221: Digital Design. Dr. A. Sahu. Indian Institute of Technology Guwahati

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

Unit II Chapter 4:- Digital Logic Contents 4.1 Introduction... 4

Assignment # 3 - CSI 2111(Solutions)

RAO PAHALD SINGH GROUP OF INSTITUTIONS BALANA(MOHINDER GARH)123029

COMBINATIONAL LOGIC FUNCTIONS

L4: Sequential Building Blocks (Flip-flops, Latches and Registers)

Transcription:

Questions Preparation of Examination Questions and Exercises: Solutions. -bit Subtraction: DIF = B - BI B BI BO DIF 2 DIF: B BI 4 6 BI 5 BO: BI BI 4 5 7 3 2 6 7 3 B B B B B DIF = B BI ; B = ( B) BI ( B), shared term ( B) 2. 4 to Multiplexer Chapter., page : The multiplexer will be enabled with ( E) =, so that EN =. The Boolean expression with 4 minterms will contain ( E) as enable signal. 3. Decoder Compare chapter.2, page : here only one enable input, 2 input lines and 4 high active outputs. 4. Priority Encoder Compare chapter.3, page : NY = I I I2 I3 5. Bus Implementation Compare with black board writing concerning end of chapter 2.2 (figure 2., 2.2). If a decoder output is selected (Di = ) then the connected tristate driver (BUFT) will be enabled and Ii is connected directly to the bus Y. ll other tristate drivers are disabled and there outputs are set to the high impedance state (third state). Therefore no conflict will arise between Ii sources. This behaviour can be modelled with VHDL by assigning the value Z to a signal which now may have several drivers but only one is active. This value is available by use of type std_logic/std_logic_vector. If you work with schematic entry you will have to check whether the available tristate driver elements are enabled with an high or low active control input T. S S Y I I I2 I3 E-P

6. Latch: RS-NND I I Y + Y + State Y Y Irregular Reset Set Hold 7. D-latch and D-flip-flop Compare chapter 5. /5.3 During the high level of a clock cycle the gate of a D-latch is enabled. This state of transparency means that input signal changes will be propagated directly to the output. D-flip-flop is edge sensitive so that no state of transparency will occur. The sampling interval t samp and especially the hold time t h is more than ten times smaller than the propagation delay t p from clock edge to D-flip-flop output (t h << t p ). If an output change appears the clock gate is closed for a long time in comparison to the hold time t h and the signal feed back itself will have no influence on its own cause. Therefore oscillating behaviour will be avoided. 8. Moore Finite state machine model block diagram. Compare chapter 4.4. With a Moore FSM the external inputs have no direct effect on the output signals. 9. Simple 2-bit down counter: modulo-4 Q Q Q + Q + RCO Next State Forming Logic Present State Feedback Q + Present State Register CLK Q preset Output Forming Logic RCO State RCO preset 3 2 E-P 2

. D-flip-flop VHDL template Compare chapter 5.3 D_FF: process(clk, PRE) -- asynchronous inputs are dominant over clock begin if PRE ='' then -- asynchronous set, dominant Q <= '' after ns; elsif (CLK'event and CLK ='') then-- rising edge tiggering if EN = '' then Q <= DT after ns; end if;-- else branch is not necessary because of D-FF behaviour end if; end process D_FF;. 2-bit modulo-3 counter VHDL code Compare chapter 5. signal QINT: BIT_VECTOR( downto ); begin SYN_COUNT:process (CLK) -- signals with priority begin if CLK='' and CLK'event then case QINT is -- state/next state representation when "" => QINT <= "" after ns; when "" => QINT <= "" after ns; when "" => QINT <= "" after ns; when others => QINT <= "" after ns;-- save counter end case; end if; end process SYN_COUNT; QOUT <= QINT; Exercises. Code converter Compare chapters 2.4 and.4. The left hand side is a copy of table 2.2 with two s complement: C(z) = (z4, z3, z2, z). The second half of the right hand side is calculated with z * = (R m ) C(z) + and z * = (S, a3, a2, a). a = z (LSB) a2 = (z2 z4) ( z z2) (z z2 z4) a3 = (z3 z4) ( z3 z4) ( z z2 z3) S = z4 (MSB) Dec z4 z3 z2 z S a3 a2 a No. 2 2 3 3 4 4 5 5 6 6 7 7 5-4 -2 3-3 2-4 -5-6 9-7 8 X X X X -8 E-P 3

2. Controlled adder/subtractor S = : addition ( + B + CI) ; S = subtraction (B CI) S/D = CI B f(s) C/B = (( CI) ( S B)) (CI ) C/B: B B 2 S B 4 5 8 2 4 6 3 5 7 S 9 3 CI CI CI Func. Dec B CI S C/B S/D dd. Sub. dd. 2 Sub 3 dd. 4 Sub. 5 dd. 6 Sub. 7 dd. 8 Sub. 9 dd. Sub. dd. 2 Sub. 3 dd. 4 Sub. 5 3. Multiplexer design Y = (S S2) (S S2) (S S S3) Y: S3 S3 2 S2 S S3 4 5 8 2 4 6 S2 3 5 7 S 9 3 S2 S S CI Dec S3 S2 S S Y Data path No selection I 2 I 3 I & I (5 lines) 4 I2 5 I2 & I (6 lines) 6 I2 & I (7 lines) 7 I2 & I & I ( 9 lines) 8 I3 9 I3 & I (3 lines) I3 & I (4 lines) I3 & I & I (6 lines) 2 I3 & I2 (5 lines) 3 I3 & I2 & I ( 7 lines) 4 I3 & I2 & I (8 lines) 5 I3 & I2 & I & I ( lines) E-P 4

4. Modulo-6 counter State reset 2 Dec C B + + C B + 2 3 4 5 6 X X X 7 X X X 5 4 Next state forming logic: + = B + = ( B) ( B C) C + = ( C) ( B) 3 If the counter will be disturbed and a state transition to a pseudo state has taken place then following transitions from pseudo states will occur: Dec C B + + C B + 6 7 Starting from pseudo state 7 the counter will reach state 4 with the next clock edge. fter one clock cycle the counter will return to the correct counting sequence. Starting from pseudo state 6 the counter will step to pseudo state 7 and then will reach the correct counting sequence. Two clock cycles are necessary to return. 5. Modulo-8 counter with minimum bit change sequence: Dec No. Q3 Q2 Q Q Q3 + Q2 + Q + Q + 3 2 7 3 5 4 4 5 2 6 8 7 rest ----- X X X X State/next state table Pseudo states have following decimal equivalent (minterm index): 2, 4, 5, 6, 9,,, 3. They are used as don t care entries (X) to the K-map minimisation for the next state forming logic. Next state forming logic for four D-FF inputs Di of a Johnson counter: Q + = D = Q3 + ; Q + = D = Q; Q2 + = D2 = Q; Q3 + = D3 = Q2 E-P 5

ccording to the next state forming logic equations the D-FF outputs are connected to the inputs of the D-FFs which represent the next higher weight. This counter is also called ring counter because of Q3 feedback to D. This basic structure of a directly coupled D-FF chain is called shift register. The stored bits are shifted from one position to the next when a positive clock edge triggers the D-FFs. The main condition for a successful stepwise shifting is provided by the fact that propagation delay t p is much larger than the sampling interval t samp. The timing waveform shows that a new output value Qi will be stored by following D-FF stage when the next clock edge appears. If D-latches would be applied then data would cycle within a closed loop because of transparency during a clock high level. t plh Transitions from pseudo states of a Johnson counter will always generate next states which don t belong to the proper counting sequence. In order to perform a return to the required counting sequence an additional self-correction circuit has to be connected to a ring counter (compare J. Wakerly: Digital Design. Page 727). Dec No. Q3 Q2 Q Q Q3 + Q2 + Q + Q + 2 --- 5 --- 9 --- E-P 6

6. Controlled modulo-3/modulo-6 counter Dec. No. Q2 Q Q S Q2 + Q + Q +, X 2, 3 X 4 2 5 2 6, 7 3 X 8, 9 4 X, 5 X 2, 3, 4, 5 6, 7 X X X X X State/next state table with a control input S. Three bits are necessary to perform 6 counting states. State S reset X X 2 X X 5 X 4 3 Next state forming logic for three D-FF inputs: Q + = D = (S Q) ( Q Q) ; Q + = D = (S Q Q) (Q Q Q2); Q2 + = D2 = (Q2 Q) (Q Q) Dec. No. Q2 Q Q S Q2 + Q + Q + 2 6 3 6 4 7 5 7 Transitions from pseudo states. The counter will return to the required counting cycle within two clock cycles if pseudo state no. 6 has occured and control bit S is high. In all other cases it takes only one clock cycle to return. The VHDL-code describes a design with a save transition from all pseudo states to the initial state: -- Synchronous 3-bit counter; synchronous reset RESET entity MODULO_3_6 is port (RESET, S,CLK : in BIT; Q: out BIT_VECTOR(2 downto )); end MODULO_3_6 ; architecture COUNTER of MODULO_3_6 is signal QINT: BIT_VECTOR(2 downto ); begin SYN_COUNT:process (CLK, RESET) -- signals with priority begin if RESET = '' then QINT <= "" after ns; elsif CLK='' and CLK'event then case QINT is -- next state forming logic when "" => QINT <= "" after ns; when "" => QINT <= "" after ns; when "" => if S = '' then - branch on control bit S QINT <= "" after ns; else QINT <= "" after ns; E-P 7

end if; when "" => QINT <= "" after ns; when "" => QINT <= "" after ns; when "" => QINT <= "" after ns; when others => QINT <= "" after ns;-- save counter end case; end if; end process SYN_COUNT; Q <= QINT; end COUNTER; 7. Moore state machine timing With synchronisation D-FFs the probability of metastable states of present state registers will be reduced (compare J. Wakerly: Digital Design. Pages 529 and 764). With the timing waveform it becomes clear that input signals E_VECT may change its value at any time. But after synchronisation signals ESYN always change with clock edge (afer t p ). With each following clock edge the prepared next state will be stored as present state. Therefore the response of state transitions on input signal changes will be delayed by one clock cycle. Present State Feedback Next State Forming Logic S + Present State Register S Output Forming Logic CLK E-P 8

8. Memory element timing a) Give the proper names of both memory elements. b) Which type can be used in FSMs? c) ccomplish the timing diagram with output waveforms. pply qualitative signal delays. E-P 9

9. Modulo-n counter fter a reset the modulo- counter counts up to 9 and RCO becomes high and the load input is low. With the next clock edge a load with (6 dec.) will be performed. fter 3 clock edges a load will be prepared again. Therefore the counter has a periodical sequence of 6 7 8 9 6: Modulo-4 counter. n = number of states input value at IN E-P