Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CPE 426 Midterm: VHDL Programming at UAH ECE Department, Exams of Engineering

A midterm exam for the cpe 426: vhdl programming course offered by the university of alabama in huntsville's ece department. The exam covers various topics such as creating vhdl entities and architectures, understanding synthesizable subsets, writing vhdl functions, and implementing concurrent and sequential statements. Students are required to answer multiple-choice, short-answer, and design questions.

Typology: Exams

Pre 2010

Uploaded on 07/22/2009

koofers-user-1sb-1
koofers-user-1sb-1 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 6

Toggle sidebar

Related documents


Partial preview of the text

Download CPE 426 Midterm: VHDL Programming at UAH ECE Department and more Exams Engineering in PDF only on Docsity! The University of Alabama in Huntsville ECE Department CPE 426 01 Midterm Exam October 16, 2007 Name: _______________________________ 1. (15 points) (a) ( 4 points) Create a VHDL entity named mux_16_to_1 that represents a 16 to 1 multiplexor. (b) (11 points) Create a VHDL architecture representing a structural model of the 16 to1 mux using as many mux_4_to_1 muxes as are needed. You do not need to write an entity or an architecture for mux_4_to_1. You may also assume that a component has already been declared and that no configuration statement is required. 2. (1 point) The synthesizable subset of VHDL is standard. (True/False) _____ 3. (20 points).(a) (12 points) Write a VHDL function that will take two integer vectors, A and B, and find the dot product C = ฮฃ ai * bi. The function call should be of the form DOT(A,B), where A and B are integer vector signals. Use attributes inside the function to determine the length and range of the vectors. Make no assumptions about the high and low values of the ranges. For example, A(3 downto 1) = (1,2,3), B(3 downto 1) = (4,5,6), C = 3*6 + 2*5 + 1*4 = 32. A(0 to 4) = (1,3,5,7,9), B(9 downto 5) = (2,4,6,8,10) = 1*2 + 3*4 + 5*6 + 7*8 + 9*10 = 190 Output a warning if the ranges are not the same. (b)(8 points) Show an architecture that includes two calls to the function with the following properties. 1 - returns a value, 2 โ€“ triggers a warning message. 13. (15 points) Design a priority encoder that is described by the following truth table. (d is for donโ€™t care)(a)(3 points) Write a VHDL entity. (b) (6 points) Use concurrent signal assignments to implement the architecture. (c) (6 points) Use sequential statements to implement the architecture. Include any necessary library references. Inputs Outputs D0 D1 D2 D3 x y v 0 0 0 0 Z Z 0 1 0 0 0 0 0 1 d 1 0 0 0 1 1 d d 1 0 1 0 1 d d d 1 1 1 1 14. (10 points) Draw the state diagram for the following state machine. Is it a Moore machine or a Mealy machine? ENTITY state_machine IS PORT (sig_in ; IN BIT; clk, rst : IN BIT; sig_out : OUT BIT); END state_machine; ARCHITECTURE state_machine OF state_machine IS TYPE state_type IS (a, b, c, d, e); SIGNAL current_state, next_state : state_type; BEGIN PROCESS (sig_in, current_state) BEGIN sig_out <= โ€˜0โ€™; next_state <= c; CASE current_state WHEN a => IF sig_in = โ€˜0โ€™ THEN next_state <= a; sig_out <= โ€˜1โ€™; ELSE next_state <= d; sig_out <= โ€˜1โ€™; END IF; WHEN b => IF sig_in = โ€˜0โ€™ THEN next_state <= b; ELSE next_state <= c; END IF; sig_out <= โ€˜1โ€™; WHEN c => IF sig_in = โ€˜1โ€™ THEN sig_out <= โ€˜1โ€™; next_state <= a; ELSE next_state <= b; END IF; sig_out <= โ€˜1โ€™; WHEN d => IF sig_in = โ€˜0โ€™ THEN next_state <= e; END IF; WHEN e => IF sig_in = โ€˜1โ€™ THEN next_state <= c; END IF; END CASE; END PROCESS; PROCESS (clk) BEGIN IF (rst = โ€˜0โ€™) then current_state <= a; ELSIF (clkโ€™EVENT AND clk = โ€˜1โ€™) THEN current_state <= next_state; END IF; END PROCESS; END state_machine;
Docsity logo



Copyright ยฉ 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved