Hi.
I have eight sensors with digital output connected to a port and now I want to in the quickest way get only the highest set bit in to a variable.
if port = 110000
I want var = 000000
if port = 001111
I want var = 001000
So how can I do this in quickest(least amount of clock cycles) possible way?
Regards
/Matias
I have eight sensors with digital output connected to a port and now I want to in the quickest way get only the highest set bit in to a variable.
if port = 110000
I want var = 000000
if port = 001111
I want var = 001000
So how can I do this in quickest(least amount of clock cycles) possible way?
Regards
/Matias