Guide:Power grid

* As a simple introduction to the Power Grid system you should first know that any system you want to create will require a power source, at the moment there are two power sources possible, a **Auxiliary Generator** and an **Patch Work Generator**.
* You can access the Power Grid View by pressing 'p' or 'z'.
* The **Auxiliary Generator** and the **Patch Work Generator** have 1 energy outputs and 4 energy outputs accordingly.
* Outputs are signaled by the  symbol and inputs are signaled by the  symbol.
* If an item is powered it's symbol will be **Blue** and if not it will be **red**.

## Interactables

###  ‎Switch

* The input must be powered in order for the **Switch** to work.
* You can interact with a **Switch** by right clicking on it.
* You need to be close to them to be able to interact with them.

### Pressure Plate

* The input must be powered in order for the **Pressure Plate** to work.
* You can interact with a **Pressure Plate** by placing your character over it, causing it to change states.

## Relays

### Medium Fully Powered Relay

* All three inputs are powered in order to power the outputs, it works like an **AND Gate** but has three input and outputs.
* Can be used to replicate an output, by connecting two of the inputs to generators and the third one to an interactable output you get 3 outputs for a single interactable.

## Logic Gates

###  AND Gate

* The **AND Gate** requires that both inputs are powered in order to have a powered output
* Usually used when you want 2 interactables to be necessary to power a light/door.

###  OR Gate

* The **OR Gate** requires that one or both inputs are powered in order to have a powered output.
* Usually used to be able to let different interactables interact with a light/door

###  NOT Gate

* The **NOT Gate** is used to negate its input however the way this **Power Grid System** a Gate still needs to be powered in order to work, therefor you have to use the bottom input to power the gate, use a powered line for this.
* The top input is the one that it will negate, if it's receiving an unpowered line it will output power and it will output no power if the input is powered.

###  NAND Gate

* The **NAND Gate** (or **NOT AND Gate**) like the **NOT Gate** requires that the bottom input to be powered by a powered line in order to function.
* It works as if you used an **AND Gate** and connected it's output to a **NOT Gate**, it will give out a powered output as long as both top inputs are not powered at the same time.
* Even though you could achieve this by connecting a normal **AND Gate** to a **NOT Gate** but using the **NAND Gate** saves you space.

###  NOR Gate

* The **NOR Gate** (or **NOT OR Gate**) like the **NOT Gate** requires that the bottom input to be powered by a powered line in order to function.
* It works as if you used an **OR Gate** and connected it's output to a **NOT Gate**, it will give out a powered output as long as both top inputs are unpowered.
* Even though you could achieve this by connecting a normal **OR Gate** to a **NOT Gate** but using the **NOR Gate** saves you space.

### XOR Gate

* The **XOR Gate** is a logic gate that implements an **EXCLUSIVE** **OR**, that being said, a phrase usually used to demonstrate this is the following: "one or the other but not both", that means it works like an **OR Gate** in such a way that it requires one of inputs to be powered for the output to be powered, but as said in the beginning it's an **EXCLUSIVE** OR meaning if both inputs are powered the output will be unpowered.

###  XNOR Gate

* The **XNOR Gate** (or **NOT XOR Gate**) like the **NOT Gate** requires that the bottom input to be powered by a powered line in order to function
* It works as if you used a **XOR Gate** and connected it's output to a **NOT Gate**, it will give out a powered output as long as both top inputs are powered or unpowered.
* Even though you could achieve this by connecting a normal **XOR Gate** to a **NOT Gate** but using the **XNOR Gate** saves you space.

###  RAM Gate

* The **RAM Gate** (or **Memory Gate**) has 2 inputs, the bottom one needs to be powered by a powered line for the Gate to function.
* The **RAM Gate** works as a memory, meaning it's output will be unpowered until its top input receives power and after that even if the input gets unpowered the output will remain powered until the input receives power again, changing the output back to unpowered.

## Interactables + Logic Gates Contraptions

### Basic Contraptions

-XOR Pressureplated Door

-- you need 1 xor gate, 2 pressure plates, 1 door, 1 generator with at least 2 free power slots.

-- Place the door and the pressure plates either side of the door.

-- connect 1 slot of power to each pressureplate

-- wire the output of the plates to each input on the xor.

-- then wire the output of the xor to the door.

### Advanced Contraptions

Binary Adder:
Binary addition works by adding two binary numbers together. A binary number is either 1's or 0's representing different values. 01 for example equals 2, as binary place value works like :1,2,4,8, etc. When adding it works like normal decimal addition, except for how the carry works. If you are adding two ones together you carry the one to the next number. To create this you will need:
1.Some Generators
2.Switches
3.2 XOR Gates
4.2 AND Gates
5.Lights to display output(or any other device to do the same)
6.Some relays to control more power with switches
7.1 OR Gate
To build:
Connect the power to the switches, and power 2 points of the relay, connect the top positive connection of the switch to the relay. (Do this for as many switches as you need)Take on of the outputs of the relay and connect it to the XOR Gate(do this for both switches). Take another one of the connections and connect it to the AND Gate(Do this for both switches). Grab another switch and do the same relay setup, this will be your Carry In(C(in)).Take the output of the C(in) relay and connect to the next XOR Gate along with the output of the first. Take both of these connections and connect them to an AND Gate. Take both AND Outputs and wire them to an OR Gate. Take the output of the second XOR and wire it to your output device, and wire the output of the OR to another output device.This OR output is also the Carry Out(C(out)) which would connect to the C(in) on the next adder. Test by switching one switch, and if the first door opens that works. Hit the first two switches and the second door should open. Hit all three and both should open.