English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

With the given information in a 32 bit register
number WORD 8A45h

how do I know if it is a positive integer or a negative integer?

Can someone explain, how do I know the difference between a positive and negative integer in 32 bit registers?
Serious responses only, please!

2007-03-05 06:14:53 · 1 answers · asked by Rosy 3 in Computers & Internet Programming & Design

1 answers

It isn't clear exactly what your initial condition is so I can't answer for sure.

Overall, though, you can't answer for sure. If the value is unsigned it's positive no matter what. If it's signed and the high bit is 1 it's negative. If the high bit is 1 you have to know how the program is going to interpret it to know whether it's positive or negative.

If your 8A45 is a 16-bit signed number it's negative. If it's 32-bit it's positive. If it's unsigned it's positive.

2007-03-05 09:35:42 · answer #1 · answered by Loren Pechtel 3 · 0 0

fedest.com, questions and answers