Hardcaml_circuits.Onehot_cleanConvert an arbitrary input vector to onehot. The first bit set scanning from either the lsb or msb will be set in the output and all others will be 0. The architecture has logarithmic delay.
examples (with scan_from_msb):
1111 -> 10000000 -> 00000110 -> 0100val scan_from_msb : (module Hardcaml.Comb.S with type t = 'a) -> 'a -> 'a tval scan_from_lsb : (module Hardcaml.Comb.S with type t = 'a) -> 'a -> 'a t