Calculator


A calculator is typically a portable electronic device used to perform calculations, ranging from basic arithmetic to complex mathematics.
The first solid-state electronic calculator was created in the early 1960s. Pocket-sized devices became available in the 1970s, especially after the Intel 4004, the first microprocessor, was developed by Intel for the Japanese calculator company Busicom. Modern electronic calculators vary from cheap, give-away, credit-card-sized models to sturdy desktop models with built-in printers. They became popular in the mid-1970s as the incorporation of integrated circuits reduced their size and cost. By the end of that decade, prices had dropped to the point where a basic calculator was affordable to most and they became common in schools.
In addition to general-purpose calculators, there are those designed for specific markets. For example, there are scientific calculators, which include trigonometric and statistical calculations. Some calculators even have the ability to do computer algebra. Graphing calculators can be used to graph functions defined on the real line, or higher-dimensional Euclidean space., basic calculators cost little, but scientific and graphing models tend to cost more.
Computer operating systems as far back as early Unix have included interactive calculator programs such as dc and hoc, and interactive BASIC could be used to do calculations on most 1970s and 1980s home computers. Calculator functions are included in most smartphones, tablets, and personal digital assistant type devices. With the very wide availability of smartphones and the like, dedicated hardware calculators, while still widely used, are less common than they once were. In 1986, calculators still represented an estimated 41% of the world's general-purpose hardware capacity to compute information. By 2007, this had diminished to less than 0.05%.

Design

Input

calculators contain a keyboard with buttons for digits and arithmetical operations; some even contain "00" and "000" buttons to make larger or smaller numbers easier to enter. Most basic calculators assign only one digit or operation on each button; however, in more specific calculators, a button can perform multi-function working with key combinations.

Display output

Calculators usually have liquid-crystal displays as output in place of historical light-emitting diode displays and vacuum fluorescent displays ; details are provided in the section Technical improvements.
Large-sized figures are often used to improve readability; while using decimal separator instead of or in addition to vulgar fractions. Various symbols for function commands may also be shown on the display. Fractions such as are displayed as decimal approximations, for example rounded to. Also, some fractions can be difficult to recognize in decimal form; as a result, many scientific calculators are able to work in vulgar fractions or mixed numbers.

Memory

Calculators also have the ability to save numbers into computer memory. Basic calculators usually store only one number at a time; more specific types are able to store many numbers represented in variables. Usually these variables are named ans or ans. The variables can also be used for constructing formulas. Some models have the ability to extend memory capacity to store more numbers; the extended memory address is termed an array index.

Power source

Power sources of calculators are batteries, solar cells or mains electricity, turning on with a switch or button. Some models even have no turn-off button but they provide some way to put off. Crank-powered calculators were also common in the early computer era.

Key layout

The following keys are common to most pocket calculators. While the arrangement of the digits is standard, the positions of other keys vary from model to model; the illustration is an example.
MC or CMMemory Clear
MR, RM, or MRCMemory Recall
M−Memory Subtraction
M+Memory Addition
C or ACAll Clear
CEClear Entry; sometimes called CE/C: a first press clears the last entry, a second press clears all
± or CHSToggle positive/negative number aka CHange Sign
%Percent
÷Division
×Multiplication
Subtraction
+Addition
.Decimal point
Square root
=Result

The arrangement of digits on calculator and other numeric keypads with the -- keys two rows above the -- keys is derived from calculators and cash registers. It is notably different from the layout of telephone Touch-Tone keypads which have the -- keys on top and -- keys on the third row.

Internal workings

In general, a basic electronic calculator consists of the following components:
  • Power source
  • Keypad – consists of keys used to input numbers and function commands
  • Display panel – displays input numbers, commands and results. Liquid-crystal displays, vacuum fluorescent displays, and light-emitting diode displays use seven segments to represent each digit in a basic calculator. Advanced calculators may use dot matrix displays.
  • * A printing calculator, in addition to a display panel, has a printing unit that prints results in ink or thermally onto a roll of paper.
  • Processor chip.
UnitFunction
Scanning unitWhen a calculator is powered on, it scans the keypad waiting to pick up an electrical signal when a key is pressed. Polling is usually implemented in software.
X register and Y registerMemory where numbers are stored temporarily while doing calculations. All numbers go into the X register first; the number in the X register is shown on the display. Usually implemented in RAM.
Flag registerThe function for the calculation is stored here until the calculator needs it. Usually implemented in RAM.
Permanent memory The instructions for in-built functions are stored here in binary form. These instructions are programs, stored permanently, and cannot be erased.
User memory Location where numbers can be stored by the user. User memory contents can be changed or erased by the user.
Arithmetic logic unit The ALU executes all arithmetic and logic instructions, and provides the results in binary coded form.
Binary decoder unitConverts binary code into 1-of-n code to simplify scanning the display and keyboard.

