electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

How to multiply 2 signed Fixed-Point numbers ?


Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing -> How to multiply 2 signed Fixed-Point numbers ?
Author Message
omara007



Joined: 06 Jan 2003
Posts: 1279
Helped: 39
Location: Dubai


Post02 Nov 2009 1:28   

How to multiply 2 signed Fixed-Point numbers ?


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.
Back to top
GeorgeM



Joined: 19 Nov 2003
Posts: 37


Post02 Nov 2009 13:05   

Re: How to multiply 2 signed Fixed-Point numbers ?


The fraction part is 12+12=24 bit long. Doesn't matter either it signed or not.
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post02 Nov 2009 20:10   

How to multiply 2 signed Fixed-Point numbers ?


Yes, so you have to drop 12 fractional bits and use saturation logic for the integer part.
Back to top
Google
AdSense
Google Adsense




Post02 Nov 2009 20:10   

Ads




Back to top
omara007



Joined: 06 Jan 2003
Posts: 1279
Helped: 39
Location: Dubai


Post03 Nov 2009 22:07   

Re: How to multiply 2 signed Fixed-Point numbers ?


FvM wrote:
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 ..
Back to top
GeorgeM



Joined: 19 Nov 2003
Posts: 37


Post04 Nov 2009 12:53   

Re: How to multiply 2 signed Fixed-Point numbers ?


You were told in plain english: the product fraction size will be 24 bit. That is (4.12) x (4.12) = (8.24).
Back to top
FvM



Joined: 22 Jan 2008
Posts: 5154
Helped: 766
Location: Bochum, Germany


Post04 Nov 2009 13:30   

How to multiply 2 signed Fixed-Point numbers ?


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.
Back to top
omara007



Joined: 06 Jan 2003
Posts: 1279
Helped: 39
Location: Dubai


Post05 Nov 2009 12:00   

Re: How to multiply 2 signed Fixed-Point numbers ?


GeorgeM wrote:
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 wrote:

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 ?
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing -> How to multiply 2 signed Fixed-Point numbers ?
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
how to do fixed point multiply C code? (4)
fixed-point signed multiplication (3)
HELP...fixed-point multiply using VHDL (5)
Algorithm for fixed-point multiply and dividing (2)
Algorithm with fixed-point multiply and dividing (5)
how to multiply two numbers in c in pic microcontroller? (7)
How to know if i need fixed-point of floating-point? (3)
multiply decimal numbers in PIC (7)
addition of signed numbers (3)
Multiplying 2 signed numbers => 2 sign bits ?? (4)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS