How do Computers do math with humongous numbers so quickly?

926 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.

Anonymous 0 Comments

Because they were built to do just that, lots of math very quickly, how they do it?

Well it’s all based around transistors, a transistor is essentially a switch that is controlled by electricity, so you can chain several transistors together in clever arrangements to do operating with binary numbers (and with several I mean billions, modern smartphones have more transistors than there are people on the planet)

Electricity moves nearly instantly and a cpu is relatively small, plus it does an operation in less than a billionth of a second, so it is really fa at

Then a computer just has to convert a number from decimal to binary, do all the calculations and spit the result back

Anonymous 0 Comments

Electric currents move really really fast. When you tell a computer to do some math, what you are actually doing is tipping over a few specific “dominoes” that knock over a bunch of other dominoes in a specific way that the last dominoes to fall spell out the answer. The dominoes are electrons. The computer isn’t thinking it’s just electrons moving around in a well designed way so that they return the correct answer when all is said and done.

Anonymous 0 Comments

A lot of mathematics can be broken down into very simple arithmetic. As long as someone thinks about it and plans it, even math involving large numbers can be broken down into many many simple steps like adding 1+1. The key is a computer can do the simple math very very fast. So as long as someone programs the computer well, it can do very large and complicated mathematics through very simple additions/multiplications.

A modern computer can do many millions of additions a second, because it does so nearly at the speed of how fast electricity flows in a short distance.