Computer Architecture : Practicals
Practical No. 2
Title: To Perform
Binary Arithmetic Operations
Aim
To
understand and perform fundamental binary arithmetic operations, specifically
binary addition and binary subtraction, and to apply complement methods for
subtraction.
Introduction
Binary arithmetic is
the foundation of all computations performed by a digital computer’s Central
Processing Unit (CPU). Every mathematical operation, no matter how complex, is
ultimately reduced to basic binary additions and subtractions.
This practical covers:
·
Binary addition
·
Binary subtraction
·
Subtraction using 1’s
complement and 2’s complement methods
These methods are
widely used in digital circuits because of their simplicity and efficiency.
Procedure / Examples
Example 1: Binary
Addition
Add 101₂ and 011₂:
1 1 ← Carry 1 0 1 + 0 1 1 ——– 1 0 0 0
So, 101₂ + 011₂ = 1000₂.
Example 2: Binary
Subtraction
Subtract 011₂ from 101₂:
1 0 1 - 0 1 1 ——– 0 1 0
So, 101₂ – 011₂ = 010₂.
Example 3: Binary
Subtraction (2’s Complement Method, 4-bit)
·
Minuend = 0101₂
·
Subtrahend = 0011₂
·
1’s complement of
subtrahend = 1100₂
·
2’s complement = 1100₂ + 1₂ =
1101₂
Now add:
0101 + 1101 -------- 10010
Discard the final carry
→ Result = 0010₂.
Result / Conclusion
This practical
demonstrated binary addition and subtraction along with complement methods. The
use of 1’s and 2’s complement provides an efficient way to perform subtraction
in digital systems. Mastering these operations is essential for understanding
how a CPU processes data in computer architecture.