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

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

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

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

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

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

Counter dan Register

Asynchronous (Ripple) Counters

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

Computer Organization & Architecture Lecture #5

Experiment 8 Introduction to Latches and Flip-Flops and registers

CprE 281: Digital Logic

EECS 270 Midterm 2 Exam Closed book portion Fall 2014

Registers and Counters

Midterm Exam 15 points total. March 28, 2011

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

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

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

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

Chapter 5 Synchronous Sequential Logic

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

Chapter Contents. Appendix A: Digital Logic. Some Definitions

Digital Fundamentals: A Systems Approach

Course Administration

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

Computer Architecture and Organization

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Counters

Lecture 8: Sequential Logic

Midterm Examination II

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

Principles of Computer Architecture. Appendix A: Digital Logic

ELE2120 Digital Circuits and Systems. Tutorial Note 8

Sequential Logic Circuits

Combinational / Sequential Logic

CSE 140 Exam #3 Tajana Simunic Rosing

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

Unit 11. Latches and Flip-Flops

St. MARTIN S ENGINEERING COLLEGE

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

EECS 270 Final Exam Spring 2012

Digital Electronics II 2016 Imperial College London Page 1 of 8

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

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


Flip-Flops and Sequential Circuit Design

Dr. Shahram Shirani COE2DI4 Midterm Test #2 Nov 19, 2008

Logic Design. Flip Flops, Registers and Counters

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

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

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

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

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

Bachelor Level/ First Year/ Second Semester/ Science Full Marks: 60 Computer Science and Information Technology (CSc. 151) Pass Marks: 24

CprE 281: Digital Logic

R13 SET - 1 '' ''' '' ' '''' Code No: RT21053

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Chapter 5: Synchronous Sequential Logic

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

CprE 281: Digital Logic

Registers and Counters

VU Mobile Powered by S NO Group

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.

UNIVERSITI TEKNOLOGI MALAYSIA

CprE 281: Digital Logic

Introduction to Digital Logic Missouri S&T University CPE 2210 Exam 3 Logistics

CHAPTER 4: Logic Circuits

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

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

Logic Design II (17.342) Spring Lecture Outline

EE292: Fundamentals of ECE

Vignana Bharathi Institute of Technology UNIT 4 DLD

D Latch (Transparent Latch)

CprE 281: Digital Logic

R13. II B. Tech I Semester Regular Examinations, Jan DIGITAL LOGIC DESIGN (Com. to CSE, IT) PART-A

EECS150 - Digital Design Lecture 3 Synchronous Digital Systems Review. Announcements

Introduction. Serial In - Serial Out Shift Registers (SISO)

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

CHAPTER 4: Logic Circuits

Sequential Digital Design. Laboratory Manual. Experiment #7. Counters

Digital Circuit And Logic Design I. Lecture 8

Digital Circuit And Logic Design I

Logic Design II (17.342) Spring Lecture Outline

Chapter. Synchronous Sequential Circuits

Flip Flop. S-R Flip Flop. Sequential Circuits. Block diagram. Prepared by:- Anwar Bari

Combinational vs Sequential

Long and Fast Up/Down Counters Pushpinder Kaur CHOUHAN 6 th Jan, 2003

FPGA Implementation of Sequential Logic

Other Flip-Flops. Lecture 27 1

EEC 118 Lecture #9: Sequential Logic. Rajeevan Amirtharajah University of California, Davis Jeff Parkhurst Intel Corporation

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

EECS 270 Midterm 1 Exam Closed book portion Winter 2017

Microprocessor Design

DIGITAL ELECTRONICS MCQs

CHAPTER 6 COUNTERS & REGISTERS

Chapter 5 Sequential Circuits

CS 261 Fall Mike Lam, Professor. Sequential Circuits

Digital Logic Design I

Registers & Counters. Logic and Digital System Design - CS 303 Erkay Savaş Sabanci University

CSE 140 Exam #3 Solution Tajana Simunic Rosing

Universal Asynchronous Receiver- Transmitter (UART)

Transcription:

University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Sciences EECS150 J. Wawrzynek Spring 2002 4/5/02 Midterm Exam II Name: Solutions ID number: This is a closed-book, closed-note exam. No calculators please. You have 3 hours. Each question is marked with its number of points (one point per expected minute of time). Use the scrap paper to work out your answers, then neatly write your final answer in the space provided. We will only grade answers provided in the appropriate place. Put your name and SID on each page. Show your work. Write neatly and be well organized. Good luck! problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

