MUCLecture 2022 8106412
MUCLecture 2022 8106412
Experiment No. 2
4-Bit Binary Adder/Subtractor
1. Introduction
1. Objective:
• To understand how to convert numbers from binary to decimal format and vice versa.
• To study parallel adding and subtraction of 4-bit binary numbers with carry.
1.2 Components:
• ST2611 Digital Circuit Development Platform trainer with power supply cord
• DB19 4-Bit Parallel Adder/Subtractor
• Set of wires
1.3 Theory:
In order to understand the binary arithmetic circuits and the principles of addition and subtraction,
we need to know how to convert between binary and decimal numbers. In the decimal system, each
position from the right represents a larger power of ten, starting with 100. For example:
199610 = 1 × 103 + 9 × 102 + 9 × 101 + 6 × 100
Likewise, in the binary number system, which is also positional, each position from the right
represents a larger power of two, starting with 20.
Binary to Decimal Conversion
For any binary number in a column i, add the decimal number represented by 2 to the ith power
when the binary number is 1 and ignore when it is zero. For example:
• Number to be converted: 1 0 1 0 1 1 0 1
• Power of 2 of columns: 27 26 25 24 23 22 21 20
• Number represented: 128 64 32 16 8 4 2 1
• Thus the decimal number is: 128 + 0 + 32 + 0 + 8 + 4 + 0 + 1 = 173
Parallel Adder
In our experiment today, we will learn about adding two four-digit numbers to each other by using
the Parallel Adder which can add multiple-digit numbers, assuming that the addend would be the A
inputs, and the augend would be the B inputs. For this explanation, see the following addition:
1 0 1 0
+ 0 0 1 0
1 1 0 0
1
Parallel Subtractor
Same as the Parallel Adder, the Parallel Subtractor can also subtract multiple-digit numbers, but we
will only discuss subtraction of two 4-digits numbers from each other for our experiment. See the
following explanation:
_ _ _ _
As you can see 0 - 0 will give us 0, 1 – 0 will give us 1, and 1 - 1 will produce 0, but in the case of 0
- 1 the number will be 1 after borrowing 1 from the next column where this borrow one will
represent as 2 since it would be taken from a higher significant leaving it equal to zero. Check the
following example where four digits number will be subtracted from another four digits number,
working from right to left as we do in normal subtraction:
Al-Mustaqbal University College 3/6 https://www.uomus.edu.iq/
2
0
1 0 1 0
_ 0 1 1 0
0 1 0 0
The DB19 4-Bit Parallel Adder/ Subtractor shown in Figure 1 is a compact, easy to use digital logic
board that will be used in this experiment. It is useful for students to get familiar with the basic
arithmetic operation of addition and subtraction and verify its truth table.
2. Experiments:
2.1 Exercise 1 Adding Two 4-Bit Binary Numbers:
1. Place the DB19 panel shown in Figure 1 on the trainer.
2. To provide power to the board, connect +5 V pin from the trainer on the left side to +5V pin on
the DB19 using a wire.
3. Connect GND pin from the trainer on the left side to ground symbol pin on the DB19.
4. Turn on the power supply.
5. Move the dip switch on the top left side of the panel to Add mode.
6. To execute this exercise, move switches A1 to 1, A2 to 1, A3 to 0, A4 to 1.
Al-Mustaqbal University College 4/6 https://www.uomus.edu.iq/
7. Then move B1 to 1 and keep B2, B3, B4 at 0.
8. Observe the LED lights output on the right side of the panel and fill out Table 1.
9. Repeat for 3 more addition operations.
10. Verify the obtained Truth Table.
A4 A3 A2 A1 B4 B3 B2 B1 Carry S4 S3 S2 S1
1 0 1 1 0 0 0 1
4. Subtract the following two binary numbers from each other and verify your solution.
1 0 0 0
- 0 1 0 1
5. How you can prove that the subtraction result of 1011 from 11001 is 14 in decimal
6. Solve the following equation where all numbers including x are binary:
x – 1001 = 11101