Addition: 9D 1D //all in hex BD 7D Subtraction: -11 6F 1F -31 Any explanation wo
ID: 3750968 • Letter: A
Question
Addition: 9D 1D //all in hex BD 7D
Subtraction: -11 6F 1F -31
Any explanation would be great and I do give thumbs up for correct work. Thank you.
Does carry occur during any of the following (supposedly unsigned number) additions (8-bit adder)? (a) 4616+ 5116 (b) C66+ 5716 (c) E61+ C716 (d)2616+ 5716 Does overflow occur during any of the following (supposedly signed number) subtractions (8-bit adder)? (a) 4616-5716 (b) C616-5716 (c) E616-C716 (d) 2616-5716 Does carry occur during any of the following (supposedly unsigned number subtractions (8-bit adder)? (a) 4616- 5716 (b) C616- 5716 (c) E616- C716 (d)266-57
Explanation / Answer
1. The carry flag is set if the addition of two numbers causes a carry
out of the most significant (leftmost) bits added.
1111 + 0001 = 0000 (carry flag is turned on)
2. The carry (borrow) flag is also set if the subtraction of two numbers
requires a borrow into the most significant (leftmost) bits subtracted.
0000 - 0001 = 1111 (carry flag is turned on)
Otherwise, the carry flag is turned off (zero).
* 0111 + 0001 = 1000 (carry flag is turned off [zero])
* 1000 - 0001 = 0111 (carry flag is turned off [zero])
In unsigned arithmetic, watch the carry flag to detect errors.
In signed arithmetic, the carry flag tells you nothing interesting.
Overflow Flag
-------------
The rules for turning on the overflow flag in binary/integer math are two:
1. If the sum of two numbers with the sign bits off yields a result number
with the sign bit on, the "overflow" flag is turned on.
0100 + 0100 = 1000 (overflow flag is turned on)
2. If the sum of two numbers with the sign bits on yields a result number
with the sign bit off, the "overflow" flag is turned on.
1000 + 1000 = 0000 (overflow flag is turned on)
For Addition:
Carry occur in B and C cases
For subtraction
overflow occur for A and D cases
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.