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!
===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)