Sei sulla pagina 1di 5

LAB #10: Combinational Logic

By Louis J. Oberto
December 09, 2014
Abstract
For this report, we begin by giving a brief introduction to combinational logic, binary
numbers, and their role in digital circuits, as well as how to formalize Boolean statements.
From there we discuss the Half-Adder circuit, used to add two binary numbers, and new
circuit elements. Lastly, we we examine the Binary Multiplier. This circuit enables us to
multiply two binary numbers together, as the name suggests.

Introduction

Combinational logic is a type of circuit logic in which the outputted signal is entirely dependent on the present one. The circuits consist of one of two type of signals: logic high
and logic low. Equivalently, they would 1 and 0 on a binary scale. These computational
numbers are known as bits. The other option is a sequential logic circuit. They do depend
on previous inputs, like those in flip-flop circuits.
These combinational logic circuits rely on Boolean algebra to work, and are still used in
todays computers. They are capable of adding, subtracting, and multiplying numbers to
name a few functions. One explicit way of determining the behavior of the circuit is by the
following procedure:
1. Create a truth table based on the input and outputs of the circuit.
2. Write down the Boolean algebra statement based on the outputted values.
3. Reduce the Boolean algebra.
4. Mechanize the Boolean statement using the appropriate logic gates.
This gives us a sort of cookbook to simplify any circuit. Clearly, with many circuits, this
can become cumbersome, but it will work if done correctly.

The Half-Adder

Lets say we want to add two binary numbers. As mentioned in the introduction, a single-bit
binary number can take on one of two values: 1 or 0. So, if we add two together, we can
expect a result of 1, 0, or 10. Lets formalize this. Let one number be given by X, one be
Y . The resulting number can be represented by the beginning number Z and the so-called
carry bit C. In a truth table, this appears as:

2.1 Experimental Half-Adder

2 THE HALF-ADDER
X
0
0
1
1

Y
0
1
0
1

C
0
0
0
1

Z
0
1 .
1
0

The next step is to write down the Boolean statement. For what we have here, it is
Y + X Y ,
Z=X
where the bar indicates a zero, or false, and the non-bared term indicates one, or true.
Reading the statement, this says that Z will be true when X is not true and Y is true, or
when X is true and Y is not. From the same logic, the carry bit is
C = X Y.
One thing that is interesting is that Z is the definition of a XOR gate, or exclusive OR. That
is
Z = X Y.
Z and C together are what is known as the Half-Adder. The circuit representation is seen
in Figure 1. It consists of a XOR gate and an AND gate.

Figure 1: The Half-Adder, From Lab Handout

2.1

Experimental Half-Adder

Now, we wish to construct such a mechanism. To do so we use will need the XOR gate and
AND gate. The exact devices we utilize is the CD4081BE chip for the AND gate and the
CD4070B chip for the XOR gate. They will be connected to 5V and ground, as stated in the
lab handout. For experimental purposes, an output of 5V is considered on and 0V is off.
Hooking up the circuit to the oscilloscope, we test the circuit and confirm that, indeed, we
get the desired result for a Half-Adder. That is, the circuit does behave like an adder. Below
is the truth table, experimentally derived (and confirmed to be completed by the lab TA).
The table includes the decimal values that show the adding behavior.
Decimal Value
0+0
0+1
1+0
1+1

X
0
0
1
1

Y
0
1
0
1

C
0
0
0
1

Z
0
1
1
0

Decimal Value
0
1
1
2

3 THE BINARY MULTIPLIER

We now move on to testing the threshold voltage levels of the chips we using. This is done
by connecting our source generator to our circuit (and oscilloscope) and inputing a triangle
waveform between 0 and 5V through the circuit. The triangle waveform goes through a
range of voltages at a linear pace. Thus, at some voltage, the circuit will turn on and start
outputting a value. The inputted waveform will be sent through the X channel. It will also
turn off on the decline of the wave. We have the turn on, turn off, and over all waveforms
below.
Turn On

Turn Off

Overall Waveform

From the data, we have a logic low when X 2.24V on the rising edge and X 2.10V on
the falling edge. We have a logic high when X 2.24V on the falling edge and X 2.26V
on the rising edge.

