ECE 551 Digital System Design and Synthesis. Instructor: Kewal K. Saluja. Midterm Exam

Similar documents
Midterm Exam Thursday, October 24, :00--2:15PM (75 minutes)

EECS150 - Digital Design Lecture 20 - Finite State Machines Revisited

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

ECE 2300 Digital Logic & Computer Organization. More Sequential Logic Verilog

EPC6055 Digital Integrated Circuits EXAM 1 Fall Semester 2013

ECE 551: Digital System *

Final Exam Solution Sunday, December 15, 10:05-12:05 PM

ECE 2300 Digital Logic & Computer Organization. More Verilog Finite State Machines

EE178 Lecture Verilog FSM Examples. Eric Crabill SJSU / Xilinx Fall 2007

St.MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

ECEN 468 Advanced Logic Design

CSE140L: Components and Design Techniques for Digital Systems Lab

ECE 2300 Digital Logic & Computer Organization. More Finite State Machines

CSE140L: Components and Design

Synthesis of Language Constructs. 5/10/04 & 5/13/04 Hardware Description Languages and Synthesis

Lecture 32: SystemVerilog

ECE 4514 Digital Design II. Spring Lecture 15: FSM-based Control

Why Should I Learn This Language? VLSI HDL. Verilog-2

FSM Components. FSM Description. HDL Coding Methods. Chapter 7: HDL Coding Techniques

Finite-State Machine (FSM) Design

Synthesizable Verilog

C A R L E T O N U N I V E R S I T Y. FINAL EXAMINATION April Duration: 3 Hours No. of Students: 108

EEL 4783: HDL in Digital System Design

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 11. Introduction to Verilog II Sequential Circuits

EECS150 - Digital Design Lecture 10 Logic Synthesis

EECS150 - Digital Design Lecture 5 - Verilog Logic Synthesis

State Machine Descriptions

VHDL: RTL Synthesis Basics. 1 of 59

Finite State Machines

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad ELECTRONICS AND COMMUNICATIONS ENGINEERING

Laboratory Exercise 3 Davide Rossi DEI University of Bologna AA

Lecture 3. Behavioral Modeling Sequential Circuits. Registers Counters Finite State Machines

Verilog. What is Verilog? VHDL vs. Verilog. Hardware description language: Two major languages. Many EDA tools support HDL-based design

Verilog introduction. Embedded and Ambient Systems Lab

FPGA Design Challenge :Techkriti 14 Digital Design using Verilog Part 1

Synthesis vs. Compilation Descriptions mapped to hardware Verilog design patterns for best synthesis. Spring 2007 Lec #8 -- HW Synthesis 1

MLR Institute of Technology

Digital Integrated Circuits

EECS 151/251A: SRPING 2017 MIDTERM 1

Logic Synthesis. EECS150 - Digital Design Lecture 6 - Synthesis

Sunburst Design - Verilog-2001 Design & Best Coding Practices by Recognized Verilog & SystemVerilog Guru, Cliff Cummings of Sunburst Design, Inc.

EECS150 - Digital Design Lecture 10 Logic Synthesis

EE 231 Fall EE 231 Homework 8 Due October 20, 2010

Recommended Design Techniques for ECE241 Project Franjo Plavec Department of Electrical and Computer Engineering University of Toronto

Quick Introduction to SystemVerilog: Sequental Logic

Sequential Logic Implementation. Mealy vs. Moore Machines. Specifying Outputs for a Mealy Machine. Specifying Outputs for a Moore Machine

The Verilog Language COMS W Prof. Stephen A. Edwards Fall 2002 Columbia University Department of Computer Science

FSM and Efficient Synthesizable FSM Design using Verilog

Department of Electrical and Computer Engineering University of Wisconsin Madison. Fall Midterm Examination CLOSED BOOK

Outline. EECS Components and Design Techniques for Digital Systems. Lec 11 Putting it all together Where are we now?

Chapter 5 Registers & Counters

Verilog Tutorial. Introduction. T. A.: Hsueh-Yi Lin. 2008/3/12 VLSI Digital Signal Processing 2

