EEL 4712 Digital Design Test 1 Spring Semester 2007

Similar documents
EEL 4712 Digital Design Test 1 Spring Semester 2008

EEL 4712 Digital Design Test 2 Spring Semester 2008

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

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

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

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: Problem#: Points. 7 (14 points) 6 (7 points) 9 (6 points) 10 (21 points) 11 (4 points)

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

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)

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)

Sequential Logic - Module 5

[VARIABLE declaration] BEGIN. sequential statements

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

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

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

DESCRIPTION OF DIGITAL CIRCUITS USING VHDL

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

Hardware Description Language VHDL (1) Introduction

VHDL And Synthesis Review

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

Sequential Statement

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

Control and Datapath 8

VHDL Examples Mohamed Zaky

VHDL. ELEC 418 Advanced Digital Systems Dr. Ron Hayne. Images Courtesy of Cengage Learning

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

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

Lecture 12 VHDL Synthesis

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

Lattice VHDL Training

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

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

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

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

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

EL 310 Hardware Description Languages Midterm

VHDL: RTL Synthesis Basics. 1 of 59

VHDL for FPGA Design. by : Mohamed Samy

ELCT 501: Digital System Design

Department of Electronics & Communication Engineering Lab Manual E-CAD Lab

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

Timing in synchronous systems

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

Advanced Electronics Lab.

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

Computer-Aided Digital System Design VHDL

VHDL for Modeling - Module 10

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

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

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

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

CS303 LOGIC DESIGN FINAL EXAM

1. What is y-chart? ans: The y- chart consists of three domains:- behavioral, structural and geometrical.

DIGITAL LOGIC DESIGN VHDL Coding for FPGAs Unit 6

Introduction to VHDL #3

VHDL in 1h. Martin Schöberl

EE434 ASIC & Digital Systems

DIGITAL LOGIC WITH VHDL (Fall 2013) Unit 6

Design Problem 3 Solutions

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

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

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

Digital Systems Design

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

Written exam for IE1204/5 Digital Design Thursday 29/

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

Inferring Storage Elements

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

VHDL is a hardware description language. The code describes the behavior or structure of an electronic circuit.

Introduction to VHDL. Yvonne Avilés Colaboration: Irvin Ortiz Flores Rapid System Prototyping Laboratory (RASP) University of Puerto Rico at Mayaguez

A bird s eye view on VHDL!

Chapter 6 Combinational-Circuit Building Blocks

Design a 4 bit-adder. Then design a 4-7 decoder to show the outputs. Output Sum(4 bits) Adder. Output carry(1 bit)

Basic Language Concepts

Review of Digital Design with VHDL

Concurrent & Sequential Stmts. (Review)

CCE 3202 Advanced Digital System Design

CprE 583 Reconfigurable Computing

ECE 545 Lecture 5. Data Flow Modeling in VHDL. George Mason University

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

Field Programmable Gate Array

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

Hardware Description Languages. Modeling Complex Systems

VHDL HIERARCHICAL MODELING

Summary of FPGA & VHDL

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

CS/EE Homework 7 Solutions

Lab 3: Standard Combinational Components

Test Benches - Module 8

Writing VHDL for RTL Synthesis

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

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

ECOM 4311 Digital Systems Design

Problem Set 10 Solutions

The VHDL Hardware Description Language

CCE 3202 Advanced Digital System Design

VHDL for Synthesis. Course Description. Course Duration. Goals

Transcription:

IMPORTANT: Please be neat and write (or draw) carefully. If we cannot read it with a reasonable effort, it is assumed wrong. COVER SHEET: Problem: Points: 1 (15 pts) 2 (20 pts) Total 3 (15 pts) 4 (18 pts) 5 (18 pts) 6. (14 pts) Re-Grade Information: 1

