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

Pin layouts are attached.

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 your instructor (Bill) your circuit, if it's specified that you do so in the problem. There will always be at least one problem that requires inspection during a lab period. These items will be in bold.

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... watch your power and ground inputs!

Lab Problems

This lab focuses on binary addition and subtraction... this stuff is covered on pages 125-143 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:

  1. Exercise the A inputs from 0-15, keeping B at 0, and your outputs LED's should count along with you
  2. Do the same thing with your B inputs (count from 0-15), keeping A at 0, and count along on the outputs
  3. 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. Adding/Subtracting with 1's complement

Now, let's do some binary addition and subtraction. 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.

  1. 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.
  2. 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.
  3. 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          

 

3. 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.

  1. Change your wiring to accommodate 2's complement addition/subtraction
  2. Verify your change by counting with each input, from -8 to 7.
  3. Fill in the same table above as you did for 1's complement... using 2's complement representation now.

4. Adding/Subtracting with signed-magnitude

Here's the deal... you can build this one with your logic box or do it on paper. It's your choice.

Please design a 4-bit signed-magnitude adder/subtractor. You will need 1 7483 binary Adder and 2 7486 XOR chips (and maybe an inverter or two depending on your choices). The block diagram includes:

The circuit should include:

4-bit inputs A and B, and a Cin input for carry-in.
4 output Sum bits and a Cout output for carry-out.
An input bit, P, that controls whether (A + B) is calculated, or (A - B) is calculated by your circuit. You are out of switches, so I recommend using the pulse buttons to control P. Hint: I recommend that P=0 be addition and P=1 be subtraction.
If A and B are being added, then this is simple unsigned binary addition.
If (A - B) is being calculated, then B must be complemented prior to addition. I recommend using 1's complement for this because it is a simple bit-wise complement. Remember if P is 1 (for subtract), then complement B. If P is 0, the B should be unchanged. Hint: You should be able to selective complement B using XOR gates. Remember last lab?
For the Sum output, the "end-around carry" must be added since we're using 1's complement. Also, if no "end-around carry" exists, we know that the adder result is negative and must be complemented. 

Please show me:

Your design steps: truth table, equations, English description of your rationale
The table from part 2 again, this time using your signed-magnitude design.
Please show me your physical or paper implementation before leaving or dismantling.

Hints 'o plenty: Page 134 has a nice circuit example, but they use a binary subtractor. Page 137 shows an example of signed-magnitude subtractions. As far as complementing the B bits, our last lab did some interesting work with XOR gates, and Page 138 is very interesting too.