I have a set of binary numbers (originally was hex's) that I want to find the index of 1 in it. These sets are :
1000, index = 3
0100, index = 2
0010, index = 1
0001, index = 0
I can't wrap my head around it, I tried getting the decimal representation and do some math magic with it to turn it into 0, 1, 2, 3 but no clue.