Perform the following calculations, given that all numbers are in 2’s complement
ID: 3743861 • Letter: P
Question
Perform the following calculations, given that all numbers are in 2’s complement, then convert to base 10. Leave answers in the given bit length and make a note of it if overflow occurs:
a) 1101 - 0100
b) 1011 + 0101
c) 01011 + 00110
Explanation / Answer
a) 1101 - 0100 +1101 -0100 -0100 => 1100 so, 1101 - 0100 = 1101 + 1100 1101 1100 ----- (1)1001 ----- There was an overflow, 1101 in decimal is -0011 => -3 b) 1011 + 0101 1011 0101 ----- (1)0000 ----- There was an overflow, 0000 in decimal is 0 c) 01011 + 00110 01011 00110 ----- 10001 ----- There was no overflow, 10001 in decimal is -01111 => -15
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.