Before I start this project, just how capable are Arduino calculators?

I've seen plenty of people online posting their Arduino calculators. Most of them are just breadboarded prototypes or proofs of concepts. Nothing that looks like a finished product. The closest I've seen to a "real" Arduino-calculator is the spikenzielabs.com calculator kit.

I want to try my hand at making a really cool calculator that can sit on my desk. Something that's maybe a throwback to the nixie tube calculators of the 60s and 70s. Big and clunky, but it just works.

However, I'm concerned that with an 8-bit micro, there are limitations to the computations that it can do. I'm not looking to make a scientific calculator. Just the simple +, -, *, and /. I have to wonder, back in the day, they must have been using 8-bit micros. However, I'm sure they were using some kind of custom silicon in those calcs and it wasn't like an 8080 or something.

So what can I expect? What are the limitations? Or instead of a Uno or a Mega, should I be looking at the Arduino Zero with it's 32-bit core?

You you will be able to come up with a very reasonable basic/scientific calculator using the upstart UNO.
Hey, if you want retro, look at Crossroads bubble display board, maybe interface it to Pro Mini after you develope the software on an UNO.
![](http://<a href=)

What level of accuracy do you want it to go to?
The Arduino UNO's chip can handle floating point arithmetic to several decimal places with no loss of accuracy.
Only on very small numbers will rounding errors creep in.

Maybe make it with a IR remote as the keypad.
Here is some work I did.
http://forum.arduino.cc/index.php?topic=317625.0
With 44 buttons you could make quite a reasonable calculator.

// note for future use
next time a poster is looking for a project, bring up the idea of a keyboard that has a decent numeric keypad.
one that has specific keys for ) and { over above or next to the the numbers, and set so one does not need the shift key to hit them......

@dave
With the 44 button remote you could easily have ( ) { } * + = ^ / - % etc.
Thanks.

.

Arduino can be very capable doing high precision math using the big number library ported by Nick Gammon.

The more digits the slower it will get but for 10 or 12 digits it should be workable (not tested)

However, I'm concerned that with an 8-bit micro, there are limitations to the computations that it can do.

Early calculators were often based on 4 bit processors.

ryemac3:
However, I'm concerned that with an 8-bit micro, there are limitations to the computations that it can do.

Then you completely misunderstand what a "computer" is!

The average Arduino is more capable than early computers in the 1960s which were used to perform calculations to whatever accuracy was necessary. The byte (or nybble) width of a microprocessor is essentially irrelevant.

The only real limitation is the RAM size.

And clock speed ?

ryemac3:
However, I'm concerned that with an 8-bit micro, there are limitations to the computations that it can do. I'm not looking to make a scientific calculator. Just the simple +, -, *, and /. I have to wonder, back in the day, they must have been using 8-bit micros. However, I'm sure they were using some kind of custom silicon in those calcs and it wasn't like an 8080 or something.

So what can I expect? What are the limitations?

I think, the only limitation is, that old vintage calculators offered an accuracy of up to 8 digits (= display width), while the 'float' accuracy of 8-bit Atmegas is only 6-7 significant digits.

So this leads to the conclusion, that while you want to create +, -, *, and / floating point calculations, you cannot use the floating point math included in the AVR LIBC library, but you will have to create your own math functions and have to use different data types to deal with. Type 'float' is not allowed, because it is not accurate enough to provide 8 significant digits.

But for just the math calculations of +, -, *, and / it should be easy to develop your own algorithms to provide 8 significant digits in the result: Either based on char arrays, or based on 32-bit long. Or both. Should be easy, but depends on the number of digits you want to have with your calculator actually.

Re: calculator speed vs Arduino.
See my message #10 in Not getting the correct answer - Programming Questions - Arduino Forum

Pete

ryemac3:
I have to wonder, back in the day, they must have been using 8-bit micros.

Do you care about the history of computers and computation at all?

Last night I watched "The Imitation Game" - and that comment - as innocent as it might be - grates on my nerves.

Mainly because it says that all you are doing here is making a bunch of grand assumptions as to what a calculator (not even a computer!) could do in the 1960s and 70s - what it was composed of, and how it functioned - without even doing the minimum amount of research possible using the internet the machine in front of you that is the grand result of that research and development of the past!

Please! If you care at all about this subject - do the research! It's beyond fascinating! It covers vast swaths of history and time periods and invention in an almost unimaginable way! Mankind has been speculating on the concept of machines that could imitate human action and thought for thousands of years, but it has only been in the last 50 or so years that we have managed to create a machine - indeed, understand how it could possible be so - that could think in some manner like we do.

We virtually owe most all of this to one man. Ok - being honest, we owe it at least to three men - these people, of which one is well known today, and the other two still languish at least outside of mathematical circles - put forth the understanding and insights which allowed for the understanding that machines could manipulate symbols - and not just numbers - which is the ultimate basis for all of computer science. Even so, it was only one of those individuals who had the insight to come up with that machine, and then take it from the abstract to the real, and prove that such a limited version (for his universal machine lived in the realm of mathematics, where its memory was defined as "infinite") could be useful. Unfortunately, his achievement wouldn't be released to the public until the 1970s (it was classified) - and a full apology wouldn't be given until 2013. But I digress.

8-bit CPU? Silicon?

At best - you were looking at a completely transistorized calculation machine - that is, discrete transistors. Oh, how I kick myself today over the destruction I wrought to one of those devices! It had been given to me as "junk" by my boss at my first software development job - I was 18, and took it apart. It had a nixie tube display, but there were no integrated circuits to be found. The entire thing inside was crammed full of individual transistors. I tossed that away like so much useless trash to me. There was one part I didn't understand - even after I took it apart - and wouldn't understand until a few years later - and then I realized what I had destroyed...

Inside was a metal box - about the volume of a pack of cigarettes, maybe a bit more square and thinner (say 5 or 6 cm on a side). Two pairs of wires led into the box, and it was sealed air-tight. It was also very light-weight. I was curious - what could be inside that box? So, I went at it with the only tools I had - a hammer, a screwdriver, and a pair of cutters and pliers. I eventually got it open enough to see inside...what was that? A coil - of wire? One end connected to where a pair of wires went into - but connected to some kind of ceramic "nub" - the wire was silver, and made a coil of one or two loops - then back to another ceramic "nub", where the other pair of wire led out from. Strange, I thought - I had no idea what it was - but it seemed useless to me, so I tossed it. The only thing I kept from that calculator was the nixie tube display - and in the end even that was discarded over several moves of my household.

I only later learned what I had destroyed: A desktop calculator that had spanned three generations of technological know-how: Nixie tubes for a display, transistors for logic and calculation purposes, and finally - a wire delay line, for memory storage. Yes - that box with the coil of wire, was the memory storage system of the calculator. Those "ceramic nubs" were actually piezo tranducers with a (likely) nickel wire bonded to them, which would "vibrate" the wire with the bits which made up the number, and the other end would pick them up, reform them through some kind of amplication system, then feed them back thru the other end. Obviously, there was also some way to recall the number, and read it from the vibrating wire. It was contained inside a box, which likely had some kind of rare-gas atmosphere sealed inside to prevent corrosion, and maybe temperature fluctuations from hampering it's workings.

...and I had destroyed it.

I wish I had it for my small historical computer junk collection I have today; it would have been a great piece to have for it.

Sorry for the trip down memory lane - but maybe it shows you what kind of passion I have for these wondrous machines, and that what we look at today as microcontrollers and microprocessors - are so very, very advanced from those days (heck - so very advanced from the time when I got my first 8-bit computer in the 1980s!).

When you hold an Arduino in your palm - realize that what you are holding is something that would have been nearly unthinkable to have only 30 years ago. It certainly wouldn't have been thought to only cost the few dollars it does today (which, compared to 30 years ago, is a relative pittance given inflation). Have no doubts - the Arduino is a very advanced bit of technology. Have fun with it - create your calculator; but also realize that what you are doing is akin to taking a rocket engine and making it perform the role of a steam engine. Even so, steam engines are worth understanding in their own right - in order to help to understand where more advanced engines came from. So it is the same with computers and computation.

We virtually owe most all of this to one man. Ok - being honest, we owe it at least to three men - these people, of which one is well known today, and the other two still languish at least outside of mathematical circles

names?

Hear hear! History is important, although that description of history doesn't help you understand the reason why it's possible to built a 9-digit calculator out of a 4-bit processor.

For the OP: look for a "bignum" library to do your calculations. That will manipulate the digits as separate variables, which is what allows you to extend the precision. If you're interested in how that works, you will have all the code available in the library to see how those individual digits must be manipulated for each of ta calculator functions +-*/.

robtillaart:
names?

Turing, von Neumann and I'm still thinking about who I would put third.

Hi,
Charles Babbage, designed the Difference Engine and Analytical Engine.
Don't forget Ada Lovelace.

Tom.... :slight_smile:

MorganS:
Turing, von Neumann and I'm still thinking about who I would put third.

I'll say George Boole (hence Boolean algebra).

de Morgan, Bush (Vannevar, not Dubbya), Shannon . . .

The topic at hand is "Arduino calculator" (implying "electronic calculator"). The obvious top of the list is...

(I just love his response to "What did you do when you learned you won the Nobel Prize?" "Got up and made coffee.")