Hi all,
I am needing to work with communicating with an instrument through binary and I am having a bit of trouble. I am working with a specific number of bits (bit 0 - bit 14) but I need to be able to change the step size. For example say my step size is 0.05 my bits would be as follows:
bit 14 - 819.20
bit 13 - 409.60
bit 12 - 204.80
bit 11 - 102.40
bit 10 - 51.20
bit 9 - 25.60
bit 8 - 12.80
bit 7 - 6.40
bit 6 - 3.20
bit 5 - 1.60
bit 4 - 0.80
bit 3 - 0.40
bit 2 - 0.20
bit 1 - 0.10
bit 0 - 0.05
Using this I need to be able to convert a decimal number to binary, such that 486.6 would become 010011000000100 and then lastly I need to be able to invert the binary to 101100111111011
any help on this matter would be greatly appreciated.