Skip to main content

ANDGate

ANDGate

The AND gate. This logic gate supports at least 2 inputs and its output is on only when all inputs are on. It may also be created as a NAND gate in the constructor, which will invert the output, that is, it outputs off only when all inputs are on.


Constructor

public ANDGate

new ANDGate(not)

Creates an AND (or NAND) gate.

Parameters

  •  not: false | true – True if this should be a NAND gate.

Properties

No publicly accessible properties on ANDGate


Methods

public activate

activate() => void

Uses the inputs to determine the output signal from this logic gate, that is, on only when all of the inputs are on.

public getDisplayName

getDisplayName() => string

Returns the display name for this logic gate, either "AND Gate" or "NAND Gate".

Returns

  •   string – The display name ("NAND Gate" or "AND Gate").

public getImageName

getImageName() => string

Returns the filename for the image used by this logic gate.

Returns

  •   string – The image filename.

Static Methods

No static methods for ANDGate


NANDGate

The NAND gate. This is functionally equivalent to the AND gate with true passed to the constructor.


Constructor

public NANDGate

new NANDGate()

Creates a NAND gate.


Properties

No publicly accessible properties on NANDGate


Methods

No methods for NANDGate


Static Methods

No static methods for NANDGate