package hardcaml_circuits

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Hardcaml_circuits.Onehot_cleanSource

Convert 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 -> 1000
  • 0000 -> 0000
  • 0110 -> 0100
Sourcetype 'a t = {
  1. any_bit_set : 'a;
  2. data : 'a;
}
Sourceval scan_from_msb : (module Hardcaml.Comb.S with type t = 'a) -> 'a -> 'a t
Sourceval scan_from_lsb : (module Hardcaml.Comb.S with type t = 'a) -> 'a -> 'a t