write lab report for digital fundamental
EET 2210 Lab 7
Doing Binary Subtraction using Adders
Objectives:
1. To learn how binary subtraction can be done by using addition
Background: In class we talked about how to do binary subtraction by doing a standard
subtraction method. In microprocessors this process is not done by an iterative method
like we talked about in class but with a method that uses two compliments. Basically it
can be shown that by taking any negative numbers you have and then turn them into
twos compliments you can then turn the subtraction into addition.
Materials:
2 7483 4 Bit Full Adders
6 330 Ohm Resistors
Dip Switches
7404 Hex Inverter
Procedure:
1. It is probably best to read all of the procedure first and then start wiring.
2. Start be wiring your Dipswitch. You will need 6 inputs for this lab to create
two three bit numbers that you will then subtract from each other. Be sure
to wire one side of the switch to +5V and the other side have a 330 ohm
resistor going to ground.
3. You will now need to go through the process of taking 3 of your inputs and
turning them into a 4 bit twos compliment. Remember that the first step is
to generate an ones compliment, which is just flipping the bits. Use the 7404
to invert the three inputs that you choose. The forth bit will always be a one
from this process. The fourth bit can then just be +5V from the supply.
4. Once you have your three inverted bits and +5V from the supply you need to
wire one of the adders to add one to the result. Wire one of the adders
inputs to your four bit number and the other input wire to +5V and ground
so that the input it 0001. Remember that any unused inputs need to be tied
to ground.
5. Once the first adder is wired you will now wire the second adder. The three
inputs that you did not use before will be one input to this adder and the
output of the other adder will be the other input. Remember that unused
pins will be wired to ground.
6. Because of the number of inputs we can only use the digital channels of the
oscilloscope to view the output. Wire digital channels 0-3 to the second
adders S0-3 outputs and wire channel 4 to the carry out pin.
7. Have your instructor verify the operation of the circuit. This circuit will only
function correctly as long as the minuend is larger than the subtrahend. If
the subtrahend is larger than the minuend some weird stuff will start
happening (Basically make sure whatever numbers you put in the result is
positive).