One technique is the one we usually follow by converting the binary number to decimal.
1111010 = -64+32+16+8+2=-6
00001010 = 10
-6*10=-60
This one is different :
Evaluate booth's encoding for both of them..
Eg: -14 = (10010) in 2's complement. It's booth encoding is
-10+1-10.
24 |
23 |
22 |
21 |
20 |
-1 |
0 |
+1 |
-1 |
0 |
So, (-1)*24 + (+1)*22 + (-1)*21= -16+4-2 =-16+2 =-14
Similarly for given two numbers:
1111010 : Booth's encoding is 0-1+1-10
24 |
23 |
22 |
21 |
20 |
0 |
-1 |
1 |
-1 |
0 |
= -8+4-2= -6
and 00001010 : Booth's encoding is 0+1-1+1-10
25 |
24 |
23 |
22 |
21 |
20 |
0 |
+1 |
-1 |
+1 |
-1 |
0 |
+16-8+4-2= 20-10=10.
-6*10=-60
Ignore this if you find it time taking..I found this method recently that is why thought of sharing :P