How do calculators know the answers?

761 views

How does a calculator get programmed or how does it always know the right answer? I’m assuming elves but I could be wrong.

In: Technology

5 Answers

Anonymous 0 Comments

They’re built up from a bunch of simple components called logic gates, which are these sort of conditional light-switch circuits which can output either a high or a low voltage, depending on whether their inputs are receiving a high or low voltage. There are a few kinds of logic gates, but the simplest ones people usually learn about when they’re learning electronics, are the AND, OR, and NOT gates, which do pretty much exactly what their names suggest.

An AND gate with 2 inputs, will output a high voltage only if both of its inputs are receiving a high voltage. An OR gate will output a high voltage if either one of the inputs are receiving a high voltage. A NOT gate has only 1 input and will output the opposite of whatever input it’s receiving.

By wiring up a bunch of these gates’ inputs and outputs to each other in clever ways, you can get them to perform all kinds of functions.

You can buy integrated microchips which have a bunch of these gates pre-wired up so that they can do arithmetic tasks like adding, subtracting, etc. Most cheap calculators are made using these chips.

eta: if you’re interested in the details of *how* gates can be put together to form arithmetic circuits, [here](https://www.youtube.com/watch?v=m0C3-JWWvcc) is a brief explanation of one very common design pattern called an “adder.”

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