Documente Academic
Documente Profesional
Documente Cultură
Problem 2:
a) Decimal value of 1011010011: -(2^0+2^1+2^4+2^6+2^7) = -211
b) Decimal value of 0100011010: +(2^1+2^3+2^4+2^8) = 282
c) Decimal value of 1111111111: -(2^0+2^1+2^2+2^3+2^4+2^5+2^6+2^7+2^8) = -(2^9-1
)= -511
d) Decimal value of 1000000000: -(0) = 0
Problem 3:
a) 2048 = 2^11. So, in 32-bit two's complement binary, 2048 becomes: 00000000000
000000000100000000000
b) 456 = 2^8+2^7+2^6+2^3, which is 00000000000000000000000111001000.Flip bits an
d add one for the negative. So, in 32-bit two's complement binary,-456 becomes:
11111111111111111111111000111000.
c) 3,450,001 = 2^21+2^20+2^18+2^15+2^13+2^10+2^7+2^4+2^0, which is 0000000000110
1001010010010010001. Flip bits and add one for the negative. So, in 32-bit two's
complemend binary, -3,450,001 becomes: 11111111110010110101101101101111.
Problem 4:
a) Flipping the bits and adding 1 gives 0000 0010 1101 0010 0000 0001 0111 0100.
In decimal, this is 47,317,362. So,the decimal value of 1111 1101 0010 1101 111
1 1110 1000 1100 is: -47,317,364.
b) Flipping the bits and adding 1 gives 0000 0000 0000 0000 0000 0000 0000 0001.
In decimal, this is 1. So, the decimal value of 1111 1111 1111 1111 1111 1111 1
111 1111 is: -1.
c) First digit is 0, so the decimal number must be a positive. 2^31 - 1 = 2,147,
483,647. So, the decimal value of 0111 1111 1111 1111 1111 1111 1111 1111 is: 2,
147,483,647.