Pipelining and VHDL Design: Exam Questions - Prof. Shantanu S. Dutt, Exams of Electrical and Electronics Engineering

Information about two exam questions related to pipelining using booth's multipliers and vhdl code design. The first question asks to calculate the average number of clock cycles required to complete a computation using pipelined booth multipliers. The second question involves identifying correctness issues and fixing them in a vhdl code for a module named 'something'. The third question deals with simulating the behavior of a vhdl code for a module named 'foo'.

Typology: Exams

Pre 2010

Uploaded on 07/29/2009

koofers-user-ea9
koofers-user-ea9 🇺🇸

10 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
ECE 368, Fall 2001,Instructor: Prof. Shantanu Dutt
Final Exam: Tue, Dec. 9, Time: 1-3 pm
Exam Format: Open Book and Notes, Total Points: 150
Important Note:(1) Write your name on the top of this question sheet and submit along with your answer
book
(2) You need to show all your work clearly in deriving the answers. Just writing down the final answers is
not enough.
Suggestion: Begin by reading all questions and do those first that you think you know best.
pf3
pf4
pf5

Partial preview of the text

Download Pipelining and VHDL Design: Exam Questions - Prof. Shantanu S. Dutt and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

ECE 368, Fall 2001 , Instructor: Prof. Shantanu Dutt

Final Exam: Tue, Dec. 9, Time: 1-3 pm Exam Format: Open Book and Notes, Total Points: 150

Important Note : (1) Write your name on the top of this question sheet and submit along with your answer book (2) You need to show all your work clearly in deriving the answers. Just writing down the final answers is not enough.

Suggestion : Begin by reading all questions and do those first that you think you know best.

  1. Pipelining Consider the computation given below using regular programming language statements:

for ^ to 1000 do

begin

 ^  ^ ; /* ^ ^ are input sequences of integers */

 ^  ^ ; /* ^ is another input sequence of integers */

/*   is an output sequence of integers */

endfor

Assume that the input numbers  ^ ^ are 16-bit numbers. The above computation needs to

be pipelined using two Booth’s multipliers, with each multiplier being a stage in the pipeline. Each Booth’s multiplier hardware is composed of a datapath and a controlling FSM of the type you de- signed in your lab problem. The Booth’s multiplier along with the FSM is enclosed in the box labeled “Booth’s multiplier” shown in the figure below.

ld_z FSM 2

Stage 2

FSM 1

External

Stage 1

External

B

(Booth’s multiplier) (Booth’s multiplier)

dataready

start Booth_done ld_x

ld_c ld_b

ld_a

start (^) Booth_done dataready ready1 ready

X Z

C

A

To another

register

data in Z

"consumes"

module that

To anoher

other control signals other control signals

module that A, B registers

loads data in

Since the number of clock cycles taken by a Booth multiplier to complete a multiplication is not pre- determined, each stage can take a variable # of ccs to complete. Thus an external FSM is needed for each stage in order to synchronize data transfer correctly between the stages, as shown in the above figure.

  1. VHDL Code Modification A module (a piece of hardware that does something useful) “something” is to be described in VHDL

with the following specifications. It has two bit inputs start1, start2 and two integer inputs  )^. Inputs

start1 and  are produced by one external module and inputs start2 and ) are produced by another

external module. Each bit inputs are asserted (made = ’1’) for exactly 5 ns by the corresponding

external module. start1 becomes ’1’ when input data  is available and start2 becomes ’1’ when

input data ) is available. There is no synchrony between the availability of data on the  and ) inputs.

Thus note in particular that start1 and start2 may or may not become ’1’ simultaneously, and in the case that are not ’1’ simultaneously, it is not known in which order they will become ’1’.

Once any input signal ( start1, start2 ,  )^ ) becomes valid or available, it remains valid until the done

output signal is asserted by module “something” (see below).

Module “something” is supposed to produce the real output    * $+)^ * with a delay of 50 ns after

both input bit signals start1, start2 have become ’1’ in the current iteration. At the same time

that  is produced, module “something” also asserts an output bit signal done for exactly 5ns.

The following is the VHDL behavioral description of module “something”. entity something is port (start1, start2 :in bit; x, y: in integer; z: out real; done: out bit := 0); end entity something; architecture behav of something is signal temp1, temp2: real; begin do work: process is begin wait until (start1 = ’1’); wait until (start2 = ’1’);

temp1 , = real(x * x); — real(integer value) converts integer value into a floating point representation

temp2 , = real(y * y);

z , = temp1 + temp2 after 50 ns;

done , = ’1’ after 50 ns;

wait for 50 ns;

done , = ’0’ after 5 ns; – this causes the pulse width of “done” to be 5ns

end process do work; end architecture behav;

(a) Ignoring syntax errors , if any (no synatx error has been deliberately inserted, though inadver- tently some might have crept in), in the above code, what are correctness/design problem(s) in the code (i.e., problem(s) that will cause it to function incorrectly)? Enumerate each problem clearly and explain what incorrect functioning it causes. 20

(b) Rewrite the code so that the correctness/design problem(s) are fixed. Comment the code clearly to explain the fixes. 40

Give the simulation times in the table provided on the last page. 20

(b) How many iterations will it take for - to get its final value after each set of values of inputs

./ is asserted? Assume that the inputs change every positive edge of the cc. 10

(c) Suppose that at the positive edge of the first cc, 013245^ ^2 4768/9;:<2^. Also assume

that at the positive edge of every subsequent cc i.e., starting with the second cc , each of these input

values increase by 5. What are the values of  )=>^ - at the following points: (iter=i, pt=1) , (iter=i,

pt=2) , for %^ 1 to 3. Once again give the answer in the table provided below. 30

Table for solution to part (a):

Iter, pt combination Simulation Time

(iter=1, pt=1)

(iter=1, pt=2)

(iter=2, pt=1)

(iter=2, pt=2)

Table for solution to part (c):

Iter, pt combination? @ A B

(iter=1, pt=1)

(iter=1, pt=2)

(iter=2, pt=1)

(iter=2, pt=2)

(iter=3, pt=1)

(iter=3, pt=2)