it late and minds going dull

looking for a math function to change a value 1- 8 to be bit 0 - 7 representation value


value 1 = 1 ' bit 0
2 = 2 ' bit 1
3 = 4 ' bit 2
4 = 8 ' bit 3
5 = 16 ' bit 4
6 = 32 ' bit 5
7 = 64 'bit 6
8 = 128 ' bit 7
cheers