CSE140L: Components and Design Techniques for Digital Systems Lab. FSMs. Instructor: Mohsen Imani. Slides from Tajana Simunic Rosing

EECS150 - Digital Design Lecture 7 - Computer Aided Design (CAD) - Part II (Logic Simulation) Finite State Machine Review

One and a half hours. Section A is COMPULSORY

Department of Electrical and Computer Engineering University of Wisconsin - Madison. ECE/CS 352 Digital System Fundamentals.

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

Modeling Sequential Circuits in Verilog

ECE 574: Modeling and Synthesis of Digital Systems using Verilog and VHDL. Fall 2017 Final Exam (6.00 to 8.30pm) Verilog SOLUTIONS

Control in Digital Systems

Verilog Tutorial (Structure, Test)

Two hours - online EXAM PAPER MUST NOT BE REMOVED FROM THE EXAM ROOM UNIVERSITY OF MANCHESTER SCHOOL OF COMPUTER SCIENCE

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

In the previous lecture, we examined how to analyse a FSM using state table, state diagram and waveforms. In this lecture we will learn how to design

ARM 64-bit Register File

Last Lecture. Talked about combinational logic always statements. e.g., module ex2(input logic a, b, c, output logic f); logic t; // internal signal

Mealy and Moore examples

Lecture #2: Verilog HDL

Writing Circuit Descriptions 8

Verilog Coding Guideline

Graduate Institute of Electronics Engineering, NTU. Lecturer: Chihhao Chao Date:

Digital Integrated Circuits

Topics. Midterm Finish Chapter 7

Synthesis from VHDL. Krzysztof Kuchcinski Department of Computer Science Lund Institute of Technology Sweden

Designing Safe Verilog State Machines with Synplify

Note: Closed book no notes or other material allowed, no calculators or other electronic devices.

CS 151 Final. Q1 Q2 Q3 Q4 Q5 Total Credit Score. Instructions: Student ID. (Last Name) (First Name) Signature

Verilog HDL. Testing & Verification Dept. of Computer Science & Engg,, IIT Kharagpur

Advanced Digital Design Using FPGA. Dr. Shahrokh Abadi

Design of Digital Circuits ( L) ETH Zürich, Spring 2017

Blocking(=) vs Nonblocking (<=) Assignment. Lecture 3: Modeling Sequential Logic in Verilog HDL. Procedural assignments

CS6710 Tool Suite. Verilog is the Key Tool

ENGR 3410: Lab #1 MIPS 32-bit Register File

RealDigital. Problem Set #7 S1 S2 S3 Y Z X Y + Y Z X Z

Verilog Fundamentals. Shubham Singh. Junior Undergrad. Electrical Engineering

Sequential Logic Design

N-input EX-NOR gate. N-output inverter. N-input NOR gate

EECS150 - Digital Design Lecture 4 - Verilog Introduction. Outline

Digital Design with FPGAs. By Neeraj Kulkarni

EECS Components and Design Techniques for Digital Systems. Lec 07 PLAs and FSMs 9/ Big Idea: boolean functions <> gates.

Topics. Midterm Finish Chapter 7

R07. IV B.Tech. II Semester Supplementary Examinations, July, 2011

VERILOG QUICKSTART. Second Edition. A Practical Guide to Simulation and Synthesis in Verilog

Lab 7 (Sections 300, 301 and 302) Prelab: Introduction to Verilog

Homework deadline extended to next friday

Lab 7 (All Sections) Prelab: Introduction to Verilog

VLSI Design 13. Introduction to Verilog

What is Verilog HDL? Lecture 1: Verilog HDL Introduction. Basic Design Methodology. What is VHDL? Requirements

Abstraction of State Elements. Sequential Logic Implementation. Forms of Sequential Logic. Finite State Machine Representations

ENGR 3410: MP #1 MIPS 32-bit Register File

Transcription:

