Ej N.

asked • 12/07/22

Represent the 4-bit ones complement number 0xE as an 8-bit twos complement number

I know that 0xE is 14 in decimal. I then did 14 + 2^4 which got me 30. 30 in 8-bits unsigned is 0011 0000. And -30 is 11100010. In hex that is E2. Im not sure if I am doing this right.


E2 is not the correct answer the correct answer is 0xFF but I want to know how they got 0xFF.

1 Expert Answer

By:

David W. answered • 12/08/22

Tutor
4.7 (90)

Experienced Prof

Ej N.

so if I had 0x7 instead of 0xe would I approach it the same way?
Report

12/08/22

David W.

No. 0x7 is the largest 4-bit number (left bit is the sign). "one's complement plus 1" only applies to negative values.
Report

12/08/22

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.