Sum.ofLogics constructor

Sum.ofLogics(
  1. List<Logic> logics, {
  2. dynamic initialValue = 0,
  3. dynamic maxValue,
  4. dynamic minValue = 0,
  5. Logic? enable,
  6. int? width,
  7. bool saturates = false,
  8. String name = 'sum',
})

Computes a Sum across the provided logics.

All logics are always incrementing and controlled optionally by a single enable.

Implementation

factory Sum.ofLogics(
  List<Logic> logics, {
  dynamic initialValue = 0,
  dynamic maxValue,
  dynamic minValue = 0,
  Logic? enable,
  int? width,
  bool saturates = false,
  String name = 'sum',
}) =>
    Sum(
        logics
            .map(
                (e) => SumInterface(width: e.width, hasEnable: enable != null)
                  ..amount.gets(e)
                  ..enable?.gets(enable!))
            .toList(),
        initialValue: initialValue,
        maxValue: maxValue,
        minValue: minValue,
        width: width,
        saturates: saturates,
        name: name);