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

Final Exam Review for Electrical and Computer Engineering | CPE 426, Exams of Engineering

Material Type: Exam; Professor: Gaede; Class: VLSI HARDWARE DESC LANG/MODL/S; Subject: Computer Engineering; University: University of Alabama - Huntsville; Term: Spring 2003;

Typology: Exams

Pre 2010

Uploaded on 07/23/2009

koofers-user-8kt-1
koofers-user-8kt-1 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
1
Electrical and Computer Engineering
CPE 426/526 Spring 2003
Final Exam Review
with Problem Statements
and Solutions
Dr. Rhonda Kay Gaede
UAH
Electrical and Computer Engineering 2
UAH CPE 426/526
VHDL Problem Statement
Mod ify the foll owing VHD L mode l by ad ding a
par amete r tha t set s t he numbe r of f l ip-flo p s
in t he c ou nt e r. Also , add a n i np ut w hic h is
loaded w i th an a s yn chron o us lo a d input
si gnal w hic h is a ct iv e lo w .
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Final Exam Review for Electrical and Computer Engineering | CPE 426 and more Exams Engineering in PDF only on Docsity!

Electrical and Computer Engineering

CPE 426/526 Spring 2003

Final Exam Review

with Problem Statements

and Solutions

Dr. Rhonda Kay Gaede

UAH

Electrical and Computer Engineering

UAH CPE 426/

VHDL Problem Statement

Mod if y t he f oll o wing VHD L mode l b y ad ding a

p ar a m e te r t ha t set s t h e n u m be r of fl ip-fl o p s

i n t h e c o u n t e r. A ls o , a d d a n i n p u t w h i c h is

l o a d e d w i t h a n a s yn c h r o n o u s l o a d i n p u t

si g n a l w h i c h i s a c t iv e lo w.

Electrical and Computer Engineering

VHDL

use ieee.std_logic_unsigned.all; entity UPCOUNT is port ( CLOCK, RESETN, E : in std_logic; Q : out std_logic_vector (3 downto 0)); end UPCOUNT; architecture BEHAVIOR of UPCOUNT is signal COUNT : std_logic_vector (3 downto 0); begin process (CLOCK, RESETN) begin if RESETN = 0 then COUNT <= 0000 ; elsif (CLOCK event and CLOCK = 1 ) then if E = 1 then COUNT <= COUNT + 1; else COUNT <= COUNT; end if; end process; Q <= COUNT; end BEHAVIOR;

Electrical and Computer Engineering

UAH CPE 426/

VHDL Problem Solution

use ieee.std_logic_unsigned.all;

entity UPCOUNT is generic (N : integer); port ( CLOCK, RESETN, E : in std_logic; LD : in std_logic; LD_INPUT : in std_logic_vector(N_1 downto 0); Q : out std_logic_vector (N-1 downto 0)); end UPCOUNT;

Electrical and Computer Engineering

Synthesis Style Model

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 begin process (CLK, RESET) begin if (RESET = 1 then) Z <= 0 ;โ€˜ elsif (CLK = 1 ) then Z <= A nor B; end if; end process; end EXAMPLE;

Electrical and Computer Engineering

UAH CPE 426/

More Synthesis Style

Qu es t io n:

What ki nd of hardw are elem ent wi ll be inf erred by a sy nt hes is t ool fr om th e f oll owin g mo del?

An s w er:

Sy nopsy s : A la t c h, s i nc e E VE NT is n t pre s ent.

Leonard o: A fl ip -f lo p, s in c e EV ENT is i mp l ie d.

Electrical and Computer Engineering

Second Synthesis Style Model

