operator | method

  1. @override
Logic operator |(
  1. Logic other
)
override

Logical bitwise OR.

Implementation

@override
Logic operator |(Logic other) {
  _checkMatchingWidth(other);

  if (other is Const) {
    return Const(value | other.value);
  } else if (value.isValid &&
      value == LogicValue.filled(width, LogicValue.one)) {
    return this;
  }

  return Or2Gate(this, other).out;
}