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.
        :

沒有留言:

張貼留言

2024產專班 作業2

 2024產專班 作業2   1. 系統圖       ESP32+MFRC522 組成RFID Reader 可以將RFID卡片的UID 透過 MQTT協定    上傳(發行 主題 (:topic) alex9ufo/2024/RFID/RFID_UID  ,, Payload...