0
$\begingroup$

8 bit binary number $01101110$ is on a computer using two’s complement representation. What should it be in decimal?

My solution is:
reverse it to $10010001$
$10010001+1 = 10010010$
$10010010$ to decimal is $146$
answer is $-146$ but this seems incorrect.

Any ideas?

$\endgroup$
1
$\begingroup$

Th number is positive because the MSB is $0$. So simply $01101110_2 = 64+32+8+4+2$.

| cite | improve this answer | |
$\endgroup$
1
$\begingroup$

This is a positive number because the most significant bit (MSB) is $0$. So the decimal representation of $01101110_2$ is $2^6+2^5+0+2^3+2^2+2^1+0=110$

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.