<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Other NXP ProductsのトピックRe: Newbie with Fractional numbers in DSP56F801</title>
    <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134675#M180</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Tom,&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir="ltr"&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;FONT size="1"&gt;J2MEJediMaster wrote:&lt;BR /&gt;The difference between the binary representations of fractional and integer numbers is where that implicit binary point lies. The easiest way to explain this is with the attached diagram, which will be clearer and more concise than the thousand words it would take to explain things. What this means is that you can convert between the two formats by multiplying or dividing by 32767.0 for 16-bit numbers. For conversion to fractional values, the following macro was originally used:&lt;BR /&gt;&lt;BR /&gt;#define CFF(x) (x * 32767.0)&lt;BR /&gt;&lt;BR /&gt;There was a one-bit error in that computation, so now the Frac16 conversion macro is:&lt;BR /&gt;&lt;BR /&gt;#define FRAC16(x) (x &amp;lt; 1 ? ( x &amp;gt;= -1 ? x * 0x7FFF : 0x8000) : 0x7FFF)&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;My limited understanding of a signed fractional number representation suggests that the effective&amp;nbsp;magnitude of the fraction will always be less than 1, i.e. a maximum represented value of 32767 / 32768 for integer size.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;By this reckoning, the multiplier/divider value should be 32768 ($8000), rather than 32767.&amp;nbsp; Therefore, a value of 0.75 would be represented by $6000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;05-06-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;05:16 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 May 2006 14:11:57 GMT</pubDate>
    <dc:creator>bigmac</dc:creator>
    <dc:date>2006-05-06T14:11:57Z</dc:date>
    <item>
      <title>Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134672#M177</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;I'm new with the 56F801 DSP and I'm confusing about the conversion between fractional numbers, &lt;STRONG&gt;Frac16&lt;/STRONG&gt; or &lt;STRONG&gt;Frac32&lt;/STRONG&gt;, and &lt;STRONG&gt;int&lt;/STRONG&gt; o &lt;STRONG&gt;long&lt;/STRONG&gt; numbers. As I know to convert a real number to fractional I must use FRAC16(&lt;EM&gt;real&lt;/EM&gt;) included in the dspfun.h. How I can obtain the real number giving a Frac number?&lt;/DIV&gt;&lt;DIV&gt;Can anyone tell me where a can find an application note, code example, etc?&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Sorry to all for this silly question.&lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Thanks&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 May 2006 20:44:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134672#M177</guid>
      <dc:creator>Paquito</dc:creator>
      <dc:date>2006-05-04T20:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134673#M178</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The difference between the binary representations of fractional and integer numbers is where that implicit binary point lies. The easiest way to explain this is with the attached diagram, which will be clearer and more concise than the thousand words it would take to explain things. What this means is that you can convert between the two formats by multiplying or dividing by 32767.0 for 16-bit numbers. For conversion to fractional values, the following macro was originally used:&lt;BR /&gt;&lt;BR /&gt;#define CFF(x) (x * 32767.0)&lt;BR /&gt;&lt;BR /&gt;There was a one-bit error in that computation, so now the Frac16 conversion macro is:&lt;BR /&gt;&lt;BR /&gt;#define FRAC16(x) (x &amp;lt; 1 ? ( x &amp;gt;= -1 ? x * 0x7FFF : 0x8000) : 0x7FFF)&lt;BR /&gt;&lt;BR /&gt;To convert back to ints, you'd use a divide operation. Double-check the header files and see if this conversion macro is already done for you.&lt;BR /&gt;&lt;BR /&gt;One final note: be very careful and ensure that you're not mixing fractional variables with integer variables in a computation. You'll definitely get garbage out.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;P&gt;Message Edited by J2MEJediMaster on &lt;SPAN class="date_text"&gt;05-04-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:06 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Message Edited by J2MEJediMaster on &lt;SPAN class="date_text"&gt;05-04-2006&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:16 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2006 03:05:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134673#M178</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-05-05T03:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134674#M179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I'm not familiar with and don't have time to test, but Tom, are you saying that it is like a fixed point where the value is always less than one? Also looks like signed type.&lt;BR /&gt;&lt;BR /&gt;The answer to the original question in other words would be if I say FRAC16(0.75) it will give me 24575.25 (0x5fff). If I store that as 16-bit (short), Then I can say the value means a positive (0x5fff/0x7fff)? Or is it better (0x5fff/0x8000)?&lt;BR /&gt;&lt;BR /&gt;I used this for calculator experimenting. It does say alot, thanks&lt;BR /&gt;#define FRAC16(x)(x 1 ? ( x &amp;gt;= -1 ? x * 0x7FFF : 0x8000) : 0x7FFF)&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 May 2006 22:46:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134674#M179</guid>
      <dc:creator>imajeff</dc:creator>
      <dc:date>2006-05-05T22:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134675#M180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello Tom,&lt;/FONT&gt;&lt;/P&gt;&lt;BLOCKQUOTE dir="ltr"&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;FONT size="1"&gt;J2MEJediMaster wrote:&lt;BR /&gt;The difference between the binary representations of fractional and integer numbers is where that implicit binary point lies. The easiest way to explain this is with the attached diagram, which will be clearer and more concise than the thousand words it would take to explain things. What this means is that you can convert between the two formats by multiplying or dividing by 32767.0 for 16-bit numbers. For conversion to fractional values, the following macro was originally used:&lt;BR /&gt;&lt;BR /&gt;#define CFF(x) (x * 32767.0)&lt;BR /&gt;&lt;BR /&gt;There was a one-bit error in that computation, so now the Frac16 conversion macro is:&lt;BR /&gt;&lt;BR /&gt;#define FRAC16(x) (x &amp;lt; 1 ? ( x &amp;gt;= -1 ? x * 0x7FFF : 0x8000) : 0x7FFF)&lt;BR /&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;FONT size="2"&gt;My limited understanding of a signed fractional number representation suggests that the effective&amp;nbsp;magnitude of the fraction will always be less than 1, i.e. a maximum represented value of 32767 / 32768 for integer size.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;By this reckoning, the multiplier/divider value should be 32768 ($8000), rather than 32767.&amp;nbsp; Therefore, a value of 0.75 would be represented by $6000.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;BR /&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Message Edited by bigmac on &lt;SPAN class="date_text"&gt;05-06-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;05:16 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 14:11:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134675#M180</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-05-06T14:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134676#M181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bigmac wrote:&lt;P&gt;&lt;FONT size="2"&gt;By this reckoning, the multiplier/divider value should be 32768 ($8000), rather than 32767. Therefore, a value of 0.75 would be represented by $6000.&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;Having used the Motorola DSPs for years, first the DSP56002 and currently the DSP56303, I can verify that what Mac says is correct and cast in silicon.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 14:37:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134676#M181</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2006-05-06T14:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134677#M182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Thanks Tom&lt;/P&gt;&lt;P&gt;With your explanations I see the light. This theme is confusing is not well explained.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 17:13:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134677#M182</guid>
      <dc:creator>Paquito</dc:creator>
      <dc:date>2006-05-08T17:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134678#M183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The Frac16() macros which uses a multiplier of 0x8000, is the way to go. Explaining that it's a divide by 32768 (instead of 32767, my mistake), makes what's going on in the conversion more apparent.&lt;BR /&gt;&lt;BR /&gt;Both macros (and the mention of the bit error) were given to me by a Motorola engineer working on the Suite56 DSP libraries.&lt;BR /&gt;&lt;BR /&gt;Sorry for the confusion.&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 May 2006 23:14:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134678#M183</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2006-05-08T23:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie with Fractional numbers in DSP56F801</title>
      <link>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134679#M184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;bigmac wrote:&lt;BR /&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;My limited understanding of a signed fractional number representation suggests that the effective magnitude of the fraction will always be less than 1, i.e. a maximum represented value of 32767 / 32768 for integer size.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;By this reckoning, the multiplier/divider value should be 32768 ($8000), rather than 32767. Therefore, a value of 0.75 would be represented by $6000.&lt;/FONT&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;I think you are saying that the CW macro is wrong. It multiplies by 0x7fff.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 May 2006 00:00:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Other-NXP-Products/Newbie-with-Fractional-numbers-in-DSP56F801/m-p/134679#M184</guid>
      <dc:creator>imajeff</dc:creator>
      <dc:date>2006-05-09T00:00:33Z</dc:date>
    </item>
  </channel>
</rss>