The Binary Multiplier

As the section title suggests, we now consider a circuit, which can multiply binary numbers
together. This is done using Half-Adders.

3.1

Getting Started

To begin, lets quickly define and familiarize ourselves with how to binary multiplication is
accomplished. Actually, its quite simple. A quick way to do it is by using multiplication
done in elementary schools. As we were taught, we multiply two numbers together by taking
each digit of the top number, multiplying them with one digit of the bottom number, writing
the outcome, skipping to the next line and over one, repeating the process until we have

3.2 The 2-Bit by 2-Bit Binary Multiplier

3 THE BINARY MULTIPLIER

gone through all the digits of the bottom number


exercise to demonstrate this:
3

2
7
+ 7 4
8 1

and adding them together. Here is a quick


7
2
4
4.

Binary multiplication works the exact same. To demonstrate, lets do the same example,
but in binary. First we convert our numbers to binary: 37 = 25 + 24 + 20 100101 and
22 = 24 + 22 + 21 10110. Now we multiply:

1
0 0
+ 1 0 0
1 1 0

1
0
0
1
0

1 0
1
0 0
0 0
0 1
0 0
0 1
1 0

0
0
0
1
0
0

1
1
0
0
1

0
1
0
1

1
0
0

1 1 1 0.

Converting the binary to decimal, we have 1100101110 29 + 28 + 25 + 23 + 22 + 21 = 814.


While the operation may appear cumbersome, it could be handy to multiply large numbers
when one does not have a calculator on-hand.

3.2

The 2-Bit by 2-Bit Binary Multiplier

Now we shall apply the thought process of the operation we just did to circuits by constructing
a binary multiplier, which will multiply one, 2-bit binary number A = A1 A0 by another
B = B1 B0 . The answer will be in terms of a binary number C = {Cn }. A quick multiplication
by the method just discussed can see how C will depend on A and B.
A1
A0
B1
B0
A1 B0 A0 B0
A0 B1
C1
C0 .

+
C3

A1 B 1
C2

From here we quickly can see that C0 = A0 B0 , C1 is the Half-Adder we examined in the
previous section, C2 is the carry-bit of C1 + A1 B1 , and C3 is the carry-bit of C2 . This tells
us how to construct our circuit. We will need
4, 2-input AND gates for each An Bn
2 Half-Adders for C1 and C2 .
The exact circuit diagram is shown below.

3.3

Experimental 2-Bit by 2-Bit Binary Multiplier

Now all the remains is construct the circuit and analyze the corresponding truth table. The
AND and XOR gates are built using the same chips from section 2. Hooking our setup to
an oscilloscope, we check record our results for every possible combination of A1 , A0 , B1 , and
B0 . As there are 4 inputs with 2 values each, that translates to a total of N = 24 = 16

4 SUMMARY

Figure 2: The Binary Multiplier, From Lab Handout

combinations. Below is the truth table (NOTE: This truth table was verified to have been
completed experimentally by the lab TA).
Decimal Value
00
01
02
03
10
11
12
13
20
21
22
23
30
31
32
33

A1
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1

A0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1

B1
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1

B0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

C3
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1

C2
0
0
0
0
0
0
0
0
0
0
1
1
0
0
1
0

C1
0
0
0
0
0
0
1
1
0
1
0
1
0
1
1
0

C0
0
0
0
0
0
1
0
1
0
0
0
0
0
1
0
1

Decimal Value
0
0
0
0
0
1
2
3
0
2
4
6
0
3
6
9

The truth table does, indeed, make sense. The outputted signals are the correct multiplication
of the input. Thus, we have built an accurate Binary Multiplier.

Summary

In closing, we have discussed the basics of combinational logic, Boolean algebra, and truth
tables and there relationship to electronics. Then we went on to build and test a Half-Adder
circuit using AND and XOR gates, which adds two binary numbers. Lastly, we constructed
a Binary Multiplier which multiplies two binary numbers. With both cases, we were able to
confirm the adding and multiplying behavior we desired.

Potrebbero piacerti anche