Computer Organization & ArchitectureBTAI-0103
Unit 2: Arithmetic and Logic Unit (ALU)
Binary Arithmetic, Carry-Lookahead Adders, Booth's Algorithm & Floating Point
Comprehensive hardware implementation of binary addition, high-speed carry lookahead circuits, signed 2's complement multiplication via Booth's recoding, restoring division, and IEEE 754 floating-point standards.
Booth's Algorithm Intuition: Socho agar aapko 7 × 15 multiply karna hai. Traditional binary multiplication mein 15 hota hai 1111_2, jisme aapko 4 baar addition karna padega! Booth ne notice kiya ki 15 = (16 - 1) = (2^4 - 2^0) hota hai.
Yani 4 baar add karne ke bajaye, aap sirf 1 baar subtract karo (shuru mein) aur 1 baar add karo (aakhiri mein)! Beech ke saare consecutive 1s mein sirf fast Arithmetic Right Shift (ARS) karo. Is se cycles aur hardware heat dono bachte hain!
ARS (Arithmetic Right Shift) Rule: Normal right shift mein MSB mein 0 inject hota hai. Par signed negative numbers mein MSB unka Sign Bit (1) hota hai. Isliye ARS hamesha MSB ko copy karke duplicate karta hai taaki number ka negative sign preserve rahe!
Laundry aur microphone analogies intuition banane ke liye hain. University examinations aur technical vivas mein Register Transfer Language (RTL), flip-flops, multiplexers, timing diagrams aur bus grant lines explain karna zaroori hai.
Booth's algorithm is a hardware multiplication technique that directly multiplies signed binary integers in two's complement representation without requiring sign-magnitude conversion. It evaluates adjacent multiplier bit pairs (Q_i, Q_i-1) to recode consecutive blocks of 1s into a single subtraction ($A \leftarrow A - M$) and addition ($A \leftarrow A + M$), reducing the expected number of additions.
Let Multiplier Q = -q_n-1 × 2^n-1 + Σ q_i × 2^i. By setting q_-1 = 0, the algebraic identity 2^i = 2^i+1 - 2^i yields:
Q = Σ (q_i-1 - q_i) 2^i.
• When q_0 = 1, q_-1 = 0 → (0 - 1) = -1 → A ← A - M.
• When q_0 = 0, q_-1 = 1 → (1 - 0) = +1 → A ← A + M.
• When q_0 = q_-1 → 0 → No arithmetic operation (Shift Only).
Test hardware state transitions visually or compile cycle-accurate C algorithms in GCC sandbox.