Bitwise_OR Bitwise_OR Icon

LogicGates.Bitwise_OR

Bitwise_OR(; name)

A bitwise OR operation component for two integer input signals.

Variables

  • a(t): First integer input signal (placement: left side, upper)
  • b(t): Second integer input signal (placement: left side, lower)
  • y(t): Output signal (placement: right side)

Description

Performs a bitwise OR operation between two integer input signals using the bitwise_or(a, b) function. This applies the standard bitwise OR (|) operation, setting each bit in the result to 1 if the corresponding bit in either input is 1.

Usage

PrimitiveComponents.LogicGates.Bitwise_OR()

Connectors

  • a - This connector represents an integer signal as an input to a component (IntegerInput)
  • b - This connector represents an integer signal as an input to a component (IntegerInput)
  • y - This connector represents an integer signal as an output from a component (IntegerOutput)

Behavior

\[ \begin{align} y\left( t \right) &= bitwise\_or\left( a\left( t \right), b\left( t \right) \right) \end{align} \]

Source

"""
    Bitwise_OR(; name)

A bitwise OR operation component for two integer input signals.

# Variables
- `a(t)`: First integer input signal (placement: left side, upper)
- `b(t)`: Second integer input signal (placement: left side, lower)
- `y(t)`: Output signal (placement: right side)

# Description
Performs a bitwise OR operation between two integer input signals using the bitwise_or(a, b) function.
This applies the standard bitwise OR (|) operation, setting each bit in the result to 1 if the
corresponding bit in either input is 1.
"""
component Bitwise_OR
  a = Dyad.IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 200, "y2": 240, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 200, "y2": 240, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  b = Dyad.IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 760, "y2": 800, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 760, "y2": 800, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  y = Dyad.IntegerOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
        "icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
relations
  y = bitwise_or(a, b)
metadata {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/OR.svg"}}}
end
Flattened Source
"""
    Bitwise_OR(; name)

A bitwise OR operation component for two integer input signals.

# Variables
- `a(t)`: First integer input signal (placement: left side, upper)
- `b(t)`: Second integer input signal (placement: left side, lower)
- `y(t)`: Output signal (placement: right side)

# Description
Performs a bitwise OR operation between two integer input signals using the bitwise_or(a, b) function.
This applies the standard bitwise OR (|) operation, setting each bit in the result to 1 if the
corresponding bit in either input is 1.
"""
component Bitwise_OR
  a = Dyad.IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 200, "y2": 240, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 200, "y2": 240, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  b = Dyad.IntegerInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 760, "y2": 800, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 760, "y2": 800, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  y = Dyad.IntegerOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0},
        "icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 1, "sw": 1, "rot": 0}
      }
    }
  }
relations
  y = bitwise_or(a, b)
metadata {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/OR.svg"}}}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses