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

Similar documents
Sequential Logic - Module 5

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

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

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

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

The University of Alabama in Huntsville ECE Department CPE Midterm Exam February 26, 2003

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

Lecture 12 VHDL Synthesis

Summary of FPGA & VHDL

VHDL simulation and synthesis

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

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

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

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

Control and Datapath 8

Inferring Storage Elements

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

3 Designing Digital Systems with Algorithmic State Machine Charts

Problem Set 10 Solutions

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

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

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

A bird s eye view on VHDL!

Lecture 08 Finite State Machine Design Using VHDL

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

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

CprE 583 Reconfigurable Computing

Luleå University of Technology Kurskod SMD152 Datum Skrivtid

Lab 3. Advanced VHDL

The University of Alabama in Huntsville ECE Department CPE Final Exam April 28, 2016

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

VHDL in 1h. Martin Schöberl

Assignment. Last time. Last time. ECE 4514 Digital Design II. Back to the big picture. Back to the big picture

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.

[VARIABLE declaration] BEGIN. sequential statements

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

Sequential Statement

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

Digital Systems Design

ELCT 501: Digital System Design

CCE 3202 Advanced Digital System Design

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

VHDL: RTL Synthesis Basics. 1 of 59

CCE 3202 Advanced Digital System Design

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

EL 310 Hardware Description Languages Midterm

ECEU530. Schedule. ECE U530 Digital Hardware Synthesis. Datapath for the Calculator (HW 5) HW 5 Datapath Entity

Writing VHDL for RTL Synthesis

Field Programmable Gate Array

Part 4: VHDL for sequential circuits. Introduction to Modeling and Verification of Digital Systems. Memory elements. Sequential circuits

EITF35: Introduction to Structured VLSI Design

In our case Dr. Johnson is setting the best practices

ECE 545 Lecture 12. Datapath vs. Controller. Structure of a Typical Digital System Data Inputs. Required reading. Design of Controllers

Timing in synchronous systems

DESIGN AND IMPLEMENTATION OF MOD-6 SYNCHRONOUS COUNTER USING VHDL

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

Concurrent & Sequential Stmts. (Review)

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

Introduction to VHDL #3

ECE Digital Design Laboratory. Lecture 3 Finite State Machines!

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

Programable Logic Devices

Creating Safe State Machines

8 Register, Multiplexer and

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

VHDL for Modeling - Module 10

VHDL Examples Mohamed Zaky

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

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

The VHDL Hardware Description Language

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

Luleå University of Technology Kurskod SMD098 Datum Skrivtid

VHDL And Synthesis Review

UNIT I Introduction to VHDL VHDL: - V -VHSIC, H - Hardware, D - Description, L Language Fundamental section of a basic VHDL code Library :

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

Hardware Description Language VHDL (1) Introduction

10 Writing Circuit Descriptions

EEL 4712 Digital Design Test 1 Spring Semester 2007

Senior Project Design Review: Internal Hardware Design of a Microcontroller in VLSI

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 1

ECE 545 Lecture 6. Behavioral Modeling of Sequential-Circuit Building Blocks. Behavioral Design Style: Registers & Counters.

Lecture 3 Introduction to VHDL

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)

ECE 459/559 Secure & Trustworthy Computer Hardware Design

Computer-Aided Digital System Design VHDL

Example 58: Traffic Lights

CS/EE Homework 7 Solutions

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

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

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

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

Pollard s Tutorial on Clocked Stuff in VHDL

ECE 459/559 Secure & Trustworthy Computer Hardware Design

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

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

ECE 448 Lecture 3. Combinational-Circuit Building Blocks. Data Flow Modeling of Combinational Logic

!"#$%&&"'(')"*+"%,%-".#"'/"'.001$$"

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.

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

EE 459/500 HDL Based Digital Design with Programmable Logic. Lecture 6 Combinational and sequential circuits

Transcription:

The University of Alabama in Huntsville ECE Department CPE 526 01 Final Exam Solution Spring 2004 1. (15 points) An old Thunderbird car has three left and three right tail lights, which flash in unique patterns to indicate left and right turns. Left-turn pattern: Right-turn pattern: LC LB LA RA RB RC LC LB LA RA RB RC Design a Moore sequential network to control these lights using VHDL. The network has three inputs, LEFT, RIGHT, and HAZ. LEFT and RIGHT come from driver s turn-signal switch and cannot be 1 at the same time. As indicated above, when LEFT = 1, the lights flash in a pattern LA on, LA and LB on, LA, LB, and LC on and all off; then the sequence repeats. When RIGHT = 1, the light sequence is similar. IF a switch from LEFT to RIGHT (or vice versa) occurs in the middle of a flashing sequence, the network should immediately go to the IDLE state (lights off) and then start the new sequence. HAZ comes from the hazard switch, and when HAZ = 1, all six lights flash on and off in unison. HAZ takes precedence if LEFT or RIGHT is also on. Assume that a clock signal is available with a frequency equal to the desired flashing rate. LRH 000 S0 000000 100 010 0d0 S1 001000 S7 111111 S4 000100 d00 100 010 0d0 S2 011000 S5 000110 d00 100 010 dd0 S3 111000 S6 000111 dd0 library ieee; use ieee.std_logic_1164.all; entity THUNDERBIRD is port (L, R, H, CLK : in std_logic; LC, LB, LA, RA, RB, RC : out std_logic); end THUNDERBIRD;

