Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Calculator
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Internal workings== In general, a basic [[Electronics|electronic]] calculator consists of the following components:<ref>John Lewis, ''The Pocket Calculator Book''. (London: Usborne, 1982)</ref> * Power source ([[mains electricity]], [[Battery (electricity)|battery]] and/or [[Amorphous silicon#Solar cells|solar cell]]) * [[Keypad]] (input device) – consists of keys used to input numbers and function commands ([[addition]], [[multiplication]], [[square root]], etc.) * Display panel (output device) – displays input numbers, commands and results. [[Liquid-crystal display]]s (LCDs), [[vacuum fluorescent display]]s (VFDs), and [[light-emitting diode]] (LED) displays use [[Seven-segment display|seven segments]] to represent each [[Numerical digit|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 onto a roll of paper, using a printing mechanism. * Processor [[Chipset|chip]] ([[microprocessor]] or [[central processing unit]]). [[File:Interior of a calculator.jpg|thumb|upright|The interior of a [[Casio]] FX-991s calculator]] {| class="wikitable" |+Processor chip's contents !Unit !Function |- |Scanning ([[Polling (computer science)|Polling]]) unit |When a calculator is powered on, it scans the [[keypad]] waiting to pick up an [[electrical signal]] when a key is pressed. |- |Encoder unit |Converts the [[number]]s and [[Function (mathematics)|functions]] into [[binary code]]. |- |X [[Processor register|register]] and Y register |They are number stores 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. |- |[[Flag register]] |The function for the calculation is stored here until the calculator needs it. |- |Permanent [[Computer memory|memory]] ([[ROM]]) |The instructions for in-built functions ([[arithmetic]] [[Operation (mathematics)|operations]], [[square root]]s, [[percentage]]s, [[trigonometry]], etc.) are stored here in [[Binary number|binary]] form. These instructions are ''[[Computer program|programs]]'', stored permanently, and cannot be erased. |- |User memory ([[RAM]]) |The store where numbers can be stored by the user. User memory contents can be changed or erased by the user. |- |[[Arithmetic logic unit]] (ALU) |The ALU executes all [[arithmetic]] and [[Boolean algebra|logic]] [[Instruction (computer science)|instructions]], and provides the results in [[Binary-coded decimal|binary coded]] form. |- |[[Binary decoder]] unit |Converts [[binary code]] into ''[[decimal]]'' numbers which can be displayed on the display unit. |} [[Clock rate]] of a processor [[Chipset|chip]] refers to the frequency at which the [[central processing unit]] (CPU) is running. It is used as an indicator of the processor's speed, and is measured in ''clock cycles per second'' or [[Hertz|hertz (Hz)]]. For basic calculators, the speed can vary from a few hundred [[hertz]] to the [[kilohertz]] range. ===Example=== [[File:Tischrechner Walther ETR2034S resized.jpg|thumb|upright|An office calculating machine with a paper printer]] A basic explanation as to how calculations are performed in a simple four-function calculator: To perform the calculation {{nowrap|25 + 9}}, one presses keys in the following sequence on most calculators: {{key press|2}} {{key press|5}} {{key press|+}} {{key press|9}} {{key press|{{=}}}}. :* When {{key press|2}} {{key press|5}} is entered, it is picked up by the scanning unit; the number 25 is encoded and sent to the X register; :* Next, when the {{key press|+}} key is pressed, the "[[addition]]" instruction is also encoded and sent to the flag or the [[status register]]; :* The second number {{Key press|9}} is encoded and sent to the X register. This "pushes" (shifts) the first number out into the Y register; :* When the {{key press|{{=}}}} key is pressed, a "message" (signal) from the flag or [[status register]] tells the permanent or [[non-volatile memory]] that the operation to be done is "[[addition]]"; :* The numbers in the X and Y registers are then loaded into the [[Arithmetic logic unit|ALU]] and the calculation is carried out following instructions from the permanent or non-volatile memory; :* The answer, 34 is sent (shifted) back to the X register. From there, it is converted by the [[binary decoder]] unit into a decimal number (usually [[binary-coded decimal]]), and then shown on the display panel. Other functions are usually performed using repeated additions or subtractions. ====Numeric representation==== {{Main|Binary-coded decimal}} Most pocket calculators do all their calculations in [[Binary-coded decimal|binary-coded decimal (BCD)]] 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 display]]s 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. (For example, [[CD]]s keep the track number in BCD, limiting them to 99 tracks.) 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.<ref>{{cite web |author=University of Alicante |title=A Cordic-based Architecture for High Performance Decimal Calculations |url=http://rua.ua.es/dspace/bitstream/10045/11826/1/VF-016519.pdf |publisher=[[IEEE]] |access-date=2015-08-15 |url-status=live |archive-url=https://web.archive.org/web/20160303235832/http://rua.ua.es/dspace/bitstream/10045/11826/1/VF-016519.pdf |archive-date=2016-03-03 }}</ref><ref>{{cite web |title=Decimal CORDIC Rotation based on Selection by Rounding: Algorithm and Architecture |url=http://faculties.sbu.ac.ir/~jaberipur/Papers/Journals/19.pdf |archive-url=https://web.archive.org/web/20160304045707/http://faculties.sbu.ac.ir/~jaberipur/Papers/Journals/19.pdf |archive-date=2016-03-04 |url-status=live |publisher=[[British Computer Society]] |access-date=2015-08-14}}</ref> Where calculators have added functions (such as square root, or [[trigonometric functions]]), software [[algorithm]]s 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 [[Chipset|chip]], with acceptable calculation time.<ref>{{cite web |url=http://www.hpl.hp.com/hpjournal/72jun/jun72a2.pdf |title=David S. Cochran, ''Algorithms and accuracy in the HP35'', ''Hewlett Packard Journal'', June 1972 |access-date=2013-10-03 |url-status=live |archive-url=https://web.archive.org/web/20131004225515/http://www.hpl.hp.com/hpjournal/72jun/jun72a2.pdf |archive-date=2013-10-04 }}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)