HALF ADDER

Report 1 Downloads 52 Views
HALF ADDER

At the very least, one would expect that any computer should be able to add two numbers. With the logic modules this becomes a reality! We humans think in decimal— base ten, with digits 0 through 9—probably as a result of the fact that we have ten fingers. Computers, on the other hand, do all of their internal work in binary—base two, with the digit 0 representing OFF and 1 representing ON. In this lesson, you will learn how to create a circuit that can add two bits. This circuit is known as a HALF ADDER. Just as the decimal number 492 represents 2 ones, 9 tens, and 4 hundreds, going up by powers of ten as you go from right to left, the binary number 1011 represents 1 one, 1 two, 0 fours, and 1 eight, going up by powers of two as you go from right to left.

It is common to represent circuits using logic diagrams, where each of the logic gates is represented by a special symbol. The symbols for the XOR and AND gates are:

The facts for adding two binary bits X and Y then look like this: 0+0=00

0+1=01 1+0=01 1+1=10

The binary digit on the right for each result is called the SUM bit and the binary digit on the left is called the CARRY OUT bit. We can express these facts in a truth table like this: X

Y

0 0 1 1

0 1 0 1

CARRY OUT Co 0 0 0 1

SUM S 0 1 1 0

We can quickly observe two interesting things. The SUM column is identical to the output for the XOR logic gate, and the CARRY OUT column is identical to the output for an AND gate. We should be able to construct a circuit (the socalled HALF ADDER) to add two bits by using one XOR module and one AND module!

The resulting logic diagram for the HALF ADDER then looks like this:

The HALF ADDER (HA for short) circuit could be represented in a way that hides the innerworkings:

This gives us a new building block from which we will be able to construct a FULL ADDER in another lesson.

ACTIVITY: Construct a HALF ADDER The above picture shows one way to construct a HALF ADDER from littleBit modules. The inputs X and Y as well as the outputs Co and S are labeled in correspondence with the truth table, logic diagram, and block diagram to help you keep things straight in your mind. After you have constructed and powered up your HALF ADDER, you should check to make sure that it functions as shown in its truth table.

YOU NEED: 1 power 1 fork 2 buttons 2 LEDs (to display input values) 2 split 1 AND 1 XOR 2 RGB LEDs (to display output values) If you plan to continue right away with the FULL ADDER lesson, you may want to keep your HALF ADDER together so you don’t have to construct it all over again.