<?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 General multiplication in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194304#M15404</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a general MCU question, and not really addressed to a particular architecture. Say you have an 8-bit MCU that can do 8-bit x 8-bit unsigned integer&amp;nbsp;multiplication, with the result being 16 bits. Would it be possible to use that built-in arithmetic routine to perform a multiplication of M x N bit unsigned integers, where M and N are larger than 8. For instance, would it be possible to perform an 18 x 16 bit unsigned integer multiplication? Not directly of course, but by writing a procedure for it. If so, does anyone have a link to a website describing these algorithms?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jun 2009 17:55:10 GMT</pubDate>
    <dc:creator>c64</dc:creator>
    <dc:date>2009-06-26T17:55:10Z</dc:date>
    <item>
      <title>General multiplication</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194304#M15404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is a general MCU question, and not really addressed to a particular architecture. Say you have an 8-bit MCU that can do 8-bit x 8-bit unsigned integer&amp;nbsp;multiplication, with the result being 16 bits. Would it be possible to use that built-in arithmetic routine to perform a multiplication of M x N bit unsigned integers, where M and N are larger than 8. For instance, would it be possible to perform an 18 x 16 bit unsigned integer multiplication? Not directly of course, but by writing a procedure for it. If so, does anyone have a link to a website describing these algorithms?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 17:55:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194304#M15404</guid>
      <dc:creator>c64</dc:creator>
      <dc:date>2009-06-26T17:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: General multiplication</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194305#M15405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Of course 8x8-&amp;gt;16bits MUL instructtion can be used to multiply as many bits as you wish. Procedure? Sure&amp;nbsp;you know how to multiply for example 3 decimal digits number by 2 decimal digits number.&amp;nbsp;This algorithm is the same, just replace decimal digits with bytes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 03 FF &lt;FONT color="#ff0000"&gt;FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FF &lt;FONT color="#ff0000"&gt;FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;FE 01&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp; - first MUL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#000000"&gt;03 &lt;FONT color="#ff0000"&gt;FF&lt;/FONT&gt; FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FF &lt;FONT color="#ff0000"&gt;FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FE 01&amp;nbsp;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT color="#ff0000"&gt;FE 01&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - second&amp;nbsp;MUL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#000000"&gt;&lt;FONT color="#ff0000"&gt;03&lt;/FONT&gt; &lt;FONT color="#000000"&gt;FF&lt;/FONT&gt; FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FF &lt;FONT color="#ff0000"&gt;FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FE 01&amp;nbsp;&lt;/P&gt;&lt;P&gt;+&amp;nbsp; FE 01&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;02 FD&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 3rd MUL&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;... do another 3 MULs with higher order byte of 2nd multiplier and final picture will be this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#000000"&gt;&lt;FONT color="#ff0000"&gt;03&lt;/FONT&gt; &lt;FONT color="#000000"&gt;FF&lt;/FONT&gt; FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;x&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#ff0000"&gt;FF&amp;nbsp;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;FF&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FE 01&amp;nbsp;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; FE 01&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color="#000000"&gt;02 FD&lt;/FONT&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 3rd&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FE 01&amp;nbsp;&lt;/P&gt;&lt;P&gt;+&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FE 01&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff0000"&gt;&amp;nbsp; 02 FD&amp;nbsp;&lt;/FONT&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 6th&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;--------------------&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;03&amp;nbsp;FF&amp;nbsp;FB&amp;nbsp;00&amp;nbsp;01 - 18+16 = 34bits product&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 19:59:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194305#M15405</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2009-06-26T19:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: General multiplication</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194306#M15406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And here's a &lt;A href="http://www.aspisys.com/code/hc08/bigmult.html"&gt;9S08 assembly language re-entrant routine&lt;/A&gt; that multiplies any size (up to 127 bytes) numbers.&amp;nbsp; For parameter passing simplicity both operands must be of the same size.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2009 21:53:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194306#M15406</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2009-06-26T21:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: General multiplication</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194307#M15407</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 attached code contains functions for 16 x 16 multiply, and 32 x 32 multiply, plus some other division functions.&amp;nbsp; It extensively makes use of inliine assembly for speed, so is restricted to HC908 and HCS08 devices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Jun 2009 03:24:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194307#M15407</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-06-27T03:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: General multiplication</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194308#M15408</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much for the replies and sample codes! I really appreciate it!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jun 2009 14:22:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/General-multiplication/m-p/194308#M15408</guid>
      <dc:creator>c64</dc:creator>
      <dc:date>2009-06-29T14:22:20Z</dc:date>
    </item>
  </channel>
</rss>

