Eli5: Computers can calculate based on instructions. But how do you teach computers what does it mean to add something, multiply, divide, or perform any other operation?

922 views

Edit: Most of the answers here are wonderful and spot on.

For those who interpreted it differently due to my incorrect and brief phrasing, by ‘teaching’ I meant how does the computer get to know what it has to do when we want it to perform arithmetic operations (upon seeing the operators)?

And how does it do it? Like how does it ‘add’ stuff the same way humans do and give results which make sense to us mathematically? What exactly is going on inside?

Thanks for all the helpful explanations on programming, switches, circuits, logic gates, and the links!

In: 583

43 Answers

Anonymous 0 Comments

A computer runs completely in binary, the best way to describe a computer is a system that can do three things, it can read, write, and erase. Using 1s and 0s we can represent numbers and do arithmetic with them using operations, we have programming languages and logic gates, using the programming language we can make the computer hold data in its memory and ram, with this we can program it to do things like addition, subtraction, multiplying and dividing, imagine there is a group of cells with different numbers in them, a data location with the numbers 1, another cell with 0 and so on, using this binary number 1001, we use logic gates to combine these cells, using logic gates we tell the computer that this symbol + means adding cells. What we call cells in computing is bits

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