Question

(1) For the following byte addition operations, list the result of addition, and what happens to the three status flags, Z (z

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Answer:
--------
1)
Z = 0
N = 1
V = 0

2)
Z = 0
N = 0
V = 1

Explanation:
-------------
1)
Adding 10010110 and 01101001 in binary
    10010110
    01101001
-------------
 (0)11111111
-------------
Sum does not produces a carry
So, sum of these numbers in binary is 11111111

Verification
---------------
first = 10010110
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   10010110 is flipped to 01101001
II. Add 1 to above result
01101001 + 1 = 01101010
III. Now convert this result to decimal value
Converting 1101010 to decimal
1101010
=> 1x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+0x2^0
=> 1x64+1x32+0x16+1x8+0x4+1x2+0x1
=> 64+32+0+8+0+2+0
=> 106
Answer: -106

second = 01101001
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
Converting 1101001 to decimal
1101001
=> 1x2^6+1x2^5+0x2^4+1x2^3+0x2^2+0x2^1+1x2^0
=> 1x64+1x32+0x16+1x8+0x4+0x2+1x1
=> 64+32+0+8+0+0+1
=> 105
Answer: 105

sum = 11111111
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   11111111 is flipped to 00000000
II. Add 1 to above result
00000000 + 1 = 00000001
III. Now convert this result to decimal value
Converting 1 to decimal
1
=> 1x2^0
=> 1x1
=> 1
=> 1
Answer: -1
This is correct since we can verify that -106+105 = -1
So, there was no overflow.

2)
Adding 10110100 and 10010101 in binary
    10110100
    10010101
-------------
 (1)01001001
-------------
Sum produces a carry of 1. We can ignore that carry.
So, sum of these numbers in binary is 01001001

Verification
---------------
first = 10110100
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   10110100 is flipped to 01001011
II. Add 1 to above result
01001011 + 1 = 01001100
III. Now convert this result to decimal value
Converting 1001100 to decimal
1001100
=> 1x2^6+0x2^5+0x2^4+1x2^3+1x2^2+0x2^1+0x2^0
=> 1x64+0x32+0x16+1x8+1x4+0x2+0x1
=> 64+0+0+8+4+0+0
=> 76
Answer: -76

second = 10010101
since left most bit is 1, this number is negative number.
so, follow these steps below to convert this into a decimal value.
I. first flip all the bits. Flip all 0's to 1 and all 1's to 0.
   10010101 is flipped to 01101010
II. Add 1 to above result
01101010 + 1 = 01101011
III. Now convert this result to decimal value
Converting 1101011 to decimal
1101011
=> 1x2^6+1x2^5+0x2^4+1x2^3+0x2^2+1x2^1+1x2^0
=> 1x64+1x32+0x16+1x8+0x4+1x2+1x1
=> 64+32+0+8+0+2+1
=> 107
Answer: -107

sum = 01001001
since left most bit is 0, this number is positive
so, we can directly convert this into a decimal value
Converting 1001001 to decimal
1001001
=> 1x2^6+0x2^5+0x2^4+1x2^3+0x2^2+0x2^1+1x2^0
=> 1x64+0x32+0x16+1x8+0x4+0x2+1x1
=> 64+0+0+8+0+0+1
=> 73
Answer: 73
-76+-107 must be -183
This is not correct since we can verify that -76+-107 not equals 73
So, there was an overflow.
Add a comment
Know the answer?
Add Answer to:
(1) For the following byte addition operations, list the result of addition, and what happens to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT