Quiz5 - Solution PDF
Quiz5 - Solution PDF
Quiz5 - Solution PDF
QUIZ #5
1. Given x = -7 and y = -5. Find the twos complement notation of x and y, then
compute the product x x y with Booths Algorithm using 4-bit words.
(11 marks)
Answer:
X = -7 = 0111=1000+1=1001=M [1]
Y= -5 = 0101=1010+1 =1011= Q [1]
A Q Q-1 M
0000 1011 0 1001 Initial [1]
0111 1011 0 0+0111 Subtract [1]
0011 1101 1 Shift [1]
0001 1110 1 Shift [1]
1010 1110 1 0001+1001 Add [1]
1101 0111 0 Shift [1]
0100 0111 0 1101+0111 Subtract [1]
0010 0011 1 Shift [1]
opcode address
1 Load AC from memory
0 7 23 5 Subtract AC from memory
2 Store AC to memory
magnitude Table 1
0 1 23
Figure 1
Show the program execution (step by step) based on Figure 2.
PC
1500
1500 014002
AC
1501 054003
IR
1502 024001
: :
4001 000000
00000A
4002
00000F
4003
Figure 2
Answer: