Lab 3 – Adder/Subtracter

Was about to post the most recent lab in which this lab is simplified into one input at a time, much like an every day calculator. But fat lot of good that particular explanation does without talking about the original adder construction.

So, as the previous entry talked about, everything will be handled in binary and therefore the math is gonna be a little funny, so let’s start there.

When handling any sort of math with binary, the only two answers possible are 0 and 1. So, same rules apply in binary as in decimal. Therefore, 0+0=0, 1+0=1, 1+1=10 (zero carry-the-one). Simple enough yes?

So, to add one “bit” to another, we need two parts. First ,the actual addition and then the carry. Without getting terribly technical the addition is handled by an XOR and the carry by an AND operator. The circuit looks like this:

But that only works for the first bit. Just with normal addition, the first digit is easy, but all further digits need to take into effect the carry digit from the previous addition. Now, just like with normal addition, you’ll never have to carry any number larger than 10 for instance, so in binary, same idea applies, your carry bit never is larger than 1… rather nice, no? Also, another fact, in this case, is if any 2 of the inputs is one, then there will be a carry. Therefore, behold the “full adder”.

Then, you don’t want to have to build that over and over and over again for each pair of bits added, so we simplify the setup to one custom part as seen below:

This particular part can be reused over and over again for as many bits need to be added and is particularly useful in a myriad of scenarios. Just connect the carry out and carry ins.

More to be covered later.
~Locke

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: