Question

In: Computer Science

Please show all work: Determine the 2’s complement equivalent of the following numbers in 8-bit format...

Please show all work:

Determine the 2’s complement equivalent of the following numbers in 8-bit format (N.B: You must show your work for full credit)!

  1. -12 =
  2. -9 =

Solutions

Expert Solution

1)Bit is the smallest unit in computers world.
2) 8 bit number means combinations of 0s and 1s.

For -12

For 2's complement we need two follow some rules

  • Convert the decimal number into binary number
  • apply 1s complement on binary number
  • and to the result of 1s complement add 1 (binary addition)

step 1) convert 12 in binary

12=00001100

replace left most bit with 1 two make it negative

-12 = 10001100

step 2) convert it into ones complement

for this you need to invert the given number (replace 1 by 0 and 0 by 1)

1's complement =

01110011

step 3) Add 1 to 1s complemt to convert it into 2's complement. (Binary addition are used and not normal mathematical addition because we are dealing in bits )

01110011

+1

01110100 ans

-------------------------------------------------------------------------

For -9

For 2's complement we need to follow some rules

  • Convert the decimal number into binary number
  • apply 1s complement on binary number
  • and to the result of 1s complement add 1 (binary addition)

step 1) convert 9 in binary  

9 = 00001001

replace left most bit with 1 two make it negative

-9= 10001001

step 2) convert it into ones complement

for this you need to invert the given number (replace 1 by 0 and 0 by 1)

1's complement = 01110110

step 3) Add 1 to 1s complemt to convert it into 2's complement. (Binary addition are used and not normal mathematical addition because we are dealing in bits )

2's complement =

01110110

+1

01110111


Related Solutions

add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also...
add the following numbers using 16-bit 2's complement. show all the steps and calculations. Please also show steps to verify that the answer is correct. -7493 and -6372
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent...
Find the decimal equivalents for the following 8-bit two’s complement numbers. a. 0010 0100 Decimal Equivalent ___________ b. 1010 1001 Decimal Equivalent ___________ c. 1100 0011 Decimal Equivalent ___________ d. 0101 0101 Decimal Equivalent ___________
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -18 to 8-bit sign magnitude, 1's complement and 2's complement.
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
Convert -122 to 8-bit sign magnitude, 1's complement and 2's complement
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers,...
7 – For the following operations: • write the operands as 4-bit 2's complement binary numbers, • perform the operation shown, • show all work in binary operating on 4-bit numbers, and • identify overflow if necessary. a) 4 + 2 b) 4 – 2 c) 2 – 4 d) 4 + 4
Convert the following decimal numbers to 16-bit 2’s complement binary. Display your result in hexadecimal. a.3030...
Convert the following decimal numbers to 16-bit 2’s complement binary. Display your result in hexadecimal. a.3030 b.404 c.5050 d.-5050 e.-20000 Show work with steps
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT