There are three basic 'gates' which perform logical functions on bits. Using these three gates, any other logic circuit may be constructed.
B are both high.
This gate is also called an inverter. Using the three basic gates as described above it is possible to construct circuits to perform any logic or arithmetic function. One of the most basic functions, as required to build a CPU, is arithmetic addition. The circuit below is called a half-adder. It adds two binary numbers together and produces the arithmetic sum.