How does a calculator work?

shawie

New member
Joined
Aug 31, 2005
Messages
34
I have this extra credit opportunity that I'd like to pursue but I am having great difficulty finding the information I need. The assignment states that I need to write a paper on how a calculator works with binary numbers. I tried google, dogpile, yahoo but i keep getting links on calculators that convert binary numbers not binary involved in the function of calculators. If anyone could help me out with this, I would be eternally grateful. Thank you.
 
I guess I will give a brief explaination on general binary stuff. I'm going to gloss over most of this, but hopefully it will help.

Binary numbers are generally given in the same form as decimal numbers (at least integers, floating point numbers are more complex -- that is fractions). That is, in the form:

the binary number 11001 (25) = 1*2^4 + 1*2^3 + 0*2^2 + 0*2^1 + 1*2^0
similar to the number 4983 = 4*10^3 + 9*10^2 + 8*10^1 + 3*10^0

Typically, binary numbers have a leading bit, which represents the sign (0 = positive, 1 = negative), although there are many ways to do this, the most common being 2's compliment, which I will not explain here (but if you want to really understand the details of calculator operation, i suggest looking it up, maybe at wikipedia.org). Im not using leading bits in my examples, just positive binary numbers

hopefully that makes sense. Anyways, the first thing a calculator does is convert the decimal number that it gets as input into a binary number. Once a calculator has recieved two operands and an operator, it can perform the operation on them, returns the result as a binary number, which is converted into a decimal for the display.

The operations for addition are basically exactly like you would do for decimal values, 101 + 10 = 111; 111 + 10 = 1001. There are a couple of types of adders that a calculator might implement to do this, such as a Ripple-Carry Adder.

Subtraction is done by adding the negated version of the second operand to the first (there is usually no actual subtraction function in a calculator's processor)

Multiplication is typically done through specialized functions, which are fairly complicated. As is division, which is the most complicated of the main operations. A calculator might, for instance, use a shift-and-add multiplier. There is a complimentary process for division as well.
 
Top