<?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: how to do arithmetic operation using tFrac16 and tS16  in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763268#M15284</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AMMCLib does not support mixed integer/fractional arithmetic. If you scale all your values into the fractional range, you will be able to use the fractional arithmetic functions&amp;nbsp;from the MLIB library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Apr 2018 10:46:33 GMT</pubDate>
    <dc:creator>petrz_</dc:creator>
    <dc:date>2018-04-26T10:46:33Z</dc:date>
    <item>
      <title>how to do arithmetic operation using tFrac16 and tS16</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763267#M15283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using AMMCLIB on S12ZVML micro. I will need to the calculation as below:&lt;/P&gt;&lt;P&gt;(tU16 - tU16) * tFrac16 / tS16&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried convert tU16 to tS16, tFrac16 to tS16, do the math and convert the result back to tFrac16. It didn't work. Please advise how to do it or if there is a walk around.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, Ke&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2018 13:54:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763267#M15283</guid>
      <dc:creator>kelimagna</dc:creator>
      <dc:date>2018-04-24T13:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: how to do arithmetic operation using tFrac16 and tS16</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763268#M15284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AMMCLib does not support mixed integer/fractional arithmetic. If you scale all your values into the fractional range, you will be able to use the fractional arithmetic functions&amp;nbsp;from the MLIB library.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Apr 2018 10:46:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763268#M15284</guid>
      <dc:creator>petrz_</dc:creator>
      <dc:date>2018-04-26T10:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to do arithmetic operation using tFrac16 and tS16</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763269#M15285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Petrz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your response. I have tried converting the tS16 to tFrac16. It didn’t work. I guess it was because of the overflow. So I tried to convert tS16 and tFrac16 to tS32. Didn’t work either. Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ke Li&lt;/P&gt;&lt;P&gt;Electrical Engineering, Software Engineer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Magna Closures&lt;/P&gt;&lt;P&gt;521 Newpark Blvd&lt;/P&gt;&lt;P&gt;Newmarket, Ontario L3Y 4X7 Canada&lt;/P&gt;&lt;P&gt;OFFICE: +1 905-898-6744 x2329&lt;/P&gt;&lt;P&gt;ke.li@magna.com&amp;lt;mailto:ke.li@magna.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Apr 2018 13:29:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763269#M15285</guid>
      <dc:creator>kelimagna</dc:creator>
      <dc:date>2018-04-27T13:29:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to do arithmetic operation using tFrac16 and tS16</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763270#M15286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can't convert an integer&amp;nbsp;value to a fractional value without rescaling. A properly scaled fixed-point model of a physical system will not overflow. I assume you are familiar with the concept of scaling of physical quantities into a normalized fixed-point range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 07:00:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/how-to-do-arithmetic-operation-using-tFrac16-and-tS16/m-p/763270#M15286</guid>
      <dc:creator>petrz_</dc:creator>
      <dc:date>2018-04-30T07:00:13Z</dc:date>
    </item>
  </channel>
</rss>

