# How does a simple calculator work?

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:

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

Last edited by a moderator:
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.

Danger
Gold Member
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.

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.

NoTime
Homework Helper
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.

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 realised, 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:
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 realised, 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:
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 realised, 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:
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.