CSC
480 Lab #4
"See
Jane add... add Jane add" Lab
Purpose
|
Explore
binary addition |
|
Explore
binary subtraction using 1's and 2's complement |
Components
used
|
7483
4-bit binary adder |
You may need some other little nasties as well. Pin layouts are attached.
Lab
Procedure
Last lab went well. Just don't forget the basics:
|
For your safety... unplug the logic box while you are working
on it. |
|
For
the health and safety of your chips... use your tongs and watch your power and ground
connections. |
Lab
Problems
This lab focuses on binary addition and subtraction... this stuff is covered
on pages 201-221 in our text if you are looking for guidance. Please complete each of the following parts:
1.
Unsigned Binary addition
Hookup one of your 7483 binary adders to perform unsigned binary addition.
Connect inputs A and B (4 bits each) to your switches and connect the SUM
output (4 bits) and the COUT output to your LED's. What should CIN (or C0) be
assigned?
Once you're hooked up, please do the following:
- Exercise the A inputs from 0-15, keeping B at 0, and your outputs LED's
should count along with you
- Do the same thing with your B inputs (count from 0-15), keeping A at 0,
and count along on the outputs
- Fill in the following table using binary addition:
|
A |
B |
Cout |
Sum |
|
(4
bits) |
(4
bits) |
(1
bit) |
(4
bits) |
5+10 |
|
|
|
|
7+6 |
|
|
|
|
1+9 |
|
|
|
|
8+6 |
|
|
|
|
10+10 |
|
|
|
|
15+7 |
|
|
|
|
8+9 |
|
|
|
|
4+15 |
|
|
|
|
2. 1's
complementing circuit
Design a circuit that creates the 1's complement of a number. The circuit
inputs and outputs should be:
|
A...
4-bit input value |
|
COMP...
a bit controlling whether the number is complemented or not. If 0, then
don't complement, otherwise complement. |
|
S...
4-bit output value |
Complete a truth table for values 0000-1111, showing the 1's complemented
output for each.
3. 2's
complementing circuit
Do the same using 2's complement. Hint: You may need some extra hardware to
do this one.
4.
Adding/Subtracting with 1's complement
Now, let's do some binary addition and subtraction using signed
numbers. For problem 2,
please use 1's complement to represent negative binary numbers. This means
that inputs A and B will now be signed binary numbers in 1's complement
form... which implies that the most significant bit is now equal to -(23
- 1) = -7. Your answer, the SUM bits, will also be in 1's complement form.
- What changes do you need to make to your current adder setup to perform
1's complement addition/subtraction. Hint: the main difference between 1's
complement and unsigned addition is the "end-around carry"
operation. Show me how you do this.
- You can half-verify that your 1's complement adder/subtractor is okay,
by doing repeating the counting exercise from before. Set one input to
zero and count from -7 to 7 with the other... your outputs should count
along.
- Fill in the following table using 1's complement addition/subtraction...
please express your answers in 1's complement, except the last column
where you check that your answer is correct in decimal form:
|
A |
B |
Cout |
Sum |
Check |
|
(4
bits) |
(4
bits) |
1
(bit) |
(4
bits) |
(decimal) |
4+2 |
|
|
|
|
|
4-2 |
|
|
|
|
|
2-4 |
|
|
|
|
|
-4-2 |
|
|
|
|
|
7-3 |
|
|
|
|
|
3-7 |
|
|
|
|
|
3-3 |
|
|
|
|
|
5.
Adding/Subtracting with 2's complement
Basically, repeat problem 2... using 2's complement. Remember that in 2's
complement, the most significant bit is -(23) = -8.
- Change your wiring to accommodate 2's complement addition/subtraction
- Verify your change by counting with each input, from -8 to 7.
- Fill in the same table above as you did for 1's complement... using 2's
complement representation now.
|
A |
B |
Cout |
Sum |
Check |
|
(4
bits) |
(4
bits) |
1
(bit) |
(4
bits) |
(decimal) |
4+2 |
|
|
|
|
|
4-2 |
|
|
|
|
|
2-4 |
|
|
|
|
|
-4-2 |
|
|
|
|
|
7-3 |
|
|
|
|
|
3-7 |
|
|
|
|
|
3-3 |
|
|
|
|
|
Deliverables
For each lab problem, the following items are required:
|
A
brief summary of the problem you are solving |
|
A
truth table (or SOP/POS form if appropriate) of the circuit that you are
building |
|
A
logic diagram of the circuit that you are building... please use your
templates! |
These items should be added to your report, as needed:
|
Show
the steps (if any) you took to minimize or derive your circuit, such as:
K-Maps, Boolean algebra, DeMorgan's Theorem, Consensus Theorem, etc. |
|
Show
me your circuit when it's working. |
|