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

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

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

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: 5 (5 points) 2 (8 points) 6 (10 points) 7b (13 points) 7c (13 points) 7d (13 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: 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)

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

EEL 4712 Digital Design Test 1 Spring Semester 2007

EEL 4712 Digital Design Test 1 Spring Semester 2008

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

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

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

VHDL Examples Mohamed Zaky

The block diagram representation is given below: The output equation of a 2x1 multiplexer is given below:

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

Sequential Logic - Module 5

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

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

Multi-valued Logic. Standard Logic IEEE 1164 Type std_ulogic is ( U, uninitialized

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

CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis. Register File: An Example. Register File: An Example (cont d) Aleksandar Milenkovic

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

VHDL. Official Definition: VHSIC Hardware Description Language VHISC Very High Speed Integrated Circuit

Introduction to VHDL #2

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

Basic Language Concepts

Getting Started with VHDL

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

VHDL for FPGA Design. by : Mohamed Samy

ECE 545 Lecture 7. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. Mixing Design Styles. George Mason University

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

VHDL in 1h. Martin Schöberl

Mridula Allani Fall Fall

Test Benches - Module 8

ECE 459/559 Secure & Trustworthy Computer Hardware Design

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

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

VHDL: Code Structure. 1

Introduction to VHDL #3

Introduction to VHDL

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

Digital Systems Design

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

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

Advanced Training Course on FPGA Design and VHDL for Hardware Simulation and Synthesis. 26 October - 20 November, 2009

VHDL for Modeling - Module 10

310/ ICTP-INFN Advanced Tranining Course on FPGA and VHDL for Hardware Simulation and Synthesis 27 November - 22 December 2006

ECE 545 Lecture 8. Data Flow Description of Combinational-Circuit Building Blocks. George Mason University

Summary of FPGA & VHDL

Concurrent & Sequential Stmts. (Review)

[VARIABLE declaration] BEGIN. sequential statements

Abi Farsoni, Department of Nuclear Engineering and Radiation Health Physics, Oregon State University

VHDL HIERARCHICAL MODELING

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

VHDL. Chapter 7. Behavioral Modeling. Outline. Behavioral Modeling. Process Statement

Hardware Description Language VHDL (1) Introduction

Lecture 9. VHDL, part IV. Hierarchical and parameterized design. Section 1 HIERARCHICAL DESIGN

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

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

Control and Datapath 8

ECE 545 Lecture 9. Modeling of Circuits with a Regular Structure. Aliases, Attributes, Packages. George Mason University

ECEU530. Last Few Lectures. ECE U530 Digital Hardware Synthesis. What is on Quiz 2. Projects. Today:

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

Lecture 12 VHDL Synthesis

EITF35: Introduction to Structured VLSI Design

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

Sequential Statement

Lattice VHDL Training

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

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

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

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

Advanced Electronics Lab.

Computer-Aided Digital System Design VHDL

-- Fill in values for each generic. -- Fill in values for each signal. SIGNAL load_start : std_ulogic := '1'; SIGNAL clock : std_ulogic := '0';

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

Design Guidelines for Using DSP Blocks

Basic Language Constructs of VHDL

EL 310 Hardware Description Languages Midterm

Design units can NOT be split across different files

VHDL Sequential Statements. Cristian Sisterna

COVER SHEET: Problem#: Points

VHDL simulation and synthesis

Field Programmable Gate Array

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

CONCURRENT STATEMENTS COMPONENT DECLARATION COMPONENT INSTANTIATION

SEQUENTIAL STATEMENTS

VHDL: RTL Synthesis Basics. 1 of 59

EITF35: Introduction to Structured VLSI Design

EECE 353: Digital Systems Design Lecture 10: Datapath Circuits

Hardware Description Languages. Modeling Complex Systems

EE434 ASIC & Digital Systems

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

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

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

EEL 4783: Hardware/Software Co-design with FPGAs

Transcription:

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: 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#: Points 1 (16 points) 2 (6 points) 3 (16 points) 4 (16 points) 5 (5 points) 6 (16 points) 7 (6 points) 8 (16 points) 9 (3 points) 3 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) (16 points) Fill in the following VHDL to implement the illustrated circuit. Assume that clk and rst connect to every register. All wires/operations are width bits. Ignore adder overflow. in1 library ieee; in2 in3 use ieee.std_logic_1164.all; use ieee.numeric_std.all; Reg Reg Reg in4 Reg entity example is generic ( width : positive := 16); clk,rst : in std_logic; in1, in2, in3, in4 : in std_logic_vector(width-1 downto 0); out1, out2 : out std_logic_vector(width-1 downto 0)); end example; + Reg + + architecture BHV of example is out1 out2 Reg signal reg_in1, reg_in2, reg_in3, reg_in4 : unsigned(width-1 downto 0); signal sum_no_reg : unsigned(width-1 downto 0); process(clk, rst) if (rst = '1') then reg_in1 <= (others => '0'); reg_in2 <= (others => '0'); reg_in3 <= (others => '0'); reg_in4 <= (others => '0'); out1 <= (others => '0'); out2 <= (others => '0'); elsif (clk'event and clk = '1') then reg_in1 <= unsigned(in1); reg_in2 <= unsigned(in2); reg_in3 <= unsigned(in3); reg_in4 <= unsigned(in4); out1 <= std_logic_vector(reg_in1 + reg_in2); out2 <= std_logic_vector(sum_no_reg + reg_in4); sum_no_reg <= reg_in2 + reg_in3; end BHV;

2) (6 points) Given the following entity, specify the widths of each instantiation in parts a-c. entity test is generic ( width : positive := 32); in1 : in std_logic_vector(width-1 downto 0); in2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0)); end test; a. U_A : entity work.test generic map (width => 16) port map (in1 => in1, in2 => in2, output => output); 16 b. U_B : entity work.test port map (in1 => in1, in2 => in2, output => output); 32 c. When entity test is used as the top-level entity. 32

