Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Full Adder Using Multiplexer

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4
At a glance
Powered by AI
The key takeaways are that multiplexers are basic building blocks that select one of several input lines to pass to the output, and they can be used to implement complex logic functions like binary addition. Binary addition and subtraction operations were also discussed.

A multiplexer (or MUX) is a device that selects one of several input lines and outputs the signal on that line. It takes a number of inputs and multiplexes them onto a single output line, selecting one input line to pass to the output based on the values on its control lines.

A multiplexer can be used to implement binary addition by generating K-maps for the sum and carry outputs and tying the input lines of two 4-to-1 multiplexers in a way that produces the correct logic functions for sum and carry based on the control line values.

ECE238 laboratory lecture notes – University of New Mexico

Lab 3 Lecture Notes - Introduction to Arithmetic circuits

Part 1. Introduction to Multiplexers

The multiplexer is one of the basic building blocks of any digital design system. What it does is it
takes a number of inputs and multiplexes them onto a single output line. That is, it selects one of
the input lines, and passes its state to the output line.

The input on the A, B, and C lines tells the


multiplexer which one of the inputs 0-7 to
0
pass to the output. In the image above A=0,
1 B=1, and C=0, so the input line selected to
2 be passed to the output would be line 2.
This property of multiplexers is very useful.
3 Data Selector / As you will see later on, we can use a
Y
Multiplexor multiplexer to implement complex logic
4
functions. In terms of practical lab
5 experience, it allows one chip, the
6 multiplexer, to do the job of several simple
enable
logic gates. Later on, you will see how to
7
use the multiplexer to implement binary
addition and subtraction. However, before
A you can do this, you need to know
B something about binary arithmetic.
C

Figure 1: A Multiplexer

Part 2. Digital Arithmetic - Adition

This section discusses the basics of digital addition. Here is a block diagram of a binary adder:

From this diagram, you can see that the


adder has three inputs and two outputs. This
will mean that one must generate two
different K-maps, one for each output. Here
are the functions each line performs:

• A,B - The two numbers to be added


• K- Carry-in
• C- Carry-out
• S- Sum
Figure 2. Adder block diagram

Fall 2005,alnz@v1.1 1
ECE238 laboratory lecture notes – University of New Mexico

Figure 3. Full adder truth table

Using Multiplexers to Design a Binary Adder

Instead of using the 8-to-1 MUX introduced in Part 1, the 4-to-1 MUX will be used to implement
the binary adder. The following is the logic diagram of the 4-to-1 MUX.

Figure 4. Adder implemented using a MUX

Design process

Using the truth table shown in figure 3, generate two K-maps; one K-map for the Sum, and one
for the Carry Out.

Figure 5. K-map for the Sum

Let's take a few moments to inspect this Karnaugh map. Note that the Sum is A when B and K
are both true and false. The Sum is the complement of A when B or K is true, but not both.

Fall 2005,alnz@v1.1 2
ECE238 laboratory lecture notes – University of New Mexico

Now, how can we use this knowledge to Figure 6 shows a block diagram for the sum
create the Sum from a 4-to-1 MUX? Recall implemented using 4x1 MUX.
that the output is either A or the complement
of A. This makes things easier. Also, notice
how the 4-to-1 MUX has two control lines, A
S1, and S2. Recall that the value on the
control lines determines which input line is A
Data Selector /
passed to the output. Sum
A Multiplexor
Here is the solution:
A
S1 S2
If we tie B to S1 and K to S2, then we can tie
A to input lines 0 and 3 (00 and 11). Then
we must tie the complement of A to input B
lines 1 and 2 (01 and 10). This allows us to K
use a 4-to-1 MUX to produce the Sum.
Figure 6. Block diagram for SUM

Now, we have to address the Carry Out output.

Figure 7. K-map for the Carry-Out.

Now, inspect the K-map shown in figure 7 for a moment. Think of how we could use this K-map to
produce the Carry-Out using a 4-to-1 MUX.

Note that when B and K are both false, then


the output is also false. Note that when B 0
and K are both true, then the output is also
true. Finally, note that when B or K are true, A
Data Selector /
but not both, the output is A. Carry in
A Multiplexor
So, if we again apply B to S1 and K to S2,
we can generate the correct Carry-Out by 1
S1 S2
tying input line 0 to ground, input line 3 to
Vcc, and both input lines 1 and 2 to A. This
will generate the correct output. And, here, B
you can see that we can build a simple one- K
bit adder using just two 4-to-1 MUXes. The
block diagram for the carry out is shown in Figure 8. Carry out block diagram
figure 8.

If you want to add bigger numbers, you can cascade several binary adders together to produce
the sum.

Fall 2005,alnz@v1.1 3
ECE238 laboratory lecture notes – University of New Mexico

Part 3. Digital Arithmetic - Substraction

This section discusses the basics of digital subtraction. Here is a block diagram of a binary
subtractor.

From figure 9, you can see that the


subtractor has three inputs and two outputs.
This will mean that one must generate two
different K-maps, one for each output. Here
are the functions each line performs.

• X,Y - The two numbers to be


subtracted.
• b - Borrow-in.
• B - Borrow-out.
• D – Difference.

Figure 9. Subtractor block diagram.

This subtractor will work on two one-bit numbers X and Y. Figure 9 shows the truth table for the
subtractor.

Figure 9. Subtractor truth table.

Fall 2005,alnz@v1.1 4

You might also like