15 pts. 1. VHDL Analysis (circuit synthesis). Given the following ( non-sense ) VHDL specification, draw the circuit diagrams for the corresponding components. Draw them on the next page. LIBRARY ieee ; USE ieee.std_logic_1164.all ; ENTITY Test1P1 IS PORT ( A, B, C, D, E, G, I, J, CLK : IN STD_LOGIC ; Y : INOUT STD_LOGIC_VECTOR (2 DOWNTO 1) ); END Test1P1 ; ARCHITECTURE P1Arch OF Test1P1 IS COMPONENT LCX PORT (A: IN STD_LOGIC; X1, X2: OUT STD_LOGIC); END COMPONENT; SIGNAL TEMP1, TEMP2, TEMP3 : STD_LOGIC; PROCESS (A, C, E, TEMP1, CLK) IF TEMP1 = '0' THEN Y <= "00"; ELSIF (CLK'Event AND CLK = '1') Y(2) <= Y(1); CASE B IS WHEN '0' => Y(1) <= TEMP3 ; WHEN OTHERS => Y(1) <= D ; END CASE ; END IF; IF E = '0' THEN TEMP2 <= A; ELSE TEMP2 <= C; END IF; END PROCESS ; LCX port map(x1 =>J, X2 =>TEMP3, A =>TEMP2); TEMP1 <= G WHEN I = '0' ELSE J; END P1Arch ; 2

Problem 1: VHDL Analysis (circuit synthesis): Put your answer here. 2. VHDL specification. 20 pts. Complete the VHDL specification (on the next page) for the following circuit: 2 J-K flip-flops 2-to-1 MUX J1..J0 J1..J0 2-to-4 Decoder Q0 M0 K1..K0 K1..K0 CLK Q1 Z Y0 M1 X1 I1 CLK Y1 CLRn SEL X0 I0 Y2 SETn ENn EN Y3 OUTZ The logic for the decoder must be specified using a CASE statement. The logic for the MUX must be specified using a WITH-SELECT assignment statement. Each JK flip-flop has an asynchronous clear and an asynchronous set. (Clear has priority.) Each JK flip-flop can be constructed using a D flip-flop as shown. 3 J K /Q Q SETn D Q /Q CLRn Q /Q

Put solution for Problem 2 here: ENTITY Test1P2 IS PORT ( ENn, CLK : IN STD_LOGIC; X, J, K : IN STD_LOGIC_VECTOR(1 DOWNTO 0); OUTZ : OUT STD_LOGIC); END Test1P2 ; ARCHITECTURE P2Arch OF T1Prob2 IS SIGNAL Q: STD_LOGIC_VECTOR(0 TO 1); -- NOTE (0 TO 1) and not (1 DOWNTO 0) SIGNAL Y: STD_LOGIC_VECTOR(0 TO 3); -- NOTE (0 TO 3) and not (3 DOWNTO 0) SIGNAL PROCESS ( ) END PROCESS ; END P2Arch ; 4

15 pts. 3. Given the following VHDL code, draw the corresponding circuit and explain why it does or does not perform the switch-debouning function correctly on the push button signal (PB). LIBRARY ieee; USE ieee.std_logic_1164.all ; USE ieee.std_logic_unsigned.all ; ENTITY switch_debounce IS PORT ( PB, CLK : IN STD_LOGIC; dbpb : OUT STD_LOGIC ); END switch_debounce; ARCHITECTURE Behavior OF switch_debounce IS SIGNAL Q : STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL tempand : STD_LOGIC; PROCESS(PB) IF ( CLK EVENT AND CLK = '1' ) THEN FOR i IN 0 TO 2 loop Q(i) <= Q(i+1); tempand <= Q(i) AND tempand; end loop; Q(M-1) <= PB; dbpb <= tempand AND Q(3); END IF; END PROCESS; END Behavior; (b) Draw you circuit here: (14 pts.) (a) Yes or No (debounced correctly)? Explain: (1 pt.) 5

18 pts. 4. VHDL specification. Complete the VHDL specification for the ARCHITECTURE part (on the next page) for the following circuit: 3-bit counter X Resetn Clock Q(2) Q(1) Q(0) Z1 Z2 Count Sequence: 000 011 010 X 100 111 The 3-bit counter works as follows: It has a synchronous, active low Resetn to count Q[2..0] = 000. If Resetn = high, then it counts in a sequence as shown above: 000, 011. At Q[2..0] = 011, the next count is either 010 (if X = 0) or 100 (if X=1). In either case, it will then go to count 111, 011, etc. until Resetn is 0. From any illegal count (like 001 or 101), go to 000. Z1 = 1 whenever the count is 010. Z2 = 1 whenever the count is 100. Restriction: All your statements must be contained inside the PROCESS statement. You must use a CASE statement. ENTITY Counter3 IS PORT ( Clock, Resetn, X : IN STD_LOGIC; Q : OUT STD_LOGIC_VECTOR(2 DOWNTO 0); Z1,Z2 : OUT STD_LOGIC ); END Counter3 ; 6

ARCHITECTURE P4Arch OF Counter3 IS SIGNAL PROCESS ( ) END PROCESS ; END P4Arch ; 7

18 pts. 5. Generic VHDL and FOR statement Complete the code below to specify a generic M bit shift register that can shift left or right: When EN = 0, then the function is hold. When EN = 1 and LR = 0, it will shift left one bit, with LeftIN going into Q[0]. When EN = 1 and LR = 1, it will shift right one bit, with RightIN going into Q[M-1]. LIBRARY ieee; USE ieee.std_logic_1164.all ; ENTITY GenShiftReg IS GENERIC(M : INTEGER := 8); PORT ( EN, LR, LeftIN, RightIN, Clk : IN STD_LOGIC; Q : OUT STD_LOGIC_VECTOR (M-1 DOWNTO 0) ); END GenShiftReg; ARCHITECTURE GenShiftArch OF GenShiftReg IS SIGNAL PROCESS( ) -- You have to use a WAIT UNTIL statement. WAIT UNTIL ( ) END PROCESS; ENDGenShiftArch; 8

14 pts. 6(a and b) Lab (LSA) Question The signals A, B, C, and CLK represent synchronous outputs from your BT-U board. The LSA is connected to your board in the following fashion: LSA channel Signal name 16 A 17 B 18 C 31 CLK Let assume that actual signals behave as follows (vs. what is captured by an LSA). Name 0ns 20ns 40ns 60ns 80ns 100ns 120ns 140ns 160ns 180ns 200ns 220ns A B C CLK Draw the data that would be captured by the LSA, as it would appear on the screen, for each of the following scenarios: 6(a) The LSA is sampling using Channel 17 (signal B) as the trigger. Assume the first sample is taken at 30 ns. Draw your answer for part a: (4 pts.) Name CH-16 CH-16 0ns 20ns 40ns 60ns 80ns 100ns 120ns 140ns 160ns 180ns 200ns 220ns CH-17 CH-18 CH-31 6(b) The LSA is sampling using an internal 25 MHz clock source (i.e. 40 ns). Assume the first sample is taken just a 10 ns. Draw your answer for part b: (4 pts.) Name CH-16 CH-16 0ns 20ns 40ns 60ns 80ns 100ns 120ns 140ns 160ns 180ns 200ns 220ns CH-17 CH-18 CH-31 9

6(c) LCA adder (4 pts.) For an n-bit adder, the inputs are A(n-1)..A(0) and B(n-1)..B(0) and carry-in C(0). The outputs are SUM(n-1)..SUM(0) and carry-out C(n). (5 pts.) For an n-bit look-ahead carry generator, the equation for carry-out of stage i" is: C(i+1) = G(i) OR P(i) AND C(i) What is the equation for C(3) as a SOP function of P(i) s, G(i) s, and C(0)? C(3) = What is the equation for C(n) as a SOP function of P(i) s, G(i) s, and C(0)? C(n) = 6(d) Addition overflow (2 pts.) Complete the following two sentences concerning overflow in English (no formulas): When adding 2 unsigned binary number, there is an overflow when When adding two 2 s complement numbers, there is an overflow when 10

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; SIGNAL signal_name : STD_LOGIC; -- Process Statement -- Concurrent Signal Assignment -- Conditional Signal Assignment -- Selected Signal Assignment -- Component Instantiation Statement END a; SIGNAL signal_name : type_name; 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; loop_label: FOR index_variable IN range_low TO range_high LOOP statement1; statement2; END LOOP loop_label; WAIT UNTIL expression; CASE expression IS WHEN constant_value => WHEN constant_value => WHEN OTHERS => END CASE; 11