Binary Pt. 2: Logic Gates and Truth Tables
A bit in binary is boolean, meaning it is either true or false, but by using logic gates you can make decisions and calculations.
Truth tables are a way to demonstrate the logic that you have planned out with logic gates by showing all possible combinations of inputs and outputs. As this is the first part of the guide on boolean logic, I’m only going to focus on the three most basic logic gates and their truth tables.
AND Gate:

This is the symbol for an AND gate. Q is 1 when both A and B are 1. Otherwise Q is 0. We can show this on a truth table like so:

Columns A and B show the two inputs to the gate, while column Q shows the output as a result.
OR Gate:

An OR gate equals 1 when A or B are 1. This also includes if both A and B are true.

NOT Gate:

NOT gates are the simplest logic gates: they simply reverse what is entered. NOT gates are different to AND/OR gates because they only have one input. This also makes the truth table simpler.
