PDA

View Full Version : Double word, any creative solutions?



enigma
- 7th May 2006, 10:30
Hi All

I have a project where I need to store numbers consisting of 6 digits. This obviously wont fit into a single word as is and I`m sure PBP wont support double word. Any creative ideas as to how to get around this?. In the project having stored this number I then have to do a comparison against a list of similar 6 digit numbers for a match so a solution needs to be easily sorted too.

Cheers Pete

Melanie
- 7th May 2006, 13:25
Take the six digits, convert them to three Bytes and save them as such... eg...

Number=990714

Byte1=99
Byte2=07
Byte3=14

You can quickly scan down a huge (sorted) list in EEPROM just comparing Byte1, if it matches go on to Byte2 and if that matches go on to Byte3.

enigma
- 7th May 2006, 14:40
Hi Melanie!

Thanks for that, quite logical really!. I`ll have a futher play with this and see what I can make work, I only have around 30 pairs of numbers to compare and the second of the pair depend on the outcome of the match of the first.

Cheers Pete