Last (family) name: First (given) name: Student I.D. #: Department of Electrical and Computer Engineering University of Wisconsin - Madison ECE 551 Digital System Design and Synthesis Instructor: Kewal K. Saluja Midterm Exam Wednesday, March 13, 2002 113 Psychlogy 7:15--8:30PM (75 minuts) Instructions: 1. Closed book examination. Only one cheat sheet allowed. 2. Five points penalty if fail to enter name or ID number. 3. No one shall leave room during last 5 minutes of the examination. 4. Upon announcement of the of the exam, stop writing on the exam paper immediately. Pass the exam to isles to be picked up by the instructor or a TA. The instructor will announce when to leave the room. 5. Failure to follow instructions may result in forfeiture of your exam and will be handled according to UWS 14 Academic misconduct procedures. ECE 551 Midterm Exam 3/14/02 1

Problem Points Score 1 20 2 10 3 10 4 15 5 15 6 10 7 10 8 10 Total 100 ECE 551 Midterm Exam 3/14/02 2

1. (20 points) General Questions Answer the following briefly and to the point. (a) (2 points) Write the binary equivalent of the following and indicate those which are invalid. 4 b10xz =.175 = 8 o3_6 = -8 d3 = (b) (2 points) Determine the values of signals in each of the following based on verilog standard: For a two input nor gate if the inputs are x and 1, what will be the output For a two input and gate if the inputs are 1 and z, what will be the output For a two input nand gate if the output is 1, what can be the possible input values (c) (2 points) What is the difference between the following two declarations reg [1:8] reg_a reg reg_a [1:8] (d) (2 points) Reduction AND and bitwise AND, both these are written as &, how do they differ and how are these recognized. (e) (2 points) Is the following construct correct? If not what is the error? wire y; nand (y, a, b); nor (y, c, d); buf (out, y); (f) (2 points) What is the difference between the following two wire scalared [31:0] bus_a wire vectored [31:0] bus_a (g) (2 points) True or False: A verilog net variable can be assigned value by a continuous assignment All module ports must be scalars (h) (2 points) what is the difference between transport and inertial delay? ECE 551 Midterm Exam 3/14/02 3

(i) (4 points) Consider the following two descriptions of a 2-to-4 mux. Which of these two descriptions is preferred and why? module mux_1(out, in_1, in_2, in_3, in_4, sel); input in_1, in_2, in_3, in_4; input [1:0] sel; output out; reg out; always @(sel) case (sel) 2 b00 : out = in_1; 2 b01 : out = in_2; 2 b10 : out = in_3; 2 b11 : out = in_4; case module mux_2(out, in_1, in_2, in_3, in_4, sel); input in_1, in_2, in_3, in_4; input [1:0] sel; output out; reg out; always @(sel) case (sel) 2 b00 : assign out = in_1; 2 b01 : assign out = in_2; 2 b10 : assign out = in_3; 2 b11 : assign out = in_4; case ECE 551 Midterm Exam 3/14/02 4

2. (10 points) Structural, RTL, and behavior descriptions Structural description of a circuit in verlog module form is given below: module structure(y, a, b, c, d); input a, b, c, d; output y; wire n; nand g1 (n, a, b, c); nand g2 (y, n, d); a) (2 points) Draw the structure of the circuit b) (4 points) Write the above module in RTL/Dataflow style using continuous assignment module structure_rtl(y, a, b, c, d); c) (4 points) Write the above module using procedural/behavioral style modeling module structure_proc(y, a, b, c, d); ECE 551 Midterm Exam 3/14/02 5

3. (10 points) Test bench - Clock generation A circuit uses two phase cloking and the two phases of the clock, phase_1 and phase_2, are as shown below: phase_1 phase_2 t = 0 5 15 20 30 35 45 50 a) (2 points) What is the clock period for each phase? All times are in nanoseconds. b) (8 points) Complete the coding. You are required to use both always blocks. module two_phase_clock; reg phase_1, phase_2; initial begin phase_1 = 1 b0; phase_2 = 1 b0; #5 phase_1 = 1 b1 // used the following to generate phase_2 always @(posedge phase_1) begin // used the following to generate phase_1 always @(posedge phase_2) begin ECE 551 Midterm Exam 3/14/02 6

4. (15 points) Blocking/nonblocking assignment; inter/intra statement delays In each of the following parts sufficient time steps are provided, use only as many as you need. a) (5 points) If the following module is executed what will be the values of the variables at each time instant. Assume initially all values are x. module two_begins; initial begin #1 a = 0; b = 1; #2 c = 2; initial begin a = 5; #2 c = 0; #2 b = 4; a = c; time a b c 0 1 2 3 4 5 b) (5 points) Determine the values of variable at each time instant when the following initial block is executed: initial begin a = 0; b = 1; c =2; #1 a = 3; #3 b = c; c <= # 2 a; time a b c 0 1 2 3 4 5 6 7 ECE 551 Midterm Exam 3/14/02 7

c) (5 points) Determine the values of variable at each time instant when the following initial block is executed initial begin a = 0; b = 1; c =2; fork #1 a = 3; #3 b = c; c <= # 2 a; join time a b c 0 1 2 3 4 5 6 7 ECE 551 Midterm Exam 3/14/02 8

5. (15 Points) Flip-flop modeling Consider the following verilog model of a storage element with an active low clr_n signal. module poor_flip_flop(q, d, clr_n, clk); input d, clr_n, clk; output q; reg q; initial q = 0; always begin if (clr_n!= 0) @(posedge clk) #1 q = d; else #1 q = 0; (a) (3 points) Does this flip-flop have a synchronous or asynchronous clear? (b) (12 points) An expert analyzer of verilog claims that this flip-flop model will create a 1- time unit glitch on the output in some cases when clear is asserted low. Can you identify such a condition. Do so by identifying the input values (d, clr_n), and the state (q) of the flip-flop relative to the clock (shown below). Draw the corresponding waveforms of all signals for at least two clock cycles. clk clr_n d q ECE 551 Midterm Exam 3/14/02 9

6. (10 points) Debug Correct all syntax errors in the verilog description of a parity checker given below. Please also pay attention to the functionality of the design. module buggy_parity_checker (rxdata, error); parameter parity = 0; // parity = 0 means rxdata should even parity input scalared [7:0] rxdata; reg scalared [6:0] temp; wire newparity; output error; reg error; assign error = rxdara[8] ^ newparity always @ if (parity = = 1) not [6:0] (temp, rxdata) newparity = ^ temp; else newparity = ^ rxdata[6:0]; ; ECE 551 Midterm Exam 3/14/02 10

7. (10 Points) UDP :. (a) (2 points) Answer the following brief questions How many inputs can a UDP have? How many outputs can a UDP have? How many transitions can be specified in a row while describing a sequential UDP? Is inout a legal variable for use in a UDP? (b) (8 points) Write a UDP that implements the following combinational function: F = (A ^ B) C In the table use as few entries as possible using appropriate symbols. Recall that the output x is a default output for input conditions not explicitly listed in the table. ECE 551 Midterm Exam 3/14/02 11

8. (10 Points) Finite State Machine a) (5 points) Five different styles were discussed in class to implement an FSM. Enumerate these styles and indicate the FSM models (Mealy and/or Moore) that can be implemented by each o the five styles. Give a brief reason as to why the style that combines all three always blocks into one block can not be used to specify a Mealy model. b) (5 points) For the FSM described below, draw its state diagram and indicate if it is a Mealy or a Moore Machine. module FSM(clk, rst, in, out); input clk, rst, in; output out; reg [1:0] state, nextstate; reg out; parameter s0 = 2 b00, s1 = 2 b01, s2 = 2 b10, s3 = 2 b11; always @(posedge clk or posedge rst) if (rst = = 1) state <= s0; else state <= nextstate; always @(in or state) case (state) s0 : if (in = = 1) nextstate <= s1; else nextstate <= s0; s1 : if (in = = 1) nextstate <= s2; else nextstate <= s0; s2 : if (in = = 1) nextstate <= s2; else nextstate <= s3; s3 : if (in = = 1) nextstate <= s1; else nextstate <= s0; case always @(in or state) case (state) s0 : out <= 0; s1 : out <= 0; s2 : out <= 0; s3 : out <= 1; case ECE 551 Midterm Exam 3/14/02 12