Hello, I would like some help on this one problem in my assignment. I have completed the table but something caught my attention and i feel i did something wrong. I attached the same table i filled out on this thread. I would like help on the first row. My answers for the first row was:

18 ? 0x12 22 ?

I think the answer for the 2's complement is 0001 0010 (binary) because im assuming its asking to represent the decimal in 2's complement format. So if thats the case, Sign magnitude column should also be 0001 0010, am I correct on this?

Recommended Answers

All 2 Replies

For 18 decimal we have:
2's complement = 0001 0010 (16 + 2, since it isn't negative nothing else needs to be done).
Hexadecimal = 0x12
Octal = 22
Sign-magnitude = 0001 0010 (since it is positive first bit is 0, the next 7 bits are just the value, again 16+2).

So yes, you are correct about the sign-magnitude value.

i think that its solved because momerath is right.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.