Logic Gadgets: AND gate

Icon
Name of gadget AND gate
Section Logic & Processing
Number of Tweak pages 1
Author LadylexUK, QuietlyWrong
Last updated 22 Feb 2019 [Beta]

Description

This gadget analyses two or more signals and produces a positive signal if all of them are true. You would use this to activate something when more than one condition needs to be true before an action happens, for example having to weigh down two buttons together to open a door. You can add up to 10 conditions to this gadget. If you need more than 10, see the tips below.

Example Tutorial (adapted from Media Molecule)

  1. Place an AND gate
  2. Place a controller sensor
  3. Stamp a cube
  4. Tweak the controller sensor and make it remote controllable
  5. Connect the outputs of cross and square to the input ports of the AND gate
  6. Connect the AND gate result output to the visible toggle on the cube
  7. Hit start time.
  8. Press the cross, then the square and then both of them together, you will notice the cube only appears when you press both buttons together.

Tweak Menus

  1. No. of Ports
    1a. Input
    1b. Output
  2. Inputs
    2a. Input
  3. Result
    3b. Output
  4. Power
  1. No. of Ports
    Select how many inputs you are going to add here. The ports become active in strict sequence from top to bottom, A to J.
    Note that it is important to wire up each active input, because a port without an input wire will default to “false”, therefore the AND gate could never output a “true” signal in this state.
  2. Inputs
    Wire your inputs into each port.
  3. Result
    This will produce a signal of false (0) if ANY of the active inputs is false (0) and a signal of true (1) if ALL the active inputs are true (1). Even if you have 9 true signals and 1 false signal, this will still output false.
  4. Power
    This is where you can turn the gadget on/off.

QW Tips

If you need to detect more than 10 conditions, you could use a few AND gates together. Put the first 10 into one AND gate, the next 10 into another AND gate, and so on until you have one signal for each group of 10. Then you wire the outputs of each AND gate into another AND gate and the Result from that will be the required output. This would allow you to go up to 100 conditions and in theory you could have any number by nesting group after group of AND gates like this.

However… You should also consider using some tags and a trigger zone gadget instead. Use the completion of each condition to activate a tag and then use the trigger zone to determine whether all the tags are on (using the Number Required setting of the trigger zone). In this scenario, all of your tags will need to have the same name, specific to this one requirement.

Useful Tutorials

Beginners guide to Logic Gates

One thought on “Logic Gadgets: AND gate

Add yours

  1. Another-nother way of finding AND for a whole ton of inputs is to plug them all into one calculator’s A-input, with the “blend” wire blend mode (this averages the values). So then if all of them are 1, then the average will be 1. And if any one of them are not 1, the average will be less than 1. So use the calculator to check if the value is 1, and use that resulting output as the AND for all those inputs.

    Depends on the situation, but “blending” wires is super useful for a lot of things ;P

    Like

Comments and Feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: