COVER SHEET: Total: Regrade Info: 5 (14 points) 7 (15 points) Midterm 1 Spring 2012 VERSION 1 UFID:

Similar documents
EEL 4712 Name: SOLUTION Midterm 1 Spring 2016 VERSION 1 UFID:

Sign here to give permission to return your test in class, where other students might see your score:

COVER SHEET: Total: Regrade Info: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points)

COVER SHEET: Total: Regrade Info: 2 (6 points) 3 (8 points) 4 (10 points) 8 (12 points) 6 (6 points) 7 (6 points) 9 (30 points) 10 (4 points)

COVER SHEET: Total: Regrade Info: 1 (8 points) 2 ( 8 points) 3 (16 points) 4 (16 points) 5 (16 points) 6 (16 points) 7 (16 points) 8 (8 points)

COVER SHEET: Total: Regrade Info: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 points)

COVER SHEET: Total: Regrade Info: 7 (6 points) 2 (10 points) 9 (5 points) 8 (12 points) 12 (5 points) 11 (25 points)

COVER SHEET: Total: Regrade Info: 7 (6 points) 2 (14 points) 4 (12 points) 8 (20 points) 9 (24 points) 10 (5 extra credit points)

COVER SHEET: Total: Regrade Info: 7 (5 points) 8 (6 points) 4 (10 points) 5 (12 points) 9 (15 points) 10 (27 points) 11 (4 free points)

EEL 4712 Digital Design Test 1 Spring Semester 2007

EEL 4712 Digital Design Test 1 Spring Semester 2008

Sign here to give permission for your test to be returned in class, where others might see your score:

EEL 4712 Digital Design Test 2 Spring Semester 2008

Sign here to give permission for your test to be returned in class, where others might see your score:

VHDL And Synthesis Review

Sequential Logic - Module 5

Sign here to give permission for your test to be returned in class, where others might see your score:

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1. Your name 2/13/2014

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

The University of Alabama in Huntsville Electrical and Computer Engineering CPE/EE 422/522 Spring 2005 Homework #6 Solution

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

VHDL in 1h. Martin Schöberl

Sign here to give permission for your test to be returned in class, where others might see your score:

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

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution Spring 2016

Summary of FPGA & VHDL

VHDL Examples Mohamed Zaky

The University of Alabama in Huntsville ECE Department CPE Midterm Exam Solution March 2, 2006

VHDL Modeling Behavior from Synthesis Perspective -Part B - EL 310 Erkay Savaş Sabancı University

Schedule. ECE U530 Digital Hardware Synthesis. Rest of Semester. Midterm Question 1a

Lecture 4: Modeling in VHDL (Continued ) EE 3610 Digital Systems

Sequential Statement

Building Blocks. Entity Declaration. Entity Declaration with Generics. Architecture Body. entity entity_name is. entity register8 is

Computer-Aided Digital System Design VHDL

Lecture 12 VHDL Synthesis

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Timing in synchronous systems

SEQUENTIAL STATEMENTS

Control Unit: Binary Multiplier. Arturo Díaz-Pérez Departamento de Computación Laboratorio de Tecnologías de Información CINVESTAV-IPN

In our case Dr. Johnson is setting the best practices

Control and Datapath 8

VHDL 2 Combinational Logic Circuits. Reference: Roth/John Text: Chapter 2

VHDL HIERARCHICAL MODELING

VHDL for FPGA Design. by : Mohamed Samy

VHDL: Code Structure. 1

The University of Alabama in Huntsville ECE Department CPE Final Exam Solution Spring 2004

VHDL. VHDL History. Why VHDL? Introduction to Structured VLSI Design. Very High Speed Integrated Circuit (VHSIC) Hardware Description Language

VHDL Testbench. Test Bench Syntax. VHDL Testbench Tutorial 1. Contents

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. George Mason University

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

Hardware Description Languages. Modeling Complex Systems

CSE 260 Introduction to Digital Logic and Computer Design. Exam 1 Solutions

Finite State Machines (FSM) Description in VHDL. Review and Synthesis

Two HDLs used today VHDL. Why VHDL? Introduction to Structured VLSI Design

EITF35: Introduction to Structured VLSI Design

Tutorial 4 HDL. Outline VHDL PROCESS. Modeling Combinational Logic. Structural Description Instantiation and Interconnection Hierarchy

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

ECE 459/559 Secure & Trustworthy Computer Hardware Design

8 Register, Multiplexer and

[VARIABLE declaration] BEGIN. sequential statements

Outline. CPE/EE 422/522 Advanced Logic Design L05. Review: General Model of Moore Sequential Machine. Review: Mealy Sequential Networks.

Nanosistemų programavimo kalbos 5 paskaita. Sekvencinių schemų projektavimas

FINITE STATE MACHINES (FSM) DESCRIPTION IN VHDL. Cristian Sisterna UNSJ

