Binary & Logic

Digital processors require electricity to work. But how do they make decisions or calculate something as simple as 2+2 or as complex as ray tracing in graphics?

How does a computer compute?

Before the digital computer, wheels and cogs were used in analog calculating machines. These were clunky and required manipulation by hand. They were also slow.
X-15 Analog computer via Wikimedia Commons
Electricity travels very close to the speed of light (slowed by the physical wires transporting the electrons). If we can use electricity to add, subtract, multiply, and divide then we can quickly compute any combination of mathematics - close to the speed of light! But how do we use flowing electrons to do math?