1. [28 pts] Short Answer. a) [1pt] Any Boolean function can be implemented using multiplexers alone. (true or false) b) [1pt] Dedicated carry-chains in FPGAs speed-up addition over carry-ripple adders using LUTS by approximately a factor of 4, 8, or 16 (choose one) c) [2pts] Equal comparison of 2 8-bit numbers (output =1 if two numbers are equal) requires at least 31 2-input AND/OR gates (assuming both complemented and uncomplemented inputs are available) true 4 d) [1pt] For a SR-latch built from cross-coupled NAND gates, to set the latch, one of the the inputs must changed from logic level HI to logic level LO. e) [1pt] A toggle flip-flop can be built from a D-type flip-flop (with both Q and Q outputs) and how many 2-input AND/OR gates? 3 f) [1pt] How many distinct states are there in a n-bit Johnson Counter? 2n g) [2pt] A Two-dimensional universal shift-register (shift both left/right or up/down) could be built from D-type flip-flops and multiplexors with how many inputs? 6 or 9 if including the control h) [1pt] A Moore machine usually has fewer states than an equivalent Mealy machine. (true or false) false i) [1pt] If you were to build a 64:1 multiplexer from 4:1 multiplexers, you would need 21 4:1 multiplexers. j) [1pt] A sequential circuit is to output a 1 when an even number of one s are input; otherwise the output is 0. The minimum number of flip-flops required is 1. 2

k) [1pt] A four to one multiplexer is to be implemented using a memory. How many = words of memory are required, and how many bits must each word have? 64 x 1 l) [2pt] Given a Mealy machine with 3 inputs, 4 state flip-flops, and 5 outputs. What is the maximum possible number of transition arrows that can leave a single state? 3 or 8 m) [3pt] What is the minimum number of full-adder cells that are needed to reduce a list of M n-bit numbers to a pair of numbers using carry-save addition, in one clock cycle? approx_n n( m 2) log 2 ( m) 1 exact_n n( m 2) k = 1 ( k 1) m 1 2 k n) [6pt] Fill in the following table with delay and cost as a function of n for each type of n-bit adder structure (use the big O notation): Adder type delay cost Ripple carry O(n) O(n) Carry-Look-ahead O(log n) O(n) Carry-Select O(sqrt(n)) O(n) o) [2pt] List two reasons why designers should carefully choose the state assignment in FSM design. Delay, cost, and power p) [2pt] What is the minimum number of 2-input gates that are needed to implement a 3- input decoder? (assume both complemented and uncomplemented versions of the input are available) 12 3

2. [10 pts] Consider the design of a Moore-style FSM with the following description: The FSM has 2 inputs, IN and RESET, and four outputs X0, X1, X2, and X3. After the RESET input is asserted the FSM accepts a stream of bits applied to the input IN. Bit patterns of the form 1 1 are recognized by the FSM, where each may be either a 0 or a 1. After the rising edge of the clock on the cycle when the final 1 is passed in, the FSM asserts one of X0,, X3 to indicate 00, 01, 10, or 11 for. All other bit patterns result in no outputs being asserted. The RESET signal can come at any time and initializes the FSM to again look for bit patterns. Recognizable bit patterns do not overlap. For example, the bit stream (with time moving left to right through this bit string) 0101100100111010 contains only three recognized bit patterns, 1011, 1001, and 1101. Fill in the symbolic state transition table and the output table below. ( symbolic means that you do not need to encode the states just make up state names). 4

NEXT STATE IN RESET STATE STATE OUTPUT S0 0 0 S0 S0 1 0 S1 S1 S1 0 0 S2 S2 1 0 S3 S3 S2 0 0 S4 S4 1 0 S5 S5 S3 0 0 S6 S6 1 0 S7 S7 S4 0 0 S0 S8 X0 1 0 S8 S9 X1 S5 0 0 S2 S10 X2 1 0 S9 S11 X3 S6 0 0 S4 1 0 S10 S7 0 0 S6 1 0 S11 S8 0 0 S0 1 0 S1 S9 0 0 S0 1 0 S1 S10 0 0 S0 1 0 S1 S11 0 0 S0 1 0 S1 ---- --- 1 S0 5

3. [10pts] Consider the Mealy FSM with a state transition table shown below. An additional input, RESET, asynchronously sends the FSM to the S0 state. NEXT STATE IN STATE OUT S0 0 S0 0 S0 1 S1 0 S1 0 S1 0 S1 1 S2 0 S2 0 S2 0 S2 1 S0 1 In the space provided below, draw the circuit diagram for a one-hot encoded implementation of the FSM. Assume that the only circuit elements you have are inverters, 2-input AND and OR gates, and D-type flip-flops with asynchronous set and reset: 6

