Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

multiplication without using * operator in verilog

Status
Not open for further replies.

senthilos

Newbie level 6
Joined
Feb 25, 2010
Messages
12
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Raleigh, NC, USA
Activity points
1,360
Hi,

I got an interview question yesterday on multiplying a 10 bit number with a constant. Ex: a[9:0] * 24. The interviewer was expecting a answer without using the straightforward * operator. Can anyone throw me more light on how to do this multiplication without using * operator?

Thanks
Senthil
 

1. sum = 0;
for(int i = 0; i < 24; i++) sum += a;

2. a * 24 = a * (8 + 16) = a* 8 + a * 16 = (a << 3) + (a << 4);

3. Design mult circuit using ANDs and XORs.

Bests,
Tiksan
 

Analyzing the multiplicand into additions of multiples of 2 numbers.
Shifting and summing would be fine.
For example X * 3 is the same as X << 1 + X
--
Amr Ali
 

the first question is why not using a "*" with a constant? The synthesis tools are enought intelligent to simplify the combinaison.

The 2 proposition of Syswip-Tiksan seems to be the more efficient.
 

Syswip and amraldo,

Your solutions seem quite different. Thanks!
What do you mean by design circuit using ANDs and XORs? You mean to draw the entire multiplier circuit using logic gates?
 

the first question is why not using a "*" with a constant? The synthesis tools are enought intelligent to simplify the combination.

Because it is only for interview. :D

What do you mean by design circuit using ANDs and XORs? You mean to draw the entire multiplier circuit using logic gates?

Yes I mean to design entire multiplier circuit using logic gates.
You can use school book method.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top