You do not have to show detailed calculations for converting between decimal, he
ID: 3784076 • Letter: Y
Question
You do not have to show detailed calculations for converting between decimal, hexadecimal and binary representations on this assignment.
1. State what decimal values the following binary numbers represent if you interpret these binary numbers as either unsigned binary, signed magnitude, one’s complement, two’s complement, or excess-128 forms: (Show Calculations)
(a) 0101 1011 (c) 1000 0000 (e) 0000 0000 (g) 0000 0001
(b) 1101 1001 (d) 1111 1111 (f) 1000 0001 (h) 0111 1111
1. Perform each of the following arithmetic operations by first converting the given decimal numbers into 8-bit two’s complement form. In each case, comment explicitly on whether you’ve detected overflow or not at the binary arithmetic level. (Show Calculations)
(a) 50 + 57 (b) 116 - 73 (c) -59 - 46 (d) -73 - 86 (e) –116 + 85 (f) 99 + 63
Explanation / Answer
a) 0101 1011 = 2^6+0+2^4+2^3+0+2^1+2^0 = 64+16+8+2+1 = 91 in unsigned /signed
b) 1101 1001 = 217 in unsigned binary as using 8 bits we can represent decimal numbers from 0 to 255 , so 217 can be represented in unsigned integer
for signed integer : we can represnt decimal numbers from 0 to 127 .To represent in signed binary we need to take 2's compliment. First 1's compliment and then add 1 .
1's compliment of above binary = 0010 0110 = 38 + 1(for 2's compliment add 1). = 39
So for above binary , 217 in unsigned form and -39 in signed form
c) 1000 0000 = 2^7+0+0+0+0+0+0+0 = 128 in unsigned binary.
as explained above , for signed integer : 1's compliment of above binary
0111 1111 = 127 + 1 = 128 , -128 in signed decimal
d) 1111 1111= 2^7 + 2^6+2^5+2^4+2^3+2^2+2^1+2^0 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 in unsigned/signed decimal number.
In signed decimal: 1's compliment of binary = 0000 0000 + 1 = 1.
Above binary is -1 in decimal signed form.
e) 0000 0000 = 0 unsigned integer/signed integer
f) 1000 0001 = 2^7 +0+0+0+0+0+0+2^0 = 128 +1 = 129 in unsigned decimal number. 129 -128 = 1 in signed decimal number
g) 0000 0001 = 1 in unsigned/signed decimal form.
h) 0111 1111 = 127 in unsigned/signed decimal form
---------------------------------------------------------------------------------------------------------
a) 50 + 57 = 11 0010 + 11 1001 = 1101011 = 107 no overflow.
b) 116 - 73 = 111 0100 - 100 1001(73 in binary)
-73 represented in 2's compliment = 011 0110 + 1 = 55
116 -73 = 111 0100 + 11 0111 = 10101011 = leave the MSB (7th bit) 1 = 010 1011 = 43
There is no overflow
c) -59-46
2's compliment of -59 (59 in binary 0011 1011) = 1's compliment of binary 59 +1
= 1100 0100 + 1 = 1100 0101
2's compliment of -46( 46 in binary 0010 1110) = 1101 0001 + 1 = 1101 0010
add 2's compliment of 59 and 46 = 1100 0101 + 1101 0010 = 1 1001 0111
There is overflow , convert above number to 1's complement and add 1 to get answer in decimal
0 0110 1000 + 1 = -105
There is overflow
d) -73 - 86
-78 in 2's complement = (100 1110) 1011 0001 +1 = 1011 0010
-86 in 2's complement = (101 0110) 1010 1001+1 = 10101010
1011 0010 + 10101010 = 1 0101 1100 (discard carry)= 1010 0011 + 1 = -164
There is overflow
e) -116 + 85 = -31
116 in 2's complement = 1000 1011(111 0100) + 1 = 10001100
85 in binary = 101 0101
add above binary numbers = 10001100 + 0101 0101 = 1110 0001= -31
as -31 represented in 2's complement -31 = 1110 0000 (1 1111) + 1 = 1110 0001 =
There is no overflow
f) 99 + 63
99 in binary = 1100011
63 in binary = 111111
1100011 + 111111 = 1010 0010 = 162 , no overflow in unsigned representation.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.