Getting Started with VHDL

Lecture 7. Standard ICs FPGA (Field Programmable Gate Array) VHDL (Very-high-speed integrated circuits. Hardware Description Language)

ECE 448 Lecture 4. Sequential-Circuit Building Blocks. Mixing Description Styles

VHDL: RTL Synthesis Basics. 1 of 59

CSE 260 Digital Computers: Organization and Logical Design. Exam 2. Jon Turner 3/28/2012

ECEU530. Homework 4 due Wednesday Oct 25. ECE U530 Digital Hardware Synthesis. VHDL for Synthesis with Xilinx. Schedule

EITF35: Introduction to Structured VLSI Design

CprE 583 Reconfigurable Computing

EITF35: Introduction to Structured VLSI Design

Hardware Description Language VHDL (1) Introduction

COE 405, Term 062. Design & Modeling of Digital Systems. HW# 1 Solution. Due date: Wednesday, March. 14

3 Designing Digital Systems with Algorithmic State Machine Charts

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

Lab 3. Advanced VHDL

Modeling Complex Behavior

Mridula Allani Fall Fall

Review. LIBRARY list of library names; USE library.package.object; ENTITY entity_name IS generic declarations PORT ( signal_name(s): mode signal_type;

Counters. Counter Types. Variations. Modulo Gray Code BCD (Decimal) Decade Ring Johnson (twisted ring) LFSR

EL 310 Hardware Description Languages Midterm

VHDL for Modeling - Module 10

Lecture 08 Finite State Machine Design Using VHDL

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

VHDL: Modeling RAM and Register Files. Textbook Chapters: 6.6.1, 8.7, 8.8, 9.5.2, 11.2

Architecture des Ordinateurs I

EEL 4783: Hardware/Software Co-design with FPGAs

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

1 ST SUMMER SCHOOL: VHDL BOOTCAMP PISA, JULY 2013

EECS 151/251A: SRPING 2017 MIDTERM 1

5. 0 VHDL OPERATORS. The above classes are arranged in increasing priority when parentheses are not used.

Design Guidelines for Using DSP Blocks

8-1. Fig. 8-1 ASM Chart Elements 2001 Prentice Hall, Inc. M. Morris Mano & Charles R. Kime LOGIC AND COMPUTER DESIGN FUNDAMENTALS, 2e, Updated.

Design units can NOT be split across different files

Lecture 38 VHDL Description: Addition of Two [5 5] Matrices

Field Programmable Gate Array

VHDL simulation and synthesis

Inferring Storage Elements

CS211 Digital Systems/Lab. Introduction to VHDL. Hyotaek Shim, Computer Architecture Laboratory

Transcription:

EEL 4712 Midterm 1 Spring 2012 VERSION 1 Name: UFID: IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. As always, the best answer gets the most points. COVER SHEET: Problem#: 1 (14 points) 2 (14 points) 3 (14 points) 4 (14 points) 5 (14 points) 6 (15 points) 7 (15 points) Points Total: Regrade Info:

ENTITY _entity_name IS PORT( input_name, input_name : IN STD_LOGIC; input_vector_name : IN STD_LOGIC_VECTOR( high downto low); bidir_name, bidir_name : INOUT STD_LOGIC; output_name, output_name : OUT STD_LOGIC); END entity_name; ARCHITECTURE a OF entity_name IS SIGNAL signal_name : STD_LOGIC; BEGIN -- Process Statement -- Concurrent Signal Assignment -- Conditional Signal Assignment -- Selected Signal Assignment -- Component Instantiation Statement END a; instance_name: component_name PORT MAP ( component_port => connect_port, component_port => connect_port); WITH expression SELECT signal <= expression WHEN constant_value, expression WHEN constant_value, expression WHEN constant_value, expression WHEN constant_value; signal <= expression WHEN boolean_expression ELSE expression WHEN boolean_expression ELSE expression; IF expression THEN ELSIF expression THEN ELSE END IF; CASE expression IS WHEN constant_value => WHEN constant_value => WHEN OTHERS => END CASE; <generate_label>: FOR <loop_id> IN <range> GENERATE -- Concurrent Statement(s) END GENERATE; type array_type is array( upperbound downto lowerbound);

1) (14 points) Fill in the following behavioral VHDL to implement the illustrated circuit. Assume that clk and rst connect to every register. Also, write the code so that only the lower half bits of the multiplier output is saved in the register. All wires in the circuit are WIDTH bits. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; input1 input2 * Reg + input3 Reg entity mult_add is generic ( width : positive := 16); clk, rst : in std_logic; input1, input2, input3 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end mult_add; Reg output architecture BHV of mult_add is -- BHV process(clk, rst) if (rst = '1') then elsif (rising_edge(clk)) then end if; end BHV;

2) (14 points) Draw the circuit that would be synthesized for the following code. Label all inputs, outputs, and register outputs based on their signal names. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity example is generic ( width : positive := 16); clk, rst : in std_logic; in1, in2, in3, in4 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end example; architecture BHV of example is signal add1_out : std_logic_vector(width-1 downto 0); signal add2_out : std_logic_vector(width-1 downto 0); signal temp1_out : std_logic_vector(width-1 downto 0); signal temp2_out : std_logic_vector(width-1 downto 0); process(clk, rst) if (rst = '1') then add1_out <= (others => '0'); add2_out <= (others => '0'); temp1_out <= (others => '0'); temp2_out <= (others => '0'); elsif (rising_edge(clk)) then add1_out <= std_logic_vector(unsigned(in1)+unsigned(in2)); add2_out <= std_logic_vector(unsigned(in3)+unsigned(in4)); temp1_out <= add1_out; temp2_out <= add2_out; end if; output <= std_logic_vector(unsigned(temp1_out)+unsigned(temp2_out)); end BHV;

3) (14 points) Identify the violations (if any) of the synthesis coding guidelines for combinational logic, and the effect on the synthesized circuit. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity alu_en is generic ( width : positive := 16); en, sel : in std_logic; input1, input2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end alu_en; architecture BHV of alu_en is process(input1,input2,sel) case sel is when '0' => if (en = '1') then output <= std_logic_vector(unsigned(input1)+unsigned(input2)); end if; when '1' => if (en = '1') then output <= std_logic_vector(unsigned(input1)-unsigned(input2)); end if; when others => null; end case; end BHV;

4) (14 points) Circle the following architectures that will correctly simulate an adder with overflow: entity ADD is input1, input2 : in std_logic_vector(15 downto 0); output : out std_logic_vector(15 downto 0); overflow : out std_logic); end ADD; architecture BHV1 of ADD is signal temp : unsigned(16 downto 0); process(input1, input2) temp <= unsigned("0"&input1) + unsigned("0"&input2); output <= std_logic_vector(temp(15 downto 0)); overflow <= std_logic(temp(16)); end BHV1; architecture BHV2 of ADD is signal temp : unsigned(16 downto 0); process(input1, input2) temp <= unsigned("0"&input1) + unsigned("0"&input2); output <= std_logic_vector(temp(15 downto 0)); overflow <= std_logic(temp(16)); end BHV2; architecture BHV3 of ADD is signal temp : unsigned(16 downto 0); process(input1, input2) temp <= unsigned("0"&input1) + unsigned("0"&input2); output <= std_logic_vector(temp(15 downto 0)); overflow <= std_logic(temp(16)); end BHV3; architecture BHV4 of ADD is process(input1, input2) variable temp : unsigned(16 downto 0); temp := unsigned("0"&input1) + unsigned("0"&input2); output <= std_logic_vector(temp(15 downto 0)); overflow <= std_logic(temp(16)); end BHV4; architecture BHV5 of ADD is signal temp : unsigned(16 downto 0); temp <= unsigned("0"&input1) + unsigned("0"&input2); output <= std_logic_vector(temp(15 downto 0)); overflow <= std_logic(temp(16)); end BHV5;

5) (14 points) Fill in the code provided below to create a series of flip flops (FFs) to delay an input by a fixed number of cycles. Assume you are given the shown FF component. The length of the series is specified by the generic cycles. You must use a structural architecture with the provided generate loop. The circuit should look like this: output FF.... FF FF input library ieee; use ieee.std_logic_1164.all; entity delay is generic ( cycles : positive := 8); clk, rst, input : in std_logic; output : out std_logic); end delay; architecture STR of delay is component ff clk, rst, input : in std_logic; output : out std_logic); end component; U_DELAY : for i in 0 to cycles-1 generate U_FF : entity work.ff port map ( ); end generate U_DELAY; end STR;

6) (15 points) Fill in the skeleton code to implement the following Moore finite state machine, using the 2 process FSM model. Assume that if an edge does not have a corresponding condition, that edge is always taken on a rising clock edge. Assume that INIT is the start state. Use the next page if extra room is needed. library ieee; use ieee.std_logic_1164.all; entity fsm is clk, rst, go : in std_logic; x : out std_logic_vector(1 downto 0)); end fsm; architecture PROC2 of fsm is type STATE_TYPE is (INIT, COUNT1, COUNT2, DONE); signal state, next_state : STATE_TYPE; process(clk, rst) if (rst = '1') then elsif (clk'event and clk = '1') then end if; process( )

end PROC2;

7) a. (5 points) True/false. A hierarchical carry lookahead adder reduces area overhead compared to a single level carry lookahead adder without increasing propagation delay. b. (5 points) Define the 4 th carry bit (c 4 ) of a carry lookahead adder in terms of each propagate bit (p i ), each generate bit (g i ) and the carry in (c 0 ). c. (5 points) What advantage does a ripple carry adder have over a carry lookahead adder?