- Multiplication
Multiplication 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.
A 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.
- These building blocks can then be used to build a 4-bit multiplier as shown in the figure below. (see also “Combinational multiplier“)
- 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.
:
- ¼·(A + B)2 - ¼·(A – B)2 = ¼·(A2 + 2·A·B + B2) – ¼·(A2 – 2·A·B + B2) =A·B
2013年12月30日 星期一
Multiplication
訂閱:
張貼留言 (Atom)
MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構
MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構 這張圖片展示了一個 結合 MQTT 協定與 Modbus 通訊的遠端監控與控制系統架構 (主要透過 Node-RED 進行資料整合)。 系統包含三個核心部分,其運作功能說明如下: 1. ESP32 終端設備(硬體控制層...
沒有留言:
張貼留言