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.

Can anybody tell me about 2's complement multipliers ?

Status
Not open for further replies.

narasimha_80

Newbie level 5
Newbie level 5
Joined
Nov 29, 2005
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,368
Hello,

I want to implement 8 bit 2's complement multipliers ( for fractional number multiplication ) in VHDL. Can anybody suggest me some algorithms or send me the VHDL/verilog code ?

Thanks in Advance,
Narasimha Naik
 

I would do this in Verilog. Verilog doesn't have any fractional data types, so I would simply remember where I put the decimal point.

Code:
module top (a, b, y);
  input signed  [7:0] a, b;
  output signed [7:0] y;

  assign y = a * b;
endmodule
 

Go here and look for Universal Multiplier.

**broken link removed**
 
its better to use booths algorithm for signed multiplication.
 
Hello Anjali,

Actually I want to implement fractional value (in 2's complement) multipliers in VHDL.ie represeneting fractional value in binary and multiplying. Does Booths algorithms support this fractional value multiplication ? If not, Can you suggest any algorithms for this ? I really need some help.

Best Regards,
Narasimha Naik
 

I'm not sure I understand your question. Multiplication of fractions is exactly the same as integer multiplication, except for the position of the decimal point.

For example, let's assume you already have hardware that multiplies two 8-bit integers to get a 16-bit product:
aaaaaaaa * bbbbbbbb = yyyyyyyyyyyyyyyy

You can use the same hardware to multiply two 8-bit fraction values:
aaa.aaaaa * bbbbbb.bb = yyyyyyyyy.yyyyyyy

However, if you don't yet have an integer multiplier, and for some reason your don't want to use the HDL * operator, than that's a different problem.
 

Hello echo47,

you have written that same hardware can be used for integer and fractional multiplication. ie

aaaaaaaa * bbbbbbbb = yyyyyyyyyyyyyyyy

aaa.aaaaa * bbbbbb.bb = yyyyyyyyy.yyyyyyy

I think we can not use the same hardware for integer and fractional multiplication.

See for example
0.5 * 0.5 = 0.25

0.5 = 01 in binary;

Then, 01 * 01 =0001 = 1 in decimal and 0001 is not equal to 0.25 in binary.

But, 0.25 = 0100

So I think we cannot use same hardware for integer and fractional value multiplication. Isn't it ?

Write to me further.

Regards,
Narasimha Naik
 

narasimha_80
according your example
0.5 = 01 in binary;
Then, 01 * 01 =0001
0001 is not 1
0001=00.01=0.25
you should notify the position of the decimal point.
as for algorithm
there are a lot of algorithms for multiplier implemention
you can seach them in google,
it is easy to find a lot of useful links
as anjali said, booth encode is a good method for area and speed, especially 4-based booth encode.
 
Or you can use my 8-bit example:

aaa.aaaaa * bbbbbb.bb = yyyyyyyyy.yyyyyyy
0.5 = aaa.aaaaa = 000.10000
0.5 = bbbbbb.bb = 000000.10
000.10000 * 000000.10 = 000000000.0100000 = 0.25

To determine the location of the output decimal point, you add the number of input fraction bits. Five fraction bits times two fraction bits gives you seven fraction bits.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top