0

The question I have is determining the range of numbers (in base 10) that can be represented with a) 32bits and b) 64bits

The first question I had was same concept, but asked to determine binary(base2) instead of BCD For 32bits I did 2^32 and 2^64 For 64bits I'm not sure if I answered the question right because I don't fully understand what it's asking..

I need help please Thank you

Icemanind
  • 47,519
  • 50
  • 171
  • 296
SMLJ
  • 9
  • 4

1 Answers1

0

Binary Coded Decimal is where a 4 bits are used to encode one digit of a number:

0000 = 0
0001 = 1
0010 = 2
0011 = 3
0100 = 4
0101 = 5
0110 = 6
0111 = 7
1000 = 8
1001 = 9

To encode a number, such as 157, it would look like this:

0001 0101 0111
---- ---- ----
 1    5    7

Because it takes 4 bits to encode one digit, you can figure out how large a number you can store by doing this:

32 bits / 4 bits = 8 digit number max.

So with 32-bits, you could store any number between 0 and 99,999,999. If you have 64-bits:

64 bits / 4 bits = 16 digit number max.

So with 64-bits, you could store any number between 0 and 9,999,999,999,999,999

I hope this clears things up for you!

Icemanind
  • 47,519
  • 50
  • 171
  • 296
  • from seeing that 32/4 -8 digits and 64/4 -16 digits, if the question is for binary, not BCD, is it going to be 32/2-16 digits and 64/2 -32 digits? – SMLJ Jan 15 '15 at 06:21
  • No. In binary, the largest unsigned number that can fit into 32-bits is from 0 to 4,294,967,295. For 64-bits, its from 0 to 18,446,744,073,709,551,616. To calculate this, you use 2^32 or 2^64. – Icemanind Jan 15 '15 at 06:34