eli5: How does an electronic calculator work?

285 views

Does it “use” the most efficient approach when solving equations? For example I know a technique for solving larger multiplication or addition problems is to break the numbers up so you’re working with smaller sums. Ex: 60 X 4

60 X 2 = 120

120 X 2 = 240

Not to say that’s the most efficient. But what I’m wondering is if the calculator goes through some process (that’s the best process) of its own.

In: 4

4 Answers

Anonymous 0 Comments

A calculator first translates your numbers to binary. Instead of 7, it will be 0111.

It then does math more or less like you were taught to in elementary school. For basic operations like addition, it just starts with the one’s digit and adds then carries over to the two’s digit and so on.

This is all done in nanoseconds, comparing individual 1’s and 0’s as electronic signals in transistors.

Anonymous 0 Comments

you are not completely off, except that they break numbers into decimal digits rather than splitting a single digit:
https://en.wikipedia.org/wiki/Binary_multiplier#Binary_long_multiplication

Also, in a modern hand calculator, speed or efficiency is not really that important, since taking 0.02 second to produce a result is no different to user than 0.01 second. Speed does become important in videogame rendering and bitcoin mining, since there are billions of computations to be made, so people continue to refine the algorithms.

Anonymous 0 Comments

A simple solar powered calculator doesn’t break apart multiplication into multiple addition operations because they don’t have a CPU with a clock, and every register shift or operation occurs with the pressing of the mechanical buttons. The simplification of multiplication into more but simpler operations can then only be done via machine code with a CPU.

Anonymous 0 Comments

It sort of depends on the calculator.

Before we were able to build general-purpose computers that would fit in your hand, any computer that fit in your hand had to be dead simple, because we could only fit so many computer chips in such a small space.

Because of that, we needed clever ways to do advanced math operations by only using simpler math operations, like addition and subtraction.

So yes, some operations are done in a roundabout way. Sometimes they use things called “approximations”, where if you calculate it once, you get a rough answer, and the more times you do the calculation the more accurate the answer gets. Then the calculator repeats it until the answer is accurate enough such that the 10 digits it shows you on the screen are completely correct.

Some of the methods used in traditional pocket calculators come from something called [CORDIC](http://www.jacques-laporte.org/TheSecretOfTheAlgorithms.htm), which are a clever collection of methods invented in the 1970s that simplify advanced math operations into a series of simpler ones.

But things like your iPhone calculator or your Windows calculator perform more operations in the more “normal” way as you would expect, though they do likely use some approximations for some more advanced calculations as well.

0 views

Does it “use” the most efficient approach when solving equations? For example I know a technique for solving larger multiplication or addition problems is to break the numbers up so you’re working with smaller sums. Ex: 60 X 4

60 X 2 = 120

120 X 2 = 240

Not to say that’s the most efficient. But what I’m wondering is if the calculator goes through some process (that’s the best process) of its own.

In: 4

4 Answers

Anonymous 0 Comments

A calculator first translates your numbers to binary. Instead of 7, it will be 0111.

It then does math more or less like you were taught to in elementary school. For basic operations like addition, it just starts with the one’s digit and adds then carries over to the two’s digit and so on.

This is all done in nanoseconds, comparing individual 1’s and 0’s as electronic signals in transistors.

Anonymous 0 Comments

you are not completely off, except that they break numbers into decimal digits rather than splitting a single digit:
https://en.wikipedia.org/wiki/Binary_multiplier#Binary_long_multiplication

Also, in a modern hand calculator, speed or efficiency is not really that important, since taking 0.02 second to produce a result is no different to user than 0.01 second. Speed does become important in videogame rendering and bitcoin mining, since there are billions of computations to be made, so people continue to refine the algorithms.

Anonymous 0 Comments

A simple solar powered calculator doesn’t break apart multiplication into multiple addition operations because they don’t have a CPU with a clock, and every register shift or operation occurs with the pressing of the mechanical buttons. The simplification of multiplication into more but simpler operations can then only be done via machine code with a CPU.

Anonymous 0 Comments

It sort of depends on the calculator.

Before we were able to build general-purpose computers that would fit in your hand, any computer that fit in your hand had to be dead simple, because we could only fit so many computer chips in such a small space.

Because of that, we needed clever ways to do advanced math operations by only using simpler math operations, like addition and subtraction.

So yes, some operations are done in a roundabout way. Sometimes they use things called “approximations”, where if you calculate it once, you get a rough answer, and the more times you do the calculation the more accurate the answer gets. Then the calculator repeats it until the answer is accurate enough such that the 10 digits it shows you on the screen are completely correct.

Some of the methods used in traditional pocket calculators come from something called [CORDIC](http://www.jacques-laporte.org/TheSecretOfTheAlgorithms.htm), which are a clever collection of methods invented in the 1970s that simplify advanced math operations into a series of simpler ones.

But things like your iPhone calculator or your Windows calculator perform more operations in the more “normal” way as you would expect, though they do likely use some approximations for some more advanced calculations as well.