Illustrated · 1 min
We will start with the basic units, the and the . is used to represent "false" and is used to represent "true." A boolean variable is a variable takes the value either or . A boolean operation is a function that takes in some number of boolean variables and outputs either or . By this definition, boolean operations can easily be written out using truth tables, in which we list every possible input and then write what the operation gives for each one.
There are three main operators on boolean variables: NOT (), AND (), OR (). They are described in the following truth tables below. Essentially, NOT flips the value, AND checks if both are true, and OR determines if at least one of them are true.

Truth tables for NOT, AND, OR.
To read these truth tables: for any input, the output is in the rightmost column. So if you wanted to determine , go to the middle truth table, look for the row in which and , then look at that same row in the column to see that .
Here we will show a proof by truth table that and are logically equivalent, which means these two functions give the same value for all inputs.

First we found , then , ANDed those two columns together, and then NOTted the whole thing. Since the last column (the function we want to prove equivalent to ) has the same truth table as , they are the same on all inputs, and thus are equivalent.
Binary is a very convenient system for working with logical statements. To convert a binary number to base (decimal), we sum up the th digit times , so if the number is then we sum up .
To convert from decimal to binary, we continually subtract the largest power of less than the number and try to reverse engineer the above definition. So for , subtract , then from subtract , then . So . There is also another way that involves finding the number mod 2, 4, 8, etc but this gets complicated.