Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Daishim

Why Hex?

This topic is 5850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve seen a lot of things, particulary in the Win32 SDK, that are referenced with hex values. I''ve done a little research into hex, but still can''t find out exactly why it''s used. Is there a particular reason? ... or a just cause they can? I know only that which I know, but I do not know what I know.

Share this post


Link to post
Share on other sites
Advertisement
Computers deal with binary and representing binary is tedious and error prone and decimal would be of no use if you wanna understand. so hex is an easy way to represent the binary values..

Slow and steady wins the race.

Share this post


Link to post
Share on other sites
Hexadecimal has the unique property of easily converting to most of the other commonly used numerical bases (with the exception of decimal). One hex digit is equivalent to four binary digits, and converting octal to hex isn''t too much of a stretch.

It''s convenient, more compact than binary and less error prone.

Share this post


Link to post
Share on other sites
quote:
Original post by Oluseyi
It''s convenient, more compact than binary and less error prone.


I have bad memories about typing endless listings of hex off computer magasines to get whatever the game of the month was...

Share this post


Link to post
Share on other sites
Hehe, and you probably all recall the "good old days" when we programmed machine code on our Commodore 64 by placing hex values directly in memory after looking your hand-written assembler program up in the opcode table... < shivers >

Share this post


Link to post
Share on other sites
>> It''s much better than decimal in almost all respects...

If we were to change counting base, I would vote for base 12 instead. Although that gives 3 bits I think that the advantage in daily life is higher with base-12 since 12 is dividable by a lot of small integers: 1, 2, 3, 4, and 6. By using 10 or even 16 we loose divability with 3 which is a shame. I hate have to split some cost of something between three people would you are out to buy something and not being able to do the split correctly during our inferior base-10 system.

Share this post


Link to post
Share on other sites
quote:
Original post by felonius
>> It''s much better than decimal in almost all respects...

If we were to change counting base, I would vote for base 12 instead. Although that gives 3 bits I think that the advantage in daily life is higher with base-12 since 12 is dividable by a lot of small integers: 1, 2, 3, 4, and 6. By using 10 or even 16 we loose divability with 3 which is a shame. I hate have to split some cost of something between three people would you are out to buy something and not being able to do the split correctly during our inferior base-10 system.


I concede that point. Plus 12 means we''d have a much smaller multiplcation table than 16


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by felonius
I would vote for base 12 instead. Although that gives 3 bits

No, base-12 requires 4 bits to represent (octal is 3 bits), and base-16 would (IMO) be preferable in the world of computers, since it''s also 4 bits and all bit combinations are valid base-16 numbers. IRL base-12 could have its advantages though

Share this post


Link to post
Share on other sites
quote:
Original post by felonius
Hehe, and you probably all recall the "good old days" when we programmed machine code on our Commodore 64 by placing hex values directly in memory after looking your hand-written assembler program up in the opcode table... < shivers >


Your damn right! And we didn''t need all your fancy general purpose registers. 2 index registers and an accumulator was all we needed. Young folk today have it easy, too few addressing modes is their problem.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!