Docsity

VHDL Exam 2 - Fall 2005 for ECE 4110 Sequential Logic Design, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 4110 - Sequential Logic Design
Exam 2 - Fall 2005
NOTES: Closed book, except one sheet of handwritten notes and the VHDL Quick
Reference Card are allowed. Show ALL your work for full credit. Please draw and write
NEATLY (If I cannot read it, I must mark it WRONG). Do all work in pencil and put all
answers on your engineering paper. Follow the specified class format. Clearly label all
answers with the problem number. Use only one side of your paper.
1. [40 pts] Concisely write the ARCHITECTURE portion of a VHDL file that has the
following ENTITY portion. Use the behavioral CASE style. Follow the standard VHDL
style regarding upper/lower case and indentation. It must implement the following truth
table, where don’t cares are indicated as “x”.
LIBRARY ieee ;
USE ieee.std_logic_1164.all ;
ENTITY xcvf IS
PORT ( a, b, c : IN STD_LOGIC ;
f, g : OUT STD_LOGIC ) ;
END xcvf ;
Truth Table:
a b c | f g
------|------
0 0 0 | 1 x
0 x 1 | 0 0
x 1 0 | 1 1
1 0 0 | x 0
1 x 1 | 0 1
pf2

Partial preview of the text

Download VHDL Exam 2 - Fall 2005 for ECE 4110 Sequential Logic Design and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE 4110 - Sequential Logic Design

Exam 2 - Fall 2005

NOTES: Closed book, except one sheet of handwritten notes and the VHDL Quick

Reference Card are allowed. Show ALL your work for full credit. Please draw and write

NEATLY (If I cannot read it, I must mark it WRONG). Do all work in pencil and put all

answers on your engineering paper. Follow the specified class format. Clearly label all

answers with the problem number. Use only one side of your paper.

1. [40 pts] Concisely write the ARCHITECTURE portion of a VHDL file that has the

following ENTITY portion. Use the behavioral CASE style. Follow the standard VHDL

style regarding upper/lower case and indentation. It must implement the following truth

table, where don’t cares are indicated as “x”.

LIBRARY ieee ; USE ieee.std_logic_1164.all ;

ENTITY xcvf IS PORT ( a, b, c : IN STD_LOGIC ; f, g : OUT STD_LOGIC ) ; END xcvf ;

Truth Table:

a b cf g
0 0 01 x
0 x 10 0
x 1 01 1
1 0 0x 0
1 x 10 1

2. [30 pts] Analyze the following VHDL code and draw the logic diagram directly

implied by the VHDL code in terms of gates, without any simplification, clearly

separating the conditional and output sections of the logic diagram.

LIBRARY ieee ; USE ieee.std_logic_1164.all ;

ENTITY problem IS PORT ( a : IN STD_LOGIC_VECTOR(1 DOWNTO 0) ; b, c, d : IN STD_LOGIC ; s : OUT STD_LOGIC ) ; END problem ; ARCHITECTURE behav OF problem IS BEGIN PROCESS (a, b, c, d) BEGIN IF (a = "10") THEN s <= NOT c ; ELSIF (b /= '1') THEN s <= c XOR d ; ELSE s <= '1' ; END IF ; END PROCESS ; END behav ;

3. [30 pts] As concisely as possible, complete the ARCHITECTURE portion of this

structural VHDL file that has been partially written for you. Write some FOR-

GENERATE code to instantiate 4 copies of the component “funky” with the following

wiring connections:

Funky # Port c(1) Port c(0) Port d(1) Port d(0)


1 r(1) r(0) m(0) m(2) 2 r(3) r(2) m(1) m(3) 3 m(0) m(1) s(3) s(2) 4 m(2) m(3) s(1) s(0)

LIBRARY ieee ; USE ieee.std_logic_1164.all ;

ENTITY gen IS PORT (r : IN STD_LOGIC_VECTOR(3 DOWNTO 0); s : OUT STD_LOGIC_VECTOR(3 DOWNTO 0) ); END gen ;

ARCHITECTURE Structure OF gen IS COMPONENT funky PORT (c : IN STD_LOGIC_VECTOR(1 DOWNTO 0); d : OUT STD_LOGIC_VECTOR(1 DOWNT0 0) ); END COMPONENT funky;

-- your code starts here