entity WIDGET is Port (A, B : in SIGNED (0 to 2); CLK : in std_logic; Z : out SIGNED(0 to 2)); end WIDGET; architecture EXAMPLE of WIDGET is begin process (CLK) begin if (CLK = โ€˜1') then Z <= A nor B; end if; end process; end EXAMPLE;

Electrical and Computer Engineering

UAH CPE 426/

Scheduling Example

entity SCHED2 is port (A, B, C, D, E, F: in INTEGER; CLK : in BIT; W, X, Y: out INTEGER); end SCHED2; architecture HIGH_LEVEL of SCHED2 is signal Z: INTEGER; begin X <= (A โ€” B) * C * D; Y <= (A * B) + (E + F)/D; W <= (C + F) * B end HIGH_LEVEL;

Questio n:

Con sider t h e foll owi ng VH DL code. Ass umin g that there are no

h a r d wa r e c o n st rai n t s a n d t ha t y o u h av e a n A L U m od u l e t ha t

performs addi t i on, subtraction, m ultiplic ation, and divis ion, draw

a da t a flow graph.

Electrical and Computer Engineering

ALAP Scheduling Example Answer

Step Ready List Scheduled Items

n {3, 7, 9} 3, 7

n-1 {9, 1, 2, 4,

6, 8} 9, 1

n-2 {2, 4, 6, 8} 2, 4

n-3 {6, 8} 6, 8

n-4 {5} 5

So, n = 5.

--


A B


/

+

E F

+

*** +**

A B C D

X Y

D C F


B

W

1

2

3

4

5

6

7

8

9

S

S

S

S

S

Electrical and Computer Engineering

UAH CPE 426/

Left Edge Algorithm

A B C D E F G H I J K L S1 X X X S2 X X X X X S3 X X X X X S4 X X X X X S5 X X X X X

D C G E J B H F A I L K S1 X X X S2 X X X X X S3 X X X X X S4 X X X X X S5 X X X X X

R1 R2 R3 R4 R S1 D C G - - S2 B C G E J S3 B H G F J S4 B I L F A S5 K I L F A

Questio n:

Fo r t he da t a li f e t i m e c ha r t

s h o w n , u s e t h e l e f t e d g e

a l g o ri t h m t o o b t a i n a n

effic ient regis t e r alloca t i on.

Answ er:

S5 X X X X X

S4 XX X X X

S3 X XX X X

S2 X X X X X

S1 XX X

AB C D E F G HI J K L

Electrical and Computer Engineering

VHDL Modeling

  • Design a resetting sequential majority function that asserts (active high) the output if the past three inputs contain two or more 1 s. Assume a Moore machine.

Sample input/output sequences are given below.

  • X = 0101110110
  • Z = 0000010010

Electrical and Computer Engineering

UAH CPE 426/

VHDL Modeling Answer

entity SEQMAJ is

port (R, I, CLK: in BIT;

O : out BIT);

end SEQMAJ;

architecture FSM_RTL of SEQMAJ is

type STATE_TYPE is (S0, S1, S2, S3, S4, S5, S6, S7);

signal STATE: STATE_TYPE;

begin

Electrical and Computer Engineering

VHDL Modeling Answer (Continued)

when S6 => if (I = '0') then STATE <= S1; else STATE <= S2; end if; when S7 => if (I = '0') then STATE <= S1; else STATE <= S2; end if; end case; end if; end process NEXT_STATE;

Electrical and Computer Engineering

UAH CPE 426/

VHDL Modeling Answer (Continued)

-- Output process

OUTPUT: process (STATE) begin case STATE is when S7 => O <= '1'; when others => O <= '0'; end case; end process OUTPUT; end FSM_RTL;

Electrical and Computer Engineering

Implementation Medium Choice

Questio n:

If the NRE costs for FPG A and CBIC circui t s are

$25, 000 and $1 66,000, respec t i vely , and the cost o f

indi vidua l parts fo r FPG A and CB IC circuits are $

and $6, res pectivel y, w hat is the break -even

man ufacturing volum e for thes e two t y pes of circui t s?

Answ er:

25,0 00 + 2 0x = 16 6,000 + 6x

14x = 141,

x = 10,