Logic Gates — How a Computer Calculates
From transistor to boolean algebra to arithmetic operations — this is how a computer thinks.
It is a mistake to limit the role of the transistor to just representing numbers. It has a more important role: representing what are called logic gates.
A logic gate is an electronic circuit with one or more inputs and a single output. It performs a logical operation on the input and produces the required output.
This logical operation is based on Boolean Algebra, which works with two variables — 0 and 1. Its three basic operations are:
NOT gate: Takes one logical variable and negates it. If the input is 1, the output is 0 and vice versa. Built using a single transistor with some modifications.
AND gate: Takes two inputs and produces a single output of 1 only if both inputs are 1. Built using two transistors connected in series.
OR gate: Takes two inputs and produces an output of 1 if either input is 1. Built using two transistors connected in parallel.
A combination of these logic gates enables a computer to perform both simple and complex arithmetic operations.