architecture BEHAVE of THUNDERBIRD is type STATE_TYPE is (S0, S1, S2, S3, S4, S5, S6, S7); signal CURRENT_STATE, NEXT_STATE : STATE_TYPE; process(current_state, L, R, H) variable INPUTS : std_logic_vector(2 downto 0); INPUTS := L&R&H; case CURRENT_STATE is when S0 => if (INPUTS = "000") then elsif (INPUTS = "100") then NEXT_STATE <= S1; elsif (INPUTS = "010") then NEXT_STATE <= S4; when S1 => if (INPUTS(0) = '1') then elsif (INPUTS = "100") then NEXT_STATE <= S2; when S2 => if (INPUTS(0) = '1') then elsif (INPUTS = "100") then NEXT_STATE <= S3; when S3 S6 => if (INPUTS(0) = '1') then when S4 => if (INPUTS(0) = '1') then elsif (INPUTS = "010") then NEXT_STATE <= S5; when S5 => if (INPUTS(0) = '1') then elsif (INPUTS = "010") then NEXT_STATE <= S6; when S7 => end case;

process (CLK) if (CLK'event and CLK = '1') then CURRENT_STATE <= NEXT_STATE; process(current_state) LC <= '0'; LB <= '0'; LA <= '0'; RA <= '0'; RB <= '0'; RC <= '0'; case CURRENT_STATE is when S0 => null; when S1 => LA <= '1'; when S2 => LA <= '1'; LB <= '1'; when S3 => LA <= '1'; LB <= '1'; LC <= '1'; when S4 => RA <= '1'; when S5 => RA <= '1'; RB <= '1'; when S6 => RA <= '1'; RB <= '1'; RC <= '1'; when S7 => LA <= '1'; LB <= '1'; LC <= '1'; RA <= '1'; RB <= '1'; RC <= '1'; end case; end BEHAVE; 2. (1 point) Routing is the process of making the connections between standard cells. 3. (5 points) If the NRE costs for FPGA and CBIC circuits are $21,000 and $187,000, respectively, and the cost of individual parts for FPGA and CBIC circuits are $15 and $7, respectively, what is the breakeven manufacturing volume for these two types of circuits? Let x be the break-even volume. $21,000 x $15 = $187,000 x $7 x $8 = $166,000 x = 20,750 4. (5 points) What kind of hardware element will be inferred by a synthesis tool from the following model? Answer: A flip-flop (because of edge behavior) with synchronous reset. library ieee; use ieee.std_logic_1164.all; entity WIDGET is Port (A, B : in SIGNED (0 to 2); CLK, RESET : in std_logic; Z : out SIGNED(0 to 2)); end WIDGET; architecture EXAMPLE of WIDGET is process (CLK, RESET) if (CLK event and CLK = 1 ) then if (RESET = 1 ) then

Z <= 0 ; Z <= A nor B; end EXAMPLE; 5. (10 points) For the data lifetime chart shown, use the left edge algorithm to obtain an efficient register allocation. A B C D E F G H I J K L S1 X X X S2 X X X X S3 X X X X X X S4 X X X X X X S5 X X X X X X X S6 X X X X X S7 X X X D C G J B F K I A L H E S1 X X X S2 X X X X S3 X X X X X X S4 X X X X X X S5 X X X X X X X S6 X X X X X S7 X X X R1 R2 R3 R4 R5 R6 R7 S1 D C G S2 J C G B S3 J F G B K I S4 A F L B K I S5 A F L H K I E S6 A L H I E S7 L I E 6. (1 point) Typically, a test bench is developed to validate a VHDL behavioral model. 7. (1 point) A(n) SDF file provides the gate-level circuit with accurate timing backannotated from the layout. 8. (1 point) Pragmas are inserted into VHDL models to give instructions to synthesis or other tools.

9. (15 points) Create a VHDL entity named en_dec_328 that represents a 3-to-8 decoder with an active-low enable input which has an architecture which uses a case statement to represent the functionality of the decoder. Create a second entity and its accompanying architecture that represents a 4- to-16 decoder by using two instances of the en_dec_328 entity. entity EN_DEC_328 is port (EN : in std_logic; I : in std_logic_vector (2 downto 0); O : out std_logic_vector (7 downto 0)); end EN_DEC_328; architecture BEHAV of EN_DEC_3TO8 is process(en, I) case EN is when '0' => case I is when "000" => O <= "00000001"; when "001" => O <= "00000010"; when "010" => O <= "00000100"; when "011" => O <= "00001000"; when "100" => O <= "00010000"; when "101" => O <= "00100000"; when "110" => O <= "01000000"; when "111" => O <= "10000000"; when others => O <= "00000000"; end case; when others => O <= "00000000"; end case; end BEHAV; library ieee; use ieee.std_logic_1164.all; entity DEC_4TO16 is port (I : in std_logic_vector(3 downto 0); O : out std_logic_vector(15 downto 0)); end DEC_4TO16; architecture STRUCT of DEC_4TO16 is signal I3BAR : std_logic; component EN_DEC_3TO8C port (EN : in std_logic; I : in std_logic_vector(2 downto 0); O : out std_logic_vector(7 downto 0)); end component; for all : EN_DEC_3TO8C use entity work.en_dec_3to8(behav); I3BAR <= not I(3); U1 : EN_DEC_3TO8C port map (I(3), I(2 downto 0), O(7 downto 0)); U2 : EN_DEC_3TO8C port map(i3bar, I(2 downto 0), O(15 downto 8)); end;

10. (5 points) Draw the transistor-level diagram of a CMOS two-input NOR gate. VCC x y f x y GND GND 11. (15 points) Modify the following VHDL model to use block(s) instead of processes. library ieee; use ieee.std_logic_1164.all; entity BUFF_REG is generic (STRB_DEL, EN_DEL, ODEL: TIME); port (DI: in std_logic_vector (1 to 8); DS1, NDS2, STRB : in std_logic; DO: out std_logic_vector (1 to 8)); end BUFF_REG; architecture THREE_PROC of BUFF_REG is signal REG : std_logic_vector (1 to 8); signal ENBLD : std_logic; PREG: process (STRB) if (STRB = 1 ) then REG <= DI after STRB_DEL; end process PREG; ENABLE : process (DS1, NDS2) ENBLD <= DS1 and not NDS2 after EN_DEL; end process ENABLE; OUTPUT : process (REG, ENBLD) if (ENBLD = 1 ) then DO <= REG after ODEL; DO <= ZZZZZZZZ after ODEL; end process OUTPUT; end THREE_PROC;

Consider the following VHDL code: ----------------------------------- -- Entity declaration ----------------------------------- entity SCHED2 is port (A, B, C, D, E, F: in INTEGER; CLK : in BIT; W, X, Y: out INTEGER); end SCHED2; ----------------------------------- -- Architecture declaration ----------------------------------- architecture HIGH_LEVEL of SCHED2 is signal Z: INTEGER; X <= (A B) Z; Y <= (A B) Z; Z <= (C D) D (E F); W <= A/F CC D (A B); end HIGH_LEVEL; 12. (14 points) The following tasks refer to the VHDL code above. Assume that there are no hardware constraints.. a. (7 points) Derive an ASAP schedule. D C C A F A B C D E F D s0 A s1 1 2 / 3-4 5 6 s2 7 8 B Ready Schedule {1, 2, 3, 4,,5, 6} {1, 2, 3, 4, 5, 6} {7, 8} {7, 8} {9, 10} {9, 10} {11, 12, 13} {11, 12, 13} s3 9 10 s4 11 12 13 W b. (7 points) Derive an ALAP schedule. D C C A F A B C D E F s0 s1 3-5 X Y D A B Ready Schedule {11, 12, 13} {11, 12, 13} {2, 6, 9, 10} {2, 6, 9, 10} {1, 4, 7, 8} {1, 4, 7, 8} {3, 5} {3, 5} s2 7 4 8 1 s3 2 / 9 10 6 s4 11 12 13 W X Y

13. (10 points) Derive a list schedule using the critical path priority metric for the VHDL code above, using the following hardware constraint; all operations are done in an ALU module and there are two ALU modules available. Solution: Op Length 1 3 2 2 3 4 4 3 5 4 6 2 7 3 8 3 9 2 10 2 11 1 12 1 13 1 D C C A B C D E s0 A F s1 3-5 s2 1 4 s3 7 8 s4 2 / s5 9 10 s6 11 12 F D A 6 B List {3, 5, 1, 4, 7, 8, 2, 6, 9, 10, 11, 12, 13} Ready Schedule {1, 2, 3, 4, 5, 6} {3, 5} {1, 2, 4, 6, 7, 8} {1, 4} {2, 6, 7, 8} {7, 8} {2, 6, 9, 10} {2, 6} {9, 10} {9, 10} {11, 12, 13} {11, 12} {13} {13} s7 13 W X Y 14. (1 point ) Allocation, scheduling, compilation is one algorithmic-level synthesis task. 15. (1 point) Communication is the hardest problem.