Consider that R1 and R2 both are 8
bit registers and contains 01010101 and 10011010 respectively. What will be the values of
select inputs, carry-in input and result of operation (including carry out bit) if the following
micro-operations are performed? (i) Increment R1
(ii) Subtract R2 from R1 with borrow
(iii)Exclusive OR of R1 and R2
(iv)Shift left R1
Answers
1.
Increment R1
= 01010101 + 1
Enter Number A
01010101
Enter Number B
00000001
A + B (Binary) = 1010110
A + B (Decimal) = 86
2.
Enter Number A
01010101
Enter Number B
10011010
2's Complement
A - B (Binary) = 1000101
A - B (Decimal) = -69
Input Data :
Binary Input 1 = 01010101
Binary Input 2 = 10011010
Obejective :
010101012 - 100110102 = ?
Find 2's complement of 10011010
1's complement of 10011010 = 01100101
2's complement of 10011010 = 01100101
1
01100110
Input 1 01010101
2's Complement of 10011010 01100110
Sum 10111011
As the sum has no carry take 2's complement for 10111011 and add negative sign
1's complement of 10111011 = 01000100
2's complement of 10111011 = 01000100
1
01000101
01010101 - 10011010 = -01000101
3.
A Ex OR B
Enter Number A
01010101
Enter Number B
10011010
A + B (Binary) = 11101111
A + B (Decimal) = 239
4.
Shift left R1
10101010