<?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: Automotive Math library function execution time in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Automotive-Math-library-function-execution-time/m-p/1193999#M17618</link>
    <description>&lt;P&gt;Hi Pratibhasurabhi,&lt;/P&gt;
&lt;P&gt;AMMCLib fixed-point functions calculate in &lt;STRONG&gt;saturated fractional arithmetic&lt;/STRONG&gt; whereas the standard C language multiplications and divisions are calculated in &lt;STRONG&gt;integer modulo arithmetic&lt;/STRONG&gt;. The result of an integer multiplication can overflow which causes loss of the most significant bits. On the other hand, the fractional multiplication loses only the least significant bits of the result (i.e. rounding error) and the additional saturation operation ensures that the result never overflows. While modulo arithmetic may be faster, it is not really usable in motor control and DSP applications because overflows can cause catastrophic failure leading to a possible physical damage or safety risk. Such risk can be eliminated by using the saturated fractional arithmetic instead. MLIB functions are highly optimized and take full advantage of the capabilities of the core (e.g. hardware QMULS instruction).&lt;/P&gt;</description>
    <pubDate>Fri, 04 Dec 2020 17:17:37 GMT</pubDate>
    <dc:creator>petrz_</dc:creator>
    <dc:date>2020-12-04T17:17:37Z</dc:date>
    <item>
      <title>Automotive Math library function execution time</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Automotive-Math-library-function-execution-time/m-p/1191527#M17613</link>
      <description>&lt;P&gt;Dear Team,&lt;/P&gt;&lt;P&gt;I want to know the execution time of math library function(MUL,Div etc.) as compare to normal multiplication, division operation. Is the MLIB library execution time is less than normal math operation?&lt;/P&gt;&lt;P&gt;I have observed that&amp;nbsp;MLIB_Div function takes more execution time than normal division. Is it correct?&lt;/P&gt;&lt;P&gt;I want to know that what are the advantages if I use the library function(MUL,Div) instead of normal operation.&lt;/P&gt;&lt;P&gt;Thank You in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 10:16:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Automotive-Math-library-function-execution-time/m-p/1191527#M17613</guid>
      <dc:creator>pratibhasurabhi</dc:creator>
      <dc:date>2020-12-01T10:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Automotive Math library function execution time</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Automotive-Math-library-function-execution-time/m-p/1193999#M17618</link>
      <description>&lt;P&gt;Hi Pratibhasurabhi,&lt;/P&gt;
&lt;P&gt;AMMCLib fixed-point functions calculate in &lt;STRONG&gt;saturated fractional arithmetic&lt;/STRONG&gt; whereas the standard C language multiplications and divisions are calculated in &lt;STRONG&gt;integer modulo arithmetic&lt;/STRONG&gt;. The result of an integer multiplication can overflow which causes loss of the most significant bits. On the other hand, the fractional multiplication loses only the least significant bits of the result (i.e. rounding error) and the additional saturation operation ensures that the result never overflows. While modulo arithmetic may be faster, it is not really usable in motor control and DSP applications because overflows can cause catastrophic failure leading to a possible physical damage or safety risk. Such risk can be eliminated by using the saturated fractional arithmetic instead. MLIB functions are highly optimized and take full advantage of the capabilities of the core (e.g. hardware QMULS instruction).&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2020 17:17:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Automotive-Math-library-function-execution-time/m-p/1193999#M17618</guid>
      <dc:creator>petrz_</dc:creator>
      <dc:date>2020-12-04T17:17:37Z</dc:date>
    </item>
  </channel>
</rss>

