Our new Indie Games subforum is now open for business in G&T. Go and check it out, you might land a code for a free game. If you're developing an indie game and want to post about it, follow these directions. If you don't, he'll break your legs! Hahaha! Seriously though.
Our rules have been updated and given their own forum. Go and look at them! They are nice, and there may be new ones that you didn't know about! Hooray for rules! Hooray for The System! Hooray for Conforming!
*edit: To clarify, I'm not really asking for the exact answers, but if I'm right or wrong in the method. If I'm wrong, I'd like to know what I'm doing wrong so I can figure out the answer on my own.
I'm having a brain fart and my google-fu is failing me. I'm trying to show the decimal value of each number, given that it's a two's complement, hexadecimal 16bit int. This is supposed to be review, but I'm having trouble remembering all of it. So if I understand this correctly at 3am:
a) 25A7
0010 0101 1010 0111 => 9639
b) 90B3
1001 0000 1011 0011 0110 1111 0100 1100 +1
0110 1111 0100 1101 ?? <- is that right? this doesn't seem right since 37043 is out of the acceptable range. Or is it -28493? I'm having trouble mainly with this one.
c) FF3E
1111 1111 0011 1110 0000 0000 1100 0001 +1
0000 0000 1100 0010 => -194 (is this correct as well?)
"I hate war as only a soldier who has lived it can, only as one who has seen its brutality, its futility, its stupidity." Dwight D. Eisenhower Google+ Profile Origin: 13Evigilant Steam: Evigilant
b) 90B3
1001 0000 1011 0011 0110 1111 0100 1100 +1
0110 1111 0100 1101 ?? <- is that right? this doesn't seem right since 37043 is out of the acceptable range. Or is it -28493? I'm having trouble mainly with this one.
It's got a one set in its highest bit, so it is a negative number. It won't be 37,043 since that is a positive number, so...
"I hate war as only a soldier who has lived it can, only as one who has seen its brutality, its futility, its stupidity." Dwight D. Eisenhower Google+ Profile Origin: 13Evigilant Steam: Evigilant
Posts
It's got a one set in its highest bit, so it is a negative number. It won't be 37,043 since that is a positive number, so...
Yup.
Looks about right.
If you're on Windows, try using the calc (switch into scientific mode) to double check your answers.
Google+ Profile Origin: 13Evigilant Steam: Evigilant