Clock rate of a processor chip refers to the frequency at which the central processing unit is running. It is used as an indicator of the processor's speed, and is measured in clock cycles per second or hertz. For basic calculators, the speed can vary from a few hundred hertz to the kilohertz range.

Example

A basic explanation as to how calculations are performed in a simple four-function calculator:
To perform the calculation, one presses keys in the following sequence on most calculators: .
Other functions are usually performed using repeated additions or subtractions.

Numeric representation

Most pocket calculators do all their calculations in binary-coded decimal rather than binary. BCD is common in electronic systems where a numeric value is to be displayed, especially in systems consisting solely of digital logic, and not containing a microprocessor. By employing BCD, the manipulation of numerical data for display can be greatly simplified by treating each digit as a separate single sub-circuit. This matches much more closely the physical reality of display hardware—a designer might choose to use a series of separate identical seven-segment displays to build a metering circuit, for example. If the numeric quantity were stored and manipulated as pure binary, interfacing to such a display would require complex circuitry. Therefore, in cases where the calculations are relatively simple, working throughout with BCD can lead to a simpler overall system than converting to and from binary.
The same argument applies when hardware of this type uses an embedded microcontroller or other small processor. Often, smaller code results when representing numbers internally in BCD format, since a conversion from or to binary representation can be expensive on such limited processors. For these applications, some small processors feature BCD arithmetic modes, which assist when writing routines that manipulate BCD quantities.
Where calculators have added functions, software algorithms are required to produce high precision results. Sometimes significant design effort is needed to fit all the desired functions in the limited memory space available in the calculator chip, with acceptable calculation time.

History

Precursors to the electronic calculator

The first known tools used to aid arithmetic calculations were: bones, pebbles, and counting boards, and the abacus, known to have been used by Sumerians and Egyptians before 2000 BC. Except for the Antikythera mechanism, development of computing tools arrived near the start of the 17th century: the geometric-military compass, logarithms and Napier bones, and the slide rule.
The Renaissance saw the invention of the mechanical calculator by Wilhelm Schickard in 1623, and later by Blaise Pascal in 1642. A device that was at times somewhat over-promoted as being able to perform all four arithmetic operations with minimal human intervention. Pascal's calculator could add and subtract two numbers directly and thus, if the tedium could be borne, multiply and divide by repetition. Schickard's machine, constructed several decades earlier, used a clever set of mechanised multiplication tables to ease the process of multiplication and division with the adding machine as a means of completing this operation. There is a debate about whether Pascal or Shickard should be credited as the known inventor of a calculating machine due to the differences of both inventions. Schickard and Pascal were followed by Gottfried Leibniz who spent forty years designing a four-operation mechanical calculator, the stepped reckoner, inventing in the process his leibniz wheel, but who couldn't design a fully operational machine. There were also five unsuccessful attempts to design a calculating clock in the 17th century.
The 18th century saw the arrival of some notable improvements, first by Poleni with the first fully functional calculating clock and four-operation machine, but these machines were almost always one of a kind. Luigi Torchi invented the first direct multiplication machine in 1834: this was also the second key-driven machine in the world, following that of James White. It was not until the 19th century and the Industrial Revolution that real developments began to occur. Although machines capable of performing all four arithmetic functions existed prior to the 19th century, the refinement of manufacturing and fabrication processes during the eve of the industrial revolution made large scale production of more compact and modern units possible. The Arithmometer, invented in 1820 as a four-operation mechanical calculator, was released to production in 1851 as an adding machine and became the first commercially successful unit; forty years later, by 1890, about 2,500 arithmometers had been sold plus a few hundreds more from two arithmometer clone makers and Felt and Tarrant, the only other competitor in true commercial production, had sold 100 comptometers.
It wasn't until 1902 that the familiar push-button user interface was developed, with the introduction of the Dalton Adding Machine, developed by James L. Dalton in the United States.
In 1921, Edith Clarke invented the "Clarke calculator", a simple graph-based calculator for solving line equations involving hyperbolic functions. This allowed electrical engineers to simplify calculations for inductance and capacitance in power transmission lines.
The Curta calculator was developed in 1948 and, although costly, became popular for its portability. This purely mechanical hand-held device could do addition, subtraction, multiplication and division. By the early 1970s electronic pocket calculators ended manufacture of mechanical calculators, although the Curta remains a popular collectable item.