How do Computers do math with humongous numbers so quickly?

928 views

How do Computers do math with humongous numbers so quickly?

In: Technology

4 Answers

Anonymous 0 Comments

Multiplication, addition and such are actually fairly simple operations. I’m gonna use binary here because it highlights the simplicity of what computers are doing mechanically, but it works more or less the same with our base-10, decimal system.

CPU’s are built on what are known as “gates”. A gate takes input, or multiple inputs, and gives out output, or multiple outputs.

So, for simplicity we operate on binary, so each input is either 0 or 1. Same for outputs. So let’s try simple 1-bit adding machine. First off, we need to take time to understand how arithmetic works in binary.

Binary is just another number system, like decimal. While in decimal numbers go 0, 1, 2, .., 9, 10, 11, …, 19, 20, …

In binary, numbers go 0, 1, 10, 11, 100, 101, 110, 111, …

While in decimal, you roll over the next digit after 9, with binary, you roll over the next digit after 1. So in binary, 1 + 1 = 10.

So to do simple 1 digit binary number addition, the result will be a number between 0 and 10. We represent this with two outputs, 2’s and 1’s, or the smaller digit and the larger digit. So 0 + 0 = 00, because we want two outputs. The first, larger, digit is 1 only if both input digits are 1. 1 + 1 = 10. So we can have so called “AND” gate connecting inputs to that output digit.

The smaller digit is 1 only if input is 1 and 0, OR 0 and 1. The exact gate structure for this is a bit more complex but the concept behind is rather simple still.

With flow of electricity, you can do these gate operations in a fraction of a second. Some people kinda get confused when jumping from the abstract(binary numbers, gates) to physical things(actual transistors and other circuitry), but to create say, OR-gate, you could just make it out of marbles rolling down a slope. Have midway where both input marbles, if any, hit a wall, which pushes one extra marble down the path from the impact. If no marble hits the wall, then the extra marble doesn’t fall, and output will be empty. But with even just one input marble, you have output marble rolling out.

All the cool electric circuitry does is makes this sorta thing, but faster and cheaper. No marbles needed.

You are viewing 1 out of 4 answers, click here to view all answers.