A Bit manipulation brain teaser for you :)
Hey Gang, let me know if you have "done that - got my T-shirt" and know the answer to this one.
I have 4 (8 bit) bytes being sent to me in a serial string.
Byte_1 is to be multiplied by 16777216
Byte_2 is to be multiplied by 65536
Byte_3 is to be multiplied by 256
Byte_4 is to be multiplied by 1
These are all then added to be converted into their decimal equivalent.
I can do this in a PC no problemo
But how do do it in a PIC where your greatest mathmatic result is limited to <= 65535?
I have played around with sum divisions by 1000, and seem to almost get there until I have to deal with adding Byte_4s value to the result.
Interested in your suggestions