ParallelPrefixPriorityEncoder constructor

ParallelPrefixPriorityEncoder(
  1. Logic inp, {
  2. ParallelPrefix ppGen(
    1. List<Logic>,
    2. Logic (
      1. Logic,
      2. Logic
      )
    ) = KoggeStone.new,
  3. String name = 'parallel_prefix_encoder',
})

PriorityEncoder constructor

Implementation

ParallelPrefixPriorityEncoder(Logic inp,
    {ParallelPrefix Function(List<Logic>, Logic Function(Logic, Logic))
        ppGen = KoggeStone.new,
    super.name = 'parallel_prefix_encoder'}) {
  inp = addInput('inp', inp, width: inp.width);
  addOutput('out', width: log2Ceil(inp.width));
  final u = ParallelPrefixPriorityFinder(inp, ppGen: ppGen);
  out <= OneHotToBinary(u.out).binary;
}