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

Midterm Exam Solutions for CPE/EE 422/522 at UAH - ECE Department, Exams of Electrical and Electronics Engineering

Solutions to the midterm exam questions for the cpe/ee 421/521 course offered by the university of alabama in huntsville - ece department. The solutions cover topics such as sequential networks, vhdl descriptions, timing diagrams, and combinational logic. Students can use these solutions to check their understanding of the concepts covered in the exam.

Typology: Exams

Pre 2010

Uploaded on 07/23/2009

koofers-user-2ke
koofers-user-2ke ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 6

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
The University of Alabama in Huntsville
ECE Department
CPE/EE 422/522 01
Midterm Exam Solution
1. (10 points) A sequential network consists of a PLA and a D flip-flop, as shown. The propagation
delay for the PLA is in the range 5 to 10 ns, and the propagation delay from clock to output of the
D flip-flop is 5 to 10 ns. Assuming that X always changes at the same time as the falling edge of
the clock, what is the maximum setup and hold time specifications that the flip-flop can have and
still maintain proper operation of the network?
PLA
Clk
D
Q
Z
X
X
Clk
2
0
4
0
8
0
6
0
1
0
0
Q
Z
For both the setup time and hold time, there are two paths to consider, one from X to the D input of the
flip-flop and the other from Q to the D input of the flip-flop. From the timing diagram, tck = 40 ns, tx =
20 ns and ty = 20 ns, where tck is the clock period, tx is the time from a change on X to the active edge of
the clock and ty is the time from the active edge of the clock to a change on X. The following equations
apply: For Q: (1) tck โ‰ฅ tpdmax + tcmax + tsu, (2) th โ‰ฅ tpdmin + tcmin
For X: (3) tx โ‰ฅ tsu + tcmax, (4) th โ‰ฅ ty + tcmin
where tpd is the propagation delay through the flip-flop and tc is the propagation delay through the
combinational circuit (PLA)
So, for setup, So, for hold,
(1) 40 ns โ‰ฅ 10 ns + 10 ns + t su, tsu โ‰ค 20 ns (2) th โ‰ฅ 5 ns + 5 ns, th โ‰ฅ 10 ns
(3) 20 ns โ‰ฅ tsu + 10 ns , tsu โ‰ค 10 ns (4) th โ‰ฅ 20 ns + 5 ns, th โ‰ฅ 25 ns
For both the setup and the hold times to be always satisfied, we must take the smaller numbers so
tsu = th = 10 ns
2. (10 points) Write a short VHDL description of a 4-to-1 multiplexer using a VHDL process.
entity MUX4_1 is
port (I3, I2, I1, I0, S1,S0 : in bit;
F : out bit);
end MUX4_1;
architecture MUX4_1of MUX4_1 is
begin
process (I3, I2, I1, I0, S1, S0)
begin
if (S1 = โ€˜0โ€™ and S0 = โ€˜0โ€™) then
F <= I0;
elsif (S1 = โ€˜0โ€™ and S0 = โ€˜1โ€™) then
F <= I1;
elsif (S1 = โ€˜1โ€™ and S0 = โ€˜0โ€™) then
F <= I2;
else
F <= I3;
end if;
end MUX4_1;
pf3
pf4
pf5

Partial preview of the text

Download Midterm Exam Solutions for CPE/EE 422/522 at UAH - ECE Department and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

The University of Alabama in Huntsville

ECE Department

CPE/EE 422/522 01

Midterm Exam Solution

  1. (10 points) A sequential network consists of a PLA and a D flip-flop, as shown. The propagation delay for the PLA is in the range 5 to 10 ns, and the propagation delay from clock to output of the D flip-flop is 5 to 10 ns. Assuming that X always changes at the same time as the falling edge of the clock, what is the maximum setup and hold time specifications that the flip-flop can have and still maintain proper operation of the network?

PLA Clk

D

Q

Z X

X

Clk

20 40 60 80 100

Q

Z

For both the setup time and hold time, there are two paths to consider, one from X to the D input of the flip-flop and the other from Q to the D input of the flip-flop. From the timing diagram, tck = 40 ns, tx = 20 ns and ty = 20 ns, where tck is the clock period, tx is the time from a change on X to the active edge of the clock and ty is the time from the active edge of the clock to a change on X. The following equations apply: For Q: (1) t (^) ck โ‰ฅ t (^) pdmax + tcmax + tsu , (2) th โ‰ฅ t (^) pdmin + tcmin For X: (3) t (^) x โ‰ฅ t (^) su + tcmax , (4) t (^) h โ‰ฅ t (^) y + tcmin where t (^) pd is the propagation delay through the flip-flop and t (^) c is the propagation delay through the combinational circuit (PLA)

So, for setup, So, for hold, (1) 40 ns โ‰ฅ 10 ns + 10 ns + t (^) su , tsu โ‰ค 20 ns (2) t (^) h โ‰ฅ 5 ns + 5 ns, th โ‰ฅ 10 ns (3) 20 ns โ‰ฅ t (^) su + 10 ns , tsu โ‰ค 10 ns (4) t (^) h โ‰ฅ 20 ns + 5 ns, th โ‰ฅ 25 ns

For both the setup and the hold times to be always satisfied, we must take the smaller numbers so t (^) su = th = 10 ns

  1. (10 points) Write a short VHDL description of a 4-to-1 multiplexer using a VHDL process.

entity MUX4_1 is port (I3, I2, I1, I0, S1,S0 : in bit; F : out bit); end MUX4_1; architecture MUX4_1of MUX4_1 is begin process (I3, I2, I1, I0, S1, S0) begin if (S1 = โ€˜0โ€™ and S0 = โ€˜0โ€™) then F <= I0; elsif (S1 = โ€˜0โ€™ and S0 = โ€˜1โ€™) then F <= I1; elsif (S1 = โ€˜1โ€™ and S0 = โ€˜0โ€™) then F <= I2; else F <= I3; end if; end MUX4_1;

3. (15 points) For the following VHDL, assume that A changes to โ€˜1โ€™ at 5 ns. Give the values of A,

B, C, D, E, and F each time a change occurs. Carry this out until no further change occurs. I

entity prob is port (D : inout bit); end prob;

architecture PROB of PROB is signal A, B, C, E, F : bit; begin P1: process (A, C) begin B <= A after 3 ns; E <= C after 5 ns; end process P1; C1: C <= A after 10 ns; P2: process (C, E) begin F <= C and E after 4 ns; end process P2; C2: D <= A or B or C or F after 1 ns; end PROB;

Time A B C D E F

0 ns 0 0 0 0 0 0

5 ns 1 0 0 0 0 0

6 ns 1 0 0 0 0 0

8 ns 1 1 0 1 0 0

15 ns 1 1 1 1 0 0

20 ns 1 1 1 1 1 0

24 ns 1 1 1 1 1 1

Time Event Process Triggered Scheduled Transaction Event?

5 ns A โ†’ โ€˜1โ€™ P1 B โ€˜1โ€™ 8 ns Yes

P1 E โ€˜0โ€™ 10 ns No

C1 C โ€˜1โ€™ 15 ns Yes

C2 D โ€˜1โ€™ 6 ns Yes

6 ns D โ†’ โ€˜1โ€™ none

8 ns B โ†’ โ€˜1โ€™ C2 D โ€˜1โ€™ 9 ns No

15 ns C โ†’ โ€˜1โ€™ P1 B โ€˜1โ€™ 18 ns No

P1 E โ€˜1โ€™ 20 ns Yes

P2 F โ€˜0โ€™ 19 ns No

C2 D โ€˜1โ€™ 16 ns No

20 ns E โ†’ โ€˜1โ€™ P2 F โ€˜1โ€™ 24 ns Yes

24 ns F โ†’ โ€˜1โ€™ C2 D โ€˜1โ€™ 25 ns No

4. (5 points) Obtain a minimum product of sums expression for the following function:

f(A, B, C, D) = ฮ M(0, 1, 2, 4, 5, 8, 9, 10)

A

D

B

C

0 0 0

0 0

(^0 0 )

1

1

1

1

1

1

1 1

fโ€™ = (Bโ€™Cโ€™ + Aโ€™Cโ€™ + Bโ€™Dโ€™)โ€™

= (Bโ€™Cโ€™)โ€™(Aโ€™Cโ€™)โ€™(Bโ€™Dโ€™)

= (B + C)(A + C)(B + D)

I

H

G

F

E

D

C

A B C D E F G

I=B C=I

I=D C=E

I=H C=A

B

H

I=C C=G

I=A

I=A A=B C=I

A=G A=C C=G

I=G

D=E I=C I=E C=F E=H F=A H=A A=C

E=A F=C I

H

G

F

E

D

C

A B C D E F G

I=B C=I

I=D C=E

I=H C=A

B

H

I=C C=G

I=A

I=A A=B C=I

A=G A=C C=G

I=G

D=E I=C I=E C=F E=H F=A H=A A=C

E=A F=C

I

H

G

F

E

D

C

A B C D E F G

I=B C=I

I=D C=E

I=H C=A

B

H

I=C C=G

I=A

I=A A=B C=I

A=G A=C C=G

I=G

D=E I=C I=E C=F E=H F=A H=A A=C

E=A F=C

  1. (5 points) Write out the truth table for the following equation. F = (A โ€ข Bโ€™) + C A B C F 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 1
  1. (5 points) Draw a timing diagram that illustrates the difference between a D flip-flop and a D latch.

CLK

D QF D

CLK

QL

QF

D

CLK/G

QL

10. (1 point) _Synchronous design is a technique that uses a clock to coordinate the operation of all

flip-flops, registers and counters in the system.

  1. (1 point) The value of a _variable changes instantaneously in VHDL
  2. (1 point) A process with a sensitivity list is activated whenever an event occurs on any signal

_in the sensitivity list.

  1. (1 point) VHDL is case-sensitive (True/False) _False
  2. (1 point) Sequential networks commonly use flip-flips as storage devices.
  3. (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 : 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 <= b; CASE current_state WHEN a => IF sig_in = โ€˜0โ€™ THEN next_state <= e; sig_out <= โ€˜1โ€™; ELSE next_state <= d; END IF ; WHEN b => IF sig_in = โ€˜0โ€™ THEN next_state <= b; ELSE next_state <= d; sig_out <= โ€˜1โ€™; END IF ; WHEN c => IF sig_in = โ€˜1โ€™ THEN next_state <= a;