Be Humble... Be Nice.
How can I convert 1111 1000 0000 0000 0000 0000 0000 0000 to decimal
How can I convert 0xDeadCafe to decimal
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Be Humble... Be Nice.
Originally posted by Arjun Reddy:
Thanks Henry.. I will learn twos compliment now Um... Marc, thanks for replying too...does lower case and upper case letters matter? Can I consider same lower case d as 13 and Upper case D as 13 too?
Be Humble... Be Nice.
Originally posted by Arjun Reddy:
The reason I asked was because I was confused, the answer for 0xDeadCafe is 559035650.This is not the result I get according to what Marc said. Doing just 13*(16^7) itself is giving a number bigger than the answer.
Thanks.
Be Humble... Be Nice.
Originally posted by Henry Wong:
That is because the number is negative  the sign bit is one. You need to take into account twos complement when negative numbers are involved.
Henry
Be Humble... Be Nice.
Henry, Then for 0xbeef, the sign bit is also 1(b>1011) right, so we have to do a twos complement right? but the answer to this is 48879(twos complement not done here)?
Be Humble... Be Nice.
Originally posted by Campbell Ritchie:
Try it with 0xFE first; it is a lot easier to handle 8 bits than 32!
Squanch that. And squanch this tiny ad:
how do I do my own kindlelike thing  without amazon
https://coderanch.com/t/711421/engineering/kindleamazon
