Represent the following twos complement values in decimal: 1101011; 0101101.


1101011: Because this starts with a leftmost 1, it is a negative number. The magnitude of the negative number is determined by flipping the bits and adding 1:
0010100 + 1 = 0010101 

This is 21, so the original value was –21.
0101101
Because this starts with a leftmost 0, it is a positive number and we just compute the magnitude as an unsigned binary number, which is 45.

0 comments:

Feel free to contact the admin for any suggestions and help.