oddszone
asked on
Calculating values from string
I have an input string "BEA4F1" into which is encoded the following printer colour settings.
10 bits are colour intensity (0 to 1023)
10 bits are colour range ( 0 to 1023)
4 bits are for colour (0 to 15)
So an example message would be "BEA4F1"
intensity = 762 = 1011111010
range = 591 = 1001001111
colour = 1 = 0001
So binary (24 bits = 1011 1110 1010 0100 1111 0001 = "BEA4F1"
how do I get intensity, range and colour values back from string "BEA4F1"?
Thanks
10 bits are colour intensity (0 to 1023)
10 bits are colour range ( 0 to 1023)
4 bits are for colour (0 to 15)
So an example message would be "BEA4F1"
intensity = 762 = 1011111010
range = 591 = 1001001111
colour = 1 = 0001
So binary (24 bits = 1011 1110 1010 0100 1111 0001 = "BEA4F1"
how do I get intensity, range and colour values back from string "BEA4F1"?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Spot on thanks !
Open in new window