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.

How to multiply 2 signed Fixed-Point numbers ?

Status
Not open for further replies.

omara007

Advanced Member level 4
Joined
Jan 6, 2003
Messages
1,238
Helped
50
Reputation
102
Reaction score
16
Trophy points
1,318
Location
Cairo/Egypt
Activity points
9,747
Hi guys

I have two 16-bit bit vectors .. each one represents a signed binary number. The format of each vector is as follows:

XXXX . XXXXXXXXXXXX

Where the (dot) represents the binary point that separates the integer part from the fraction part.

The Most Significant Bit order is (15), while the Least Significant Bit order is (0).

As the vector is signed, bits (12, 13, 14) represent the integer value while bit (15) is the sign bit. The numbers are represented in 2's complement format.

Now, I want to multiply these 2 vectors. I know that the result will be placed in a 32-bit vector. Yet, where will be the position of the binary point ? .. Please notice that it's a signed multiplication process.
 

GeorgeM

Member level 2
Joined
Nov 19, 2003
Messages
46
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Aynho, Oxon, UK
Activity points
420
The fraction part is 12+12=24 bit long. Doesn't matter either it signed or not.
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,369
Helped
14,245
Reputation
28,751
Reaction score
12,931
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,978
Yes, so you have to drop 12 fractional bits and use saturation logic for the integer part.
 

omara007

Advanced Member level 4
Joined
Jan 6, 2003
Messages
1,238
Helped
50
Reputation
102
Reaction score
16
Trophy points
1,318
Location
Cairo/Egypt
Activity points
9,747
FvM said:
Yes, so you have to drop 12 fractional bits and use saturation logic for the integer part.

Didn't understand what you said exactly .. please elaborate more ..
 

GeorgeM

Member level 2
Joined
Nov 19, 2003
Messages
46
Helped
4
Reputation
8
Reaction score
4
Trophy points
1,288
Location
Aynho, Oxon, UK
Activity points
420
You were told in plain english: the product fraction size will be 24 bit. That is (4.12) x (4.12) = (8.24).
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
48,369
Helped
14,245
Reputation
28,751
Reaction score
12,931
Trophy points
1,393
Location
Bochum, Germany
Activity points
279,978
Drop (or cut) 12 fractional bits is self-explanatory, I think. If you have doubts about needing saturation logic, you may want
to play around with numeric examples and consider, how you intend to handle a numeric overflow.
 

omara007

Advanced Member level 4
Joined
Jan 6, 2003
Messages
1,238
Helped
50
Reputation
102
Reaction score
16
Trophy points
1,318
Location
Cairo/Egypt
Activity points
9,747
GeorgeM said:
You were told in plain english: the product fraction size will be 24 bit. That is (4.12) x (4.12) = (8.24).

Thanks GeorgeM .. Yet, I don't think my last comment was intended for you .. did you notice that I quoted FvM ?

FvM said:
Drop (or cut) 12 fractional bits is self-explanatory, I think. If you have doubts about needing saturation logic, you may want
to play around with numeric examples and consider, how you intend to handle a numeric overflow.

Yes FvM .. it's about Saturation Logic .. did you assume I won't use a 32bit register for the output ?
 

chin

Member level 1
Joined
Sep 24, 2005
Messages
36
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,288
Activity points
1,537
Hi,,

you can use
"a 2's complement parallel array multiplier by bough & wooley"

paper..

regards

Chin
 

omara007

Advanced Member level 4
Joined
Jan 6, 2003
Messages
1,238
Helped
50
Reputation
102
Reaction score
16
Trophy points
1,318
Location
Cairo/Egypt
Activity points
9,747
chin said:
Hi,,

you can use
"a 2's complement parallel array multiplier by bough & wooley"

paper..

regards

Chin

Would you please send a link to the paper ?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top