Translate the base 10 value -45 into 8-bit two's complement representation.
Write down the decimal number and continually divide by 2 to give a result and a remainder. The remainder is either a 1 or a 0.
45 / 2 result 22 remainder 1 22 / 2 result 11 remainder 0 11 / 2 result 5 remainder 1 5 / 2 result 2 remainder 1 2 / 2 result 1 remainder 0 1 / 2 result 0 remainder 1
Read the remainders from bottom to top.
( 45 )10 = ( 101101 )2
( 45 )10 in 8-bit is ( 00101101 )2
Ones complement = Inverting all the bits in binary = 11010010 Twos complement = Ones complement + 1 = 11010010 + 1 = 11010011
11010011
Get Answers For Free
Most questions answered within 1 hours.