Logical_NOT Logical_NOT Icon

LogicGates.Logical_NOT

Logical_NOT(; name, abs_tol=1e-3, target_value=0.0)

A logical NOT operation component for a real-valued input signal.

Parameters

  • abs_tol: Absolute tolerance for comparing input to target value (default: 1e-3)
  • target_value: Reference value for comparison (default: 0.0)

Variables

  • u(t): Input signal (placement: left side)
  • y(t): Output signal (placement: right side)

Description

Compares the input u against the targetvalue within a tolerance defined by abstol. The input is considered false if it is approximately equal to the target value within tolerance. The output y inverts this boolean result:

  • y = 1.0 if u is close to target_value (input is false)
  • y = 0.0 if u is not close to target_value (input is true)

Usage

PrimitiveComponents.LogicGates.Logical_NOT(abs_tol=1e-3, target_value=0.0)

Parameters:

NameDescriptionUnitsDefault value
abs_tol0.001
target_value0

Connectors

  • u - This connector represents a real signal as an input to a component (RealInput)
  • y - This connector represents a real signal as an output from a component (RealOutput)

Variables

NameDescriptionUnits
c

Behavior

\[ \begin{align} c\left( t \right) &= check\_with\_target\_value\left( u\left( t \right), \mathtt{target\_value}, \mathtt{abs\_tol} \right) \\ y\left( t \right) &= ifelse\left( c\left( t \right), 1, 0 \right) \end{align} \]

Source

"""
    Logical_NOT(; name, abs_tol=1e-3, target_value=0.0)

A logical NOT operation component for a real-valued input signal.

# Parameters
- `abs_tol`: Absolute tolerance for comparing input to target value (default: 1e-3)
- `target_value`: Reference value for comparison (default: 0.0)

# Variables
- `u(t)`: Input signal (placement: left side)
- `y(t)`: Output signal (placement: right side)

# Description
Compares the input u against the target_value within a tolerance defined by abs_tol.
The input is considered false if it is approximately equal to the target value within tolerance.
The output y inverts this boolean result:
- y = 1.0 if u is close to target_value (input is false)
- y = 0.0 if u is not close to target_value (input is true)
"""
component Logical_NOT
  u = Dyad.RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 250, "y2": 290, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 250, "y2": 290, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  y = Dyad.RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  # Absolute tolerance — the maximum allowed difference |x - target_value| for them to be considered approximately equal. Defaults to 1e-3
  parameter abs_tol::Real() = 1e-3
  # The reference value against which x is compared for closeness. Defaults to 0.0.
  parameter target_value::Real() = 0.0
  variable c::Boolean
relations
  c = check_with_target_value(u, target_value, abs_tol)
  y = ifelse(c, float_sym(1.0), float_sym(0.0))
metadata {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/NOT.svg"}}}
end
Flattened Source
"""
    Logical_NOT(; name, abs_tol=1e-3, target_value=0.0)

A logical NOT operation component for a real-valued input signal.

# Parameters
- `abs_tol`: Absolute tolerance for comparing input to target value (default: 1e-3)
- `target_value`: Reference value for comparison (default: 0.0)

# Variables
- `u(t)`: Input signal (placement: left side)
- `y(t)`: Output signal (placement: right side)

# Description
Compares the input u against the target_value within a tolerance defined by abs_tol.
The input is considered false if it is approximately equal to the target value within tolerance.
The output y inverts this boolean result:
- y = 1.0 if u is close to target_value (input is false)
- y = 0.0 if u is not close to target_value (input is true)
"""
component Logical_NOT
  u = Dyad.RealInput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": -40, "x2": 0, "y1": 250, "y2": 290, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": -40, "x2": 0, "y1": 250, "y2": 290, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  y = Dyad.RealOutput() {
    "Dyad": {
      "placement": {
        "diagram": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 0.04, "sw": 0.04, "rot": 0},
        "icon": {"x1": 1000, "x2": 1040, "y1": 480, "y2": 520, "sh": 0.04, "sw": 0.04, "rot": 0}
      }
    }
  }
  # Absolute tolerance — the maximum allowed difference |x - target_value| for them to be considered approximately equal. Defaults to 1e-3
  parameter abs_tol::Real() = 1e-3
  # The reference value against which x is compared for closeness. Defaults to 0.0.
  parameter target_value::Real() = 0.0
  variable c::Boolean
relations
  c = check_with_target_value(u, target_value, abs_tol)
  y = ifelse(c, float_sym(1.0), float_sym(0.0))
metadata {"Dyad": {"icons": {"default": "dyad://PrimitiveComponents/NOT.svg"}}}
end


Test Cases

No test cases defined.

  • Examples
  • Experiments
  • Analyses