Back to the 2023 paper

Module 1: Functional Block of computer and Data representaion

20237m

Show the systematic multiplication process of (20) x (-19) using Booth's algorithm.

Worked SolutionAI Assisted

Booth's Algorithm: 20×(−19)=−38020 \times (-19) = -380

Take n=6n=6 bits (sign inclusive). Result 2n=122n=12 bits.

  • Multiplicand M=2010=0101002M = 20_{10}=010100_2, −M=1011002-M = 101100_2 (2's complement)
  • Multiplier Q=−1910=1011012Q = -19_{10}=101101_2 (since 19=01001119=010011, invert+1)
  • Registers: A=000000A=000000, Q−1=0Q_{-1}=0, count =6=6

Rule per step: inspect Q0Q−1Q_0 Q_{-1}:

  • 0000 or 1111: no add, ASHR A,Q,Q−1A,Q,Q_{-1}
  • 0101: A←A+MA \leftarrow A+M
  • 1010: A←A−MA \leftarrow A-M, then ASHR
Step Q0Q−1Q_0Q_{-1} Action AA QQ Q−1Q_{-1}
Init - A=0A=0 000000 101101 0
1 10 A=A−MA=A-M 101100 101101 0
ASHR 110110 010110 1
2 01 A=A+MA=A+M 001010 010110 1
ASHR 000101 001011 0
3 10 A=A−MA=A-M 110001 001011 0
ASHR 111000 100101 1
4 11 none 111000 100101 1
ASHR 111100 010010 1
5 01 A=A+MA=A+M 010000 010010 1
ASHR 001000 001001 0
6 10 A=A−MA=A-M 110100 001001 0
ASHR 111010 000100 1

After 6 shifts, count=0.

A Q=111010 0001002=12-bit 2’s complementA\,Q = 111010\,000100_2 = 12\text{-bit 2's complement}

Check: 1110100001002111010000100_2 → invert 000101111011+1=0001011111002=38010000101111011+1=000101111100_2=380_{10} → value −38010-380_{10}.

20×(−19)=−380\mathbf{20 \times (-19) = -380}

If using 66-bit unsigned representation: 111010000100111010000100 (0xE840xE84). In decimal 380=000101111100380 = 000101111100, −380=111010000100-380 =111010000100.

For 55-bit demo (M=010100M=010100 still 6-bit needed because 20>1520>15), same result. Any n≥6n \ge 6 yields same 12-bit product with sign extension.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.