3) (16 points) Fill out the outputs of the waveform for the following two architectures. Assume the left column is the start of the simulation. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity mult is generic( width : positive := 16); input1, input2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0); overflow : out std_logic); end mult; architecture BHV1 of mult is signal temp : unsigned(2*width-1 downto 0); process(input1, input2) temp <= unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); if (temp(2*width-1 downto width) = 0) then overflow <= '0'; else overflow <= '1'; end BHV1; input1 1 2 3 4 input2 10 5 3 5 output U 10 10 9 overflow U 0 0 0 architecture BHV2 of mult is process(input1, input2) variable temp : unsigned(2*width-1 downto 0); temp := unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); if (temp(2*width-1 downto width) = 0) then overflow <= '0'; else overflow <= '1'; end BHV2; input1 1 2 3 4 input2 10 5 3 5 output 10 10 9 20 overflow 0 0 0 0

4) (16 points points) a. Identify any violations of the synthesis coding guidelines for combinational logic and b. specify the effect on the synthesized circuit. library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity mult is generic( width : positive := 16); input1, input2 : in std_logic_vector(width-1 downto 0); output : out std_logic_vector(width-1 downto 0); overflow : out std_logic); end mult; architecture BHV4 of mult is process(input1, input2) variable temp : unsigned(2*width-1 downto 0); temp := unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); if (temp(2*width-1 downto width) /= 0) then overflow <= '1'; end BHV4; a. Overflow isn t specified on the else path b. Infers a latch 5) (5 points) The following code is correct and will synthesize to combinational logic, but what suggestion does it not follow? architecture BHV3 of mult is signal temp : unsigned(2*width-1 downto 0) := (others => '0'); temp <= unsigned(input1) * unsigned(input2); output <= std_logic_vector(temp(width-1 downto 0)); process(temp) if (temp(2*width-1 downto width) = 0) then overflow <= '0'; else overflow <= '1'; end BHV3; Signals and variables should not be initialized in synthesizable code.

6) (16 points) Fill in the provided code to create the illustrated structural architecture using a series of pre-existing ff and mux2x1 components. Use the component declarations to determine their I/O. Note that there are a total of width registers and width-1 muxes. The shift input acts as the select for all muxes. library ieee; use ieee.std_logic_1164.all; entity test is generic(width : positive := 8); clk, rst, shift, input : in std_logic; output : out std_logic); end test; architecture STR of test is component ff clk, rst, D : in std_logic; Q : out std_logic); end component; component mux2x1 in1, in2, sel : in std_logic; output : out std_logic); end component; signal q : std_logic_vector(width-1 downto 0); signal mux_out : std_logic_vector(width-1 downto 1); U_FF0 : ff port map ( clk => clk, rst => rst, d => input, q => q(0) ); U_FFS : for i in 1 to width-1 generate U_FF : ff port map ( clk => clk, rst => rst, d => mux_out(i), q => q(i) ); U_MUX : mux2x1 port map ( in1 => input, in2 => q(i-1), sel => shift, output => mux_out(i) ); end generate U_FFS; output <= q(width-1); end STR; output FF........ FF FF input FF

7) a. (2 points) What is the propagation delay of operations during a functional simulation? 0 b. (2 points) What file represents the vhdl for a synthesized circuit used in timing simulations? VHO c. (2 points) What file specifies propagation delays of signals during timing simulations? SDO 8) a. (9 points) Define the logic for the first 3 carry outs (c 1 to c 3 ) of a carry lookahead adder (CLA) in terms of the propagate signals (p i ), generate signals (g i ), and carry in (c 0 ). c1 = g0 + p0c0 c2 = g1 + p1g0 + p1p0c0 c3 = g2 + p2g1 + p2p1g0 + p2p1p0c0 b. (2 points) Define the propagate signal (p i ) in terms of adder inputs x i and y i. pi = xi + yi c. (2 points) Define the generate signal (g i ) in terms of adder inputs x i and y i. gi = xi and yi d. (3 points) True/false. Adding extra levels of carry lookahead logic trades off propagation delay for reduced area compared to a single-level carry lookahead adder. true 9) 3 free points for having to take a test at 8:30am.