PDA

View Full Version : Hex v Dec v Binary



kevinb2050
09-30-2008, 09:00 AM
Is there a general rule of thumb as to when to use Hex, Dec or binary numbering with the stamp. I understand the different systems but am at a loss as to when each should be used. Is it a matter of memory, time, or floating point that determines which should be used. I note a lot of sample programs use a combination of all.

Franklin
09-30-2008, 09:42 AM
To the stamp they are all the same (binary) the only reason to use one over the other is how easy it will be to understand the reason you are using the number. Most will use binary when setting direction or high/low values of a port and hex or decimal depending on the documentation for the part you might be controlling.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

kevinb2050
09-30-2008, 09:58 AM
Thanks Franklin,
So it is only a personal preference to use Hex or Decimal, other than when specified by an external component

Franklin
09-30-2008, 10:06 AM
Not really, you can use either but if the component says ' send a 6f,fe,cd' do you want to do the math every time?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen

kevinb2050
09-30-2008, 10:09 AM
Thanks again, I get the message - why complicate things when you don't have too