system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does a calculator work?

How does it do all the mathematics? The computations?
gpt
Numbers are represented in binary, which is made up of the digits 0 and 1 only. These two digits are represented internally by two voltage levels. Special electronic circuits called "logic gates" combine voltages (that is, binary digits) in various ways (for example, an "AND" gate accepts two binary digits as inputs and outputs a 1 only if both of the inputs are 1s). A particular combination of certain logic gates can take two binary numbers and output their sum, and so this is how numbers can be added. Building further on this gives us subtraction, multiplication, division and exponentiation.

For higher functions, such as square roots and trigonometrical functions, there are ways of computing these by repeatedly carrying out a particular combination of additions and multiplications that gets progressively closer to the answer each time it is carried out.