This module provides the functionality for checking the penny-drop encoders and converting the encoded value into a decoded value.
Take 1 argument of type InputT (the input for the encoder), return the encoded result:
If the penny passes through slot i then return Bit i-1 hi , otherwise return 0.
e.g:
0 if no coin detected
100 if coin detected at Slot 2
declare check, of type unsigned int
set check equal to the Encoder, and shift so that the 0th bits of both match
invert check and mask with the positions of the check bits
if check is 0, return 0
otherwise, shift a 1 into the (check-1) bit of check (priority-decode it)
return check