Signed hexadecimal value range

Let's say I had a six-digit hexadecimal number signed in two's complement. What will be its range?

-(16 ^ 5) < x < (16 ^ 5)

Right?

+2


a source to share


1 answer


This sounds like homework. If so, please mark your question as such.

One way to think about this:

  • How many bytes are represented by six hexadecimal digits?
  • How many bits are represented by these bytes?
  • How many bits are you missing due to the sign?
  • Given your total number of bits, what's the smallest value you can imagine?
  • Given the total number of bits, what is the largest value you can imagine?


Think about the answer to the last question.

For example, the smallest signed 32-bit int is -2147483648. The largest signed 32-bit int is 2147483647.

+1


a source







All Articles