All exercises

AND Gate

Implement a logical AND gate Add-On Instruction in rungs.dev that outputs 1 only when both BOOL inputs are 1, and 0 otherwise — evaluated every scan.

beginner

Parameters

NameTypeUsageDescription
In_Input1BOOLInputFirst input signal for the AND logical operation.
In_Input2BOOLInputSecond input signal for the AND logical operation.
Out_AndResultBOOLOutputThe result of the logical AND operation.

Behavior

  1. The AOI evaluates both inputs every scan.
  2. When In_Input1 is 1 and In_Input2 is 1, Out_AndResult is set to 1.
  3. If either In_Input1 or In_Input2 is 0, Out_AndResult is set to 0.

Ready to start?

Open this exercise in Rungs Studio, write your solution, then click Test in the toolbar to verify your work against the built-in test cases.