How does a simple calculator work?

In summary: It is what enables a developer to model the data in a way that is understandable by the presentation layer.In summary, the abstraction layer enables a developer to model the data in a way that is understandable by the presentation layer.
  • #1
Kalouste
21
0
Well, here is a question that popped into my mind when I was trying to open a simple calculator. Calculators store numbers in binary form, depending on the present or abscense of electrical current, according to http://mathforum.org/library/drmath/view/52503.html". What devices are behind this process? Wires, batteries, semiconductor materials, transistors... how they are put together?

I wish I could take the time to describe how transistors work in
detail to you, but I don't have so much time. Plus, there are many
books that will explain this.

Do you think the information that Wikipedia provides is sufficient?

I hope this is a good question. Thank you in advance.
 
Last edited by a moderator:
Engineering news on Phys.org
  • #2
Kalouste said:
Well, here is a question that popped into my mind when I was trying to open a simple calculator. Calculators store numbers in binary form, depending on the present or abscense of electrical current, according to http://mathforum.org/library/drmath/view/52503.html". What devices are behind this process? Wires, batteries, semiconductor materials, transistors... how they are put together?



Do you think the information that Wikipedia provides is sufficient?

I hope this is a good question. Thank you in advance.


It's a good question, but can be a long question. What is your education level? I read the website, and the responder glossed over the question. It was done for good reason, because there is a wealth of information that needs to be explained to provide a fulfilling answer. Using wires and batteries is in my opinion a crappy response... however, I do not have the time to give a better one :) So I'm not really doing you much better, however I'll toss you a few links:

http://en.wikipedia.org/wiki/ALU
http://en.wikipedia.org/wiki/Adder_(electronics)
http://www.play-hookey.com/digital/adder.html
 
Last edited by a moderator:
  • #3
My education level is 12th grade (high school). I'm not sure that's how it works in U.S.A. because I do not live there. Thank you for the links.
 
  • #4
Kalouste, if you have any knowledge of how the computer that you're using works (which is discussed pretty much everywhere these days) then you already have the info. A calculator is just an extremely simple computer. It uses the same basic components.
I don't trust Wiki for anything, but there's a pretty good chance that 'How Stuff Works' will have the subject covered.
 
  • #5
Kalouste said:
My education level is 12th grade (high school). I'm not sure that's how it works in U.S.A. because I do not live there. Thank you for the links.

Ok cool. Well it would take you awhile to build a simple calculator from scratch. Probably a better route that would help you understand one, would be the following.

Start with a simple programming language (maybe C#, or C++ - you could get c# express for free before, you still might be able too) and build a really basic calculator.

Next, build it in something a little bit harder to learn, such as assembly. Once you get to assembly, you will see how things are being shifter around in memory.

Or you could pick up an intro to logic design book at a library (a university technical library would be best) and work your way through that. If you are looking for an easy way to understand it (such as you don't want to invest an entire summer working on it), then Danger's advice is golden.
 
  • #6
Danger is correct a calculator is a small computer.

If you know almost any programming language you can likely find sample code by searching for "simple calculator program" + language

If you are more interested in how a computer does math then look up FrogPad's suggestion of Adder and ALU.

Oddly enough a computer can not subtract.
It actually does subtraction by adding.
 
  • #7
If you are more interested in how a computer does math then look up FrogPad's suggestion of Adder and ALU.

I know very little of C++ and VB6. Oddly, I've never done a simple calculator in C++, just a collatz sequence program. But I've done it in VB. I'm currently reading a book about logic by https://www.amazon.com/gp/product/0393047857/?tag=pfamazon01-20, called The Universal Computer. I expect to learn interesting things from it, because I realized, when reading danger's post, that I know nothing about computers. As for assembly, my cousin is going to show me a device (which, in english, I think it's called 'Automata analyzer' although I'm not sure) that works with that language.

Thank you all for the links and suggestions.
 
Last edited by a moderator:
  • #8
Kalouste said:
I know very little of C++ and VB6. Oddly, I've never done a simple calculator in C++, just a collatz sequence program. But I've done it in VB. I'm currently reading a book about logic by https://www.amazon.com/gp/product/0393047857/?tag=pfamazon01-20, called The Universal Computer. I expect to learn interesting things from it, because I realized, when reading danger's post, that I know nothing about computers. As for assembly, my cousin is going to show me a device (which, in english, I think it's called 'Automata analyzer' although I'm not sure) that works with that language.

Thank you all for the links and suggestions.

The abstraction layer from computer to human is quite strong when using a language like VB. However, if you learned decent programming practices while using VB and especially C++ it will help you learn assembly much faster. You'll be amazed how long it takes you to write something that just displays digits on an LED screen. However, it's pretty cool to really see how it works.
 
Last edited by a moderator:
  • #9
Kalouste said:
I know very little of C++ and VB6. Oddly, I've never done a simple calculator in C++, just a collatz sequence program. But I've done it in VB. I'm currently reading a book about logic by https://www.amazon.com/gp/product/0393047857/?tag=pfamazon01-20, called The Universal Computer. I expect to learn interesting things from it, because I realized, when reading danger's post, that I know nothing about computers. As for assembly, my cousin is going to show me a device (which, in english, I think it's called 'Automata analyzer' although I'm not sure) that works with that language.

Thank you all for the links and suggestions.

By the way, that looks like an interesting book. Is it an easy read?
 
Last edited by a moderator:
  • #11
In the 80's I got from a friend a 2.50 $ hand book from Radio Shack titled "Understanding digital electronics".It was developed for Radio Shack by Texas Instruments Learning Center that was at the time leader in manufacturing of Calculators. This book Great. It explains digital electronics by desribing in simple language (but goes into the dept of the machine) for people with little knowledge of electricity- how the calculator works. I am warmly recomanding this book to everbody.knowing it will help also to understand how our daily computers work.
Try find it second hand on E-bay or mayby Amazon still sells it.
 

1. How does a simple calculator perform calculations?

A simple calculator works by using electronic components, such as transistors and integrated circuits, to perform mathematical operations. When a user presses a button, the calculator sends an electrical signal to a microprocessor, which interprets the input and performs the appropriate calculation. The result is then displayed on the calculator's screen.

2. How does a simple calculator store numbers?

A simple calculator typically uses a small amount of memory, such as RAM (Random Access Memory), to store numbers and perform calculations. The memory is organized into registers, which are used to hold the numbers and perform operations on them. Some calculators also have the ability to store numbers in a temporary memory, allowing for multiple calculations to be performed without losing the previous results.

3. How does a simple calculator handle decimal numbers?

A simple calculator uses a process called binary-coded decimal (BCD) to handle decimal numbers. BCD represents each decimal digit with a four-bit binary code, making it easier for the microprocessor to perform calculations with decimal numbers. The calculator also has a decimal point button, which tells the microprocessor where to place the decimal point in the output.

4. How does a simple calculator handle complex mathematical functions?

A simple calculator has built-in functions for common mathematical operations such as addition, subtraction, multiplication, and division. For more complex operations, it uses algorithms and mathematical formulas to calculate the result. Some advanced calculators also have the ability to perform trigonometric, logarithmic, and exponential functions.

5. How does a simple calculator conserve power?

A simple calculator is designed to use minimal power, as it typically runs on batteries. To conserve power, it has a sleep mode that activates when the calculator is not in use. It also has an auto-shutdown feature that turns off the calculator after a certain amount of time. Additionally, the display of a simple calculator uses low-power LCD (Liquid Crystal Display) technology, which requires very little energy to operate.

Similar threads

Replies
10
Views
394
Replies
11
Views
2K
Replies
9
Views
1K
Replies
10
Views
3K
  • Quantum Physics
Replies
1
Views
797
Replies
39
Views
3K
Replies
4
Views
999
  • Feedback and Announcements
Replies
2
Views
869
Replies
1
Views
2K
Replies
8
Views
2K
Back
Top