Two's Complement Representation

This section includes exercises on converting between 2's complement and decimal.

How to use an exercise:

Exercise 1. Convert 8-bit 2's Complement to Decimal

Reference: lecture on converting a 2's complement number to decimal.

1. Generate a random 8-bit 2's Complement number:

2. Please convert it to decimal: -
3. Now check your answer:

-

4. Show the solution:

-

Exercise 2. Convert Decimal to 8-bit 2's Complement

Reference: lecture on converting a decimal to 2's complement format.

1. Generate a random decimal number:

2. Please convert it to 8-bit 2's Complement: -
3. Now check your answer:

-

4. Show the solution:

-

 

© 2022 Bin Peng
Bug reports and comments are welcome: crystal dot peng at park dot edu

Last Update:
Created: November 17, 2018