This article is different from others as it discusses my early experiences with microcomputer programming. The article is, however, very relevant to this Math blog because it hopes to inspire children of all ages to take a very hands-on approach to learning how calculators do arithmetic, and gives suggestions for pursuing a self-directed and very fruitful exploration into the subject. Teaching yourself how computers do arithmetic will give you a lifelong foundation for programming computers or for just understanding how computers work.
I was fortunate enough to grow up in the 1970's when microcomputers were just starting to become popular. As someone with a lifelong love of Math and an interest in computer programming I bought my first computer in the late 1970's. It was an Ohio Scientific Challenger 1P computer. It came standard with 4K of RAM. That's kilobytes, not megabytes or gigabytes. I remember plunking down a few hundred dollars to double the memory to 8K. A fun little exercise is to compare the cost of the extra 4K of memory (let's say it was $300) to the cost of 4 gigabytes of memory for a typical PC today, considering that 4GB is roughly 1 million times larger than 4KB. I say roughly, because 4GB is actually 1024^2 times larger than 4kB.
With such little memory available in my first PC I had to write programs that were pretty compact and I didn't have any of the advantages of high-level programming languages, although BASIC did come with the computer, in ROM, so it didn't take up the main RAM. I quickly discovered the challenges and pleasures of programming in something called machine language, which is a very close-to-the-ground approach to instructing a microcomputer. Using machine language I learned a tremendous amount about how computers (and calculators, which are simple computers) do arithmetic. That learning has served me remarkably well in a 25-year career in the computer industry. Unfortunately, low-level programming is becoming a lost art, relegated to a few college-level computer architecture classes and to a few programmers in the computer industry.
When I was growing up there were many hobbyists that were building and programming their own computers at a very low-level because the tools and memory to build sophisticated windows-based applications didn't exist or weren't affordable.
Being a curious person I wondered how calculators worked. What was going on in those chips to perform arithmetic? If computers use binary (0 and 1) for everything how come I could enter decimal numbers into the calculator and see decimal results? It turns out that one of the students I'm mentoring in Math has an interest in computer logic and we're exploring the logic and coding involved in building a simple computer. So, I've had the motivation to find resources to help in the exploration.
There are three basic approaches to learning about how calculators do Math. The first is to build a calculator. This can be done using a calculator chip, battery, and other components plus a case and keyboard. While this approach might be somewhat instructive, all of the logic is handled in the chip and there's not much to learn about computer logic. The second approach is to build a calculator but to use logic gates and circuits and connect them together instead of one do-it-all chip. This would be quite instructive but would require more comfort with computer electronics than I have. The third approach, which I'm taking, is to use a computer program to simulate the inner workings of the hardware and basic operating system inside a calculator and to guide my student to learning by having him do the programming required to have the calculator simulator recognize keystrokes, do arithmetic, and display results.
I found this very interesting web-site, DIY (Do It Yourself) Calculator, which I believe will be very useful in this exploration. The site promotes a book, The Definitive Guide to How Computers Do Math, which has laboratory explorations that guide students in programming their own arithmetic functions using the DIY Calculator simulator. I've ordered a copy of the book and will report back on its utility. I'm familiar with most if not all of the concepts discussed in the web-site so I believe the education provided by the book will be very valuable.
Another useful resource I've found is the Basic Logical Functions and Gates page, which links to another of other relevant pages. These pages can provide the background for someone wanting to understand how one can take the basic building blocks of calculators and computers (AND, OR, and NOT gates plus the associated Boolean logic) and design the logic circuits that ultimately perform any function that any computer can perform.
I highly recommend that anyone interested in both computers and Math take the time to learn how computers operate at the most basic level. I know this understanding has greatly enriched my life.