addresses

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
eboyd
Member
Member
Posts: 97
Joined: Thu Jul 26, 2007 9:18 am
Location: United States

addresses

Post by eboyd »

if i have 4 bits I can use 1 hex char...

if i have 8 bits I can use 2 hex chars...

if i have 16 bits I can use 4 hex chars...

etc, etc, etc.

so does that mean i need 128 hex chars for 512 bits?


also, i've been pondering this:

what about internal representations of number systems, example:

can't we cut down the number of numbers needed to address things by using a number system of a higher base?

like: if i had a number system with 1024 digits, can't i address 512 bits with
less characters? (roughly 6 or so hex chars?)

i'm all confused...


:shock:
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

of course you could represent thing with a higher base as long as the base is in the form of 2^n.
Binary would be the for of 2^1 (base 2)
oct would be the form of 2^3 (base 8)
hex would be the form of 2^4 (base 16)

In hex you use "0123456789ABCDEF" to represent the various values, but what about 2^5 (base 32) then? something like:
"0123456789ABCDEFGAHIJKLMNOPQRSTU"
Sure it would be possible, but would be somewhat difficult to work with and what about 2^6 (base 64) then? We run out of characters.

Yes, it is possible, but i dont believe it would be worth it.

base 2 char = up to 1 bits
base 4 char = up to 2 bits
base 8 char = up to 3 bits
base 16 char = up to 4 bits
base 32 char = up to 5 bits
etc...
base 1024 char = up to 10 bits
This was supposed to be a cool signature...
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: addresses

Post by AJ »

eboyd wrote: so does that mean i need 128 hex chars for 512 bits?
Yes. That's the ice thing about hex - one hexadecimal digit always represents 4 bits (a nibble). That is one of the things that makes it so easy to 'translate' from base 16 to base 2. You know that:

0xF = 1111b
0x8 = 1000b
0x1 = 0001b
therefore, you also know that

0xF8 = 1111 1000b

and the same system can be extended to any length of number, so

0x1F81 = 0001 1111 1000 0001b

HTH
Cheers,
Adam
Post Reply