4. [15 pts] Consider the design of a synchronous binary up-counter (no ripple counters allowed!). The counter has no count-enable input (CE) and no terminal-count (TC) output. Its only input, RESET, asynchronously sends the counter to the 0 state. The design elements in the table are the only ones available for your use. The flip-flops have asynchronous reset inputs. All delays are in ns. Ignore delay due to fan-out. Element D-type FF 2-input 2-input 2-input inverter EXOR AND OR Cost 6 3 2 2 1 Delay 1 (setup) 1 (clk-to-q) 2 2 2 1 a) Using only elements from the table above, design an 8-bit counter with minimal cost that will function correctly with a clock period of 18ns. Draw your circuit in the place provided. Fill in the cost. Cost = 82 Cost = INV + 7*EXOR + 6*AND + 8*FF = 1 + 21 + 12 + 48 = 82 Cycle time >= T clk-to-q + (6*T AND + T EXOR ) + T SU >= 1 + (12 + 2) + 1 >= 16ns 7

b) Now assume the desired clock period is 15ns. Draw the circuit diagram for a counter (with the same functional specification as above) with minimal cost that will function correctly with a clock period of 15ns. Fill in the cost for this version. Cost = 84 Cost = INV + 7*EXOR + 7*AND + 8*FF = 1 + 21 + 14 + 48 = 84 Cycle time >= T clk-to-q + (5*T AND + T EXOR ) + T SU >= 1 + (10 + 2) + 1 >= 14ns 8

5. [14pts] Consider the design of an 3-bit array multiplier; a combinational logic circuit capable of multiplying 2 unsigned 3-bit numbers A and B, and generating a 6-bit result, P, within one clock cycle. Your design elements are shown with their associated delay in the table below. All delays are in ns. element full-adder cell (any input to any output) delay 2 1 2-input AND Consider the design of a minimum cost multiplier. Assuming that both inputs A and B are applied at the same time, fill in the table below to indicate the worst-case delay from the inputs to each of the output bits in the result P. Hint: For this size multiplier, carry-save addition provides no advantage, so don t use it. Justify your answer by drawing your circuit below. FA: A B B2 B1 B0 C0 S Cin A0 B2 B1 B0 P0 A1 0 FA FA FA 0 B2 B1 B0 P1 A2 FA FA FA 0 P5 P4 P3 P2 delay p 0 1 p 1 3 p 2 7 p 3 9 p 4 11 p 5 11 9

6. [12 pts] A Moore style FSM with one input and one output has behavior described by the symbolic state transition table below. NEXT STATE IN STATE STATE OUTPUT A 0 C A 1 B B 0 B B 1 D C 0 A C 1 C D 0 C D 1 B A 1 B 0 C 1 D 0 a) Convert the Moore machine to a Mealy machine with the same behavior. Express your answer by filling in the symbolic state transition table in the space below. Use as few state as are necessary: NEXT STATE IN STATE OUTPUT A IN C 1 A IN B 0 A C IN C 1 C IN A 1 IN /1 IN/0 B IN A 0 IN /1 IN/0 B IN B 0 C C IN/1 IN /0 Observe that if the present state is A or D, given the same input, their behavior is the same (same state transition and output). So we can combine states A and D. 10

7. [12pts] Consider the design of a controller built from a FSM and a counter. The controller has one input, GO, and one output, DONE. When the GO signal is asserted (for at least one cycle) the controller waits for 12 cycles then asserts the DONE signal for one cycle, as shown below: CLK GO DONE The controller must be built from a FSM and a 4-bit synchronous binary counter with count-enable (CE) and load (LD) inputs, parallel load signals (d3,d2,d1,d0), parallel output signals (q3,q2,q1,q0) and terminal-count output (TC). a) In the space provided below, draw a state-transition-diagram for the FSM. You may choose between Moore and Mealy machines. GO / GO/LD TC /CE Idle Count Mealy TC/DONE d = 4\d GO TC GO S0 [LD] S1 [CE] S2 [DONE] TC Moore d = 5\d 11

b) Make all necessary connections among the inputs and outputs, to implement the controller (assume the clock signal already is connected): FSM CE LD d3,d2,d1,d0 4-bit counter TC q3,q2,q1,q0 GO DONE 4 State Mealy LD CE O[3:0] D[3:0] GO 4 OR 4 12