Ch 3. Arithmetic for computers - (2)

최대 1 분 소요

2. Multiplication

  • Multiplying = ‘add’ + ‘shift’ operation
    • with binary numbers
  • Positive integer에 대해서만 고려
  • Ex)
    스크린샷 2022-10-08 오후 10 33 23
    • 0010 (multiplicand)
    • 1001 (multiplier)
    • 0010010 (product)

Multiplication: Implementation

  • Version 1
    스크린샷 2022-10-08 오후 11 29 49
    • Multiplicand: Shift Left
    • Product: doesn’t move
    • Multiplicand: 64bits
    • Multiplier: 32bits
    • Product: 64bits
    • 64-bit ALU
  • Version 2
    스크린샷 2022-10-08 오후 11 30 07
    • Multiplicand: doesn’t move
    • Product: Shift Right
    • Multiplicand: 32bits
    • Multiplier: 32bits
    • Product: 64bits
    • 32-bit ALU
  • Version 1 → Version2: Save Spaces & Hardware reducing
  • Final Version
    스크린샷 2022-10-08 오후 11 30 31
    • Multiplier -> Product register

    스크린샷 2022-10-08 오후 11 31 49

Multiplication of negative numbers

  1. Negate negative number(s)
    • -3 => 3
  2. unsigned multiplication 수행
    • 3 * 4 = 12
  3. negate the result
    • 12 => -12
  • Another way: Booth algorithm

카테고리:

업데이트: