2013年12月30日 星期一

Multiplication

  1. Multiplication
    • adapted from http://ecen3233.okstate.edu/PDF/Labs/Combinational%20Multiplier.pdfMultiplication shows how simple logic functions can be combined to make a much more complex function.
    • Method 1: partial products
      • The result of multiplying two n-bit numbers occupies up to 2×n bits.Multiplying the 4-bit numbers A and B can be written as A3A2A1A0 × B3B2B1B0.  The product can then be found by adding the partial products.
      • own workA basic building block can be made using:
        • Forming the partial product of two binary digits is simply an AND operation.
        • Adding the partial sums can be accomplished with 1-bit full adders.
          own work
      • These building blocks can then be used to build a 4-bit multiplier as shown in the figure below.  (see also “Combinational multiplier“)
        own work
    • Method 2: quarter squares
      • ¼·(A + B)2 - ¼·(A – B)2 = ¼·(A2 + 2·A·B + B2) – ¼·(A2 – 2·A·B + B2) =A·B
        • hard wire a look-up table of squares
        • calculate A + B, and look up C = (A + B)2
        • calculate A – B, and look up D = (A – B)2
        • calculate C – D, and divide by 4.  The result is A × B.
      • So three additions, two table look ups and divide by 4 (right shift by 2 bits).
      • The size of the look up tables scales nicely linear with the length of the operands.
        :

沒有留言:

張貼留言

2026 作業3 RFID+ Telegram 練習

 2026 作業3  RFID+ Telegram  練習 (Wokwi 與 Telegram 二者溝通訊息反映比較慢 ) 歡迎 Alex 使用 RFID 控制系統 /on : 開啟 LED /off : 關閉 LED /flash : 閃爍模式 /timer : 開啟 5 秒 ...