TechKnowSurge
CompTIA Tech+ 1.1 CompTIA Tech+ 1.3
VideoComputeFree

Creating a Calculator

A foundational look at how processors handle binary addition, using a simple calculator project to illustrate how chips process data at the hardware level.

Complete this video to capture a CTF flag worth 1 point.

About this video

At the hardware level, a CPU performs arithmetic using binary — a numbering system built entirely on ones and zeros — rather than the decimal system used in everyday math. To make that process concrete, a simple addition machine serves as a hands-on project for observing how a chip processes data. The content begins by comparing decimal and binary addition side by side, showing that both follow the same column-by-column logic: add the values, write the result, and carry the overflow into the next column when the sum exceeds what a single digit can hold. In binary, a single bit column can only hold a zero or a one, so adding 1 plus 1 resets that column to zero and carries a one forward — exactly the same principle as carrying a ten in decimal arithmetic. All four possible input combinations for a single bit column are mapped into a truth table: 0+0, 1+0, 0+1, and 1+1, each producing a defined sum and carry output. This truth table is a foundational concept in digital logic and connects directly to how logic gates are designed and how a processor chains these single-column operations across every bit position to produce a final result.

What you'll learn

What's covered

Building a Calculator

Aligned to

CompTIA Tech+
1.1 Compare and contrast notational systems.
1.3 Illustrate the basics of computing and processing.

Key terms

Binary
The base-2 number system that uses only the digits 0 and 1; the native language of digital computers, which store and process data as electrical on/off states.
Decimal
The base-10 number system using digits 0–9; the standard system used in everyday counting and arithmetic, and the most common format for presenting numeric output to humans.
Binary Addition
The arithmetic process of adding two binary numbers using base-2 rules, where 0+0=0, 0+1=1, 1+1=10 (sum 0 carry 1), and 1+1+1=11 (sum 1 carry 1).
Carry
In binary addition, the value of 1 passed to the next higher bit position when a column's sum exceeds the maximum value representable by a single bit.
Sum
The single-bit result output of adding two binary digits in a given column, before accounting for any carry.

Topics

Binary Arithmetic Logic Gates Computer Architecture Number Systems Hardware Fundamentals Digital Circuits

Transcript

A simple addition machine

We're going to start creating a calculator by creating just a simple addition machine that's going to do some calculation, and we'll start seeing what the chip does to actually process data.

Here I have a very simplistic calculator, so I'm going to take a look at what it takes to add two numbers together to come up with an answer, and that's what we're going to use as our project.

Decimal and binary

One thing to understand is there are different numbering systems. The system that we're used to working with is the decimal system. It starts out with 0, 1, 2, 3, 4, 5, 6, 7 and so on and so forth. Binary looks quite a bit different. Binary starts out with zero, goes to 1 1 0 1 1 1 0 0 1 0 1 110 and 111.

I just want you to have a basic understanding that binary looks quite a bit different from the perspective of just looking at it, where sometimes it's a little hard to adapt to it because it's just ones and zeros, but in many ways they operate the same way.

Adding in decimal and in binary

Let's take a look at adding in both decimal and binary. With decimal, I'd start out with the ones column and add this together right here, so 0 + 1 is one. Then I go to the next column: 0 + 5 is 5. Then I go to the next column, 9 + 1, which is actually the hundreds column here — it resets to zero and then we carry a one into the thousands column, and there's nothing to add it to, so then we end up with 1,51.

With binary we do the same thing. We start with the rightmost column here, which is the ones. We add 0 + 1 and that is one. Then we go to what's actually the twos column — we won't get too deep into that — but that's 0 + 1, and so that's one as well. Then we go to the four column right here and that's 1 + 1, and we can't have a two in here, there's only zeros and ones. So what happens is that this four column gets reset to zero and we carry a one into the next column. Then what we see here is 1 + 0 + 0, which is 1, and so this is the answer of adding these two numbers together.

By the way, these numbers are much, much smaller than these numbers, and the answer is, let's see, it's an 8 plus a 2 plus a 1, so the answer over here is actually 11. This is the equivalent to a decimal 11.

The four scenarios for one column

So how does a calculator calculate this out? Let's just take one column, that first column here, and come up with some scenarios. We could have 0 plus 0, we could have 1 plus 0, we could have 0 + 1, and we could have 1 + 1. Those are the four scenarios we have with just that first column adding two numbers together.

Let's take this first one. Let's say there's a zero plus zero, so input one is zero and input two is zero, so we've got zero and zero right here. Then what is the answer of that going to be? This isn't a trick question: 0 plus 0 is zero, so we're going to just say zero right here. So the output here is zero.

If you've got the grasp of that, try to figure out the rest of this table and see if you can figure out what the rest of the table is going to be, and then we'll do it together.

Let's see what the rest of these are. In this next scenario right here it's 1 + 0, so 1 and zero are the inputs here, and we can see that that's going to be one, so the output is going to be one. 0 + 1 is this one right here, which the answer is one there, so we've got that. And then 1 + 1 — this is where this column gets reset and we carry a one into the next column. So what that looks like is we're going to put a zero as the output, this is the output right here, and what we're going to do is carry the one into the next column, so the one right here. In fact we can fill in the rest of this chart: this was zero the rest of the time.

So now we've made a chart for the output of these four different scenarios. We're going to play around with these charts a little bit more when we get into gates, but this just dips your toe in it. So if you didn't get that, don't worry about it, we're going to progress on from here, and I'm actually going to present this again later.

What a calculator is going to do is it's going to do that for the first column, and then it will do it for the second column, then the third column, then the fourth column.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →