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?

916 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

Nothing “means” anything to a computer. you give it symbols, it applies pre-defined operations to those symbols, and gives you symbols back. it knows nothing about the symbols, and doesn’t do any kind of “thinking” or assigning “meaning”.

as to your question about math operations, these are just pre-defined operations. Computers aren’t taught to do math, they have instructions built into the hardware (in the olden days this would have been a device called a math-coprocessor for math related processes, otherwise basic memory operations would bein the main processor) for doing many many types of basic operations. these are combined in various ways to do more complex functions.

A computer program tells a processor how to use its built in functions to do something complex.

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