<?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>topic Re: mfr32Sqrt in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mfr32Sqrt/m-p/170099#M5635</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the DSP_Func_MFC Frac16 or Frac32&amp;nbsp; values. Even thought that they are technically integer, these values represent fractional range -1 &amp;lt;= x &amp;lt; 1. So if you put directly integer inside (e.g. 81) it is treated like a corresponding fractional number - so for 81 it you are actually caclulating sqrt(0.002471923828125)&amp;nbsp; [you can get the float this way : 81 * 1 / 0x8000. so you would&amp;nbsp; get something like 1629, which corresponds to the result 0.0497184456.&lt;/P&gt;&lt;P&gt;Please see the DSP_Func_MFR component help for detailson fractional number representation , I recomment to use the link "Programmers guide" from the component "General Info" page.&lt;/P&gt;&lt;P&gt;I suppose you would need to use different library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;BR /&gt;Petr Hradsky&lt;BR /&gt;Processor Expert Support and Servicepacks Team&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 07 Jan 2012 00:23:10 GMT</pubDate>
    <dc:creator>ProcessorExpert</dc:creator>
    <dc:date>2012-01-07T00:23:10Z</dc:date>
    <item>
      <title>mfr32Sqrt</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mfr32Sqrt/m-p/170098#M5634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Morning everybody,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help with the square root function into MC56F8037EVM board, that is DSC of 16 bits. The specify question is: How can I do a mathematic operation (SQRT)&amp;nbsp;using this bean "MRF1&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif"&gt;&lt;IMG alt=":smileyvery-happy:" class="emoticon emoticon-smileyvery-happy" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-very-happy.gif" title="Smiley Very Happy" /&gt;&lt;/A&gt;SP_Func_MFR"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to do it like shown below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void main(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; Frac16 r;&lt;BR /&gt;&amp;nbsp; PE_low_level_init();&lt;/P&gt;&lt;P&gt;&amp;nbsp; for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;r=mfr32Sqrt(81);&amp;nbsp;&amp;nbsp;&amp;nbsp; //I like to apply the square root to&amp;nbsp;the decimal number&amp;nbsp;81. The answer would be 9&lt;BR /&gt;&amp;nbsp; Bt21_PutVal(r);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This instruction only send the result by the port C (16 bits). I hope (0000 0000 0000 1001)&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot, and i hope your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 04:36:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mfr32Sqrt/m-p/170098#M5634</guid>
      <dc:creator>JhonatanIG</dc:creator>
      <dc:date>2011-09-27T04:36:39Z</dc:date>
    </item>
    <item>
      <title>Re: mfr32Sqrt</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mfr32Sqrt/m-p/170099#M5635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the DSP_Func_MFC Frac16 or Frac32&amp;nbsp; values. Even thought that they are technically integer, these values represent fractional range -1 &amp;lt;= x &amp;lt; 1. So if you put directly integer inside (e.g. 81) it is treated like a corresponding fractional number - so for 81 it you are actually caclulating sqrt(0.002471923828125)&amp;nbsp; [you can get the float this way : 81 * 1 / 0x8000. so you would&amp;nbsp; get something like 1629, which corresponds to the result 0.0497184456.&lt;/P&gt;&lt;P&gt;Please see the DSP_Func_MFR component help for detailson fractional number representation , I recomment to use the link "Programmers guide" from the component "General Info" page.&lt;/P&gt;&lt;P&gt;I suppose you would need to use different library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;BR /&gt;Petr Hradsky&lt;BR /&gt;Processor Expert Support and Servicepacks Team&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 07 Jan 2012 00:23:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/mfr32Sqrt/m-p/170099#M5635</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2012-01-07T00:23:10Z</dc:date>
    </item>
  </channel>
</rss>

