Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

help me with the interview quiz pls!

Status
Not open for further replies.

ecse

Junior Member level 2
Joined
May 10, 2002
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
51
write synthesizable code for the equation below:

A[4:0]=B[8:0]*218/( 64*8 )-90/8

It is up to you to figure out the format of the A and B, just using minimum
number of the sythesizable gate counts.

Any good suggestion? or a link of reference?

Thanks in advance.

ecse
 

penrico

Full Member level 5
Joined
Aug 28, 2001
Messages
286
Helped
27
Reputation
54
Reaction score
8
Trophy points
1,298
Location
Argentina
Activity points
2,395
I vote use a look up table, like a simple 256x4 bit flash or eeprom, in address you can put the B data, and result is in data lines. Data in flash is the result of formula you posted.
 

roli

Full Member level 5
Joined
Apr 29, 2001
Messages
246
Helped
9
Reputation
20
Reaction score
9
Trophy points
1,298
Location
'SiliconWafer' Island
Activity points
1,824
Usualy when asked this kind of Quiz - people DO NOT expect you to propose an EPROM based solution. This is too easy.

They want to check your ability to design logic for Arithmetic functions, deal with Signed Arithmetic, Saturation of vectors, etc.

Hint: In the formula above you MUST saturate correctly [signed saturation] the result 5-bit vector AFTER the signed 2's complement arithmetic was done [correctly] for the 9-bit (and other) vectors. You also must correctly relate to the sign bit.

Why ? Because the above is not straight-forward with Synthesizable code !!!
 

Al Farouk

Full Member level 4
Joined
Jan 13, 2003
Messages
191
Helped
16
Reputation
32
Reaction score
16
Trophy points
1,298
Location
Egypt
Activity points
1,854
I suggest the following
1- put 90/8 (45/2) as a constant in 2's complement form.
2- define A,B as integeres with restricted range.
3- 218/64*8 = 109/64*4 = 109/ 2exp7 --->
a: express 109 as a constant
b: use one of the techniques used for contant multiplication as (Booth algorithem) for example.
c: shift the output of multiplication left by 7 position. (note the output of shift operation it may cancel steos of multipication in the previous step)
4- do the final substraction operation.

regards
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top