optional · CSS study notes
Arithmetic Microprocessor
CSS Optional — Paper-II, Computer Organization & Architecture
1. Definition
The ALU (Arithmetic Logic Unit) is the combinational hardware block that carries out all arithmetic and logic operations required by an instruction.
2. Classification — ALU Operation Types
- Arithmetic — addition, subtraction, multiplication, division, increment, decrement.
- Logical — AND, OR, NOT, XOR.
- Shift — left shift, right shift, rotate.
3. Classification — Multiplication Methods
- Shift-add method — repeated shifting and conditional addition, mirroring long multiplication in binary.
- Booth's algorithm — encodes runs of 1s to reduce the number of additions needed, especially efficient for signed numbers.
4. Subtraction via 2's Complement (high-yield)
A − B = A + (2's complement of B)
This lets the same adder circuit handle both addition and subtraction — the decisive reason 2's complement is used in every modern ALU.
5. Overflow Detection
- Rule — overflow occurs only when adding two numbers of the same sign and getting a result of the opposite sign.
- Adding a positive and a negative number can never cause overflow.
🗺️ Architecture Diagram — ALU Operation
graph LR
A["Operand A"] --> ALU["ALU"]
B["Operand B"] --> ALU
OP["Operation Select
ADD / SUB / AND / OR / SHIFT"] --> ALU
ALU --> R["Result"]
ALU --> FLAGS["Status Flags
Z, C, S, V"]
🧮 Solved Numerical 1 — Binary Addition
Q: Add 0110 (6) and 0011 (3).
0110
+ 0011
------
1001
Answer: 1001 = 9.
🧮 Solved Numerical 2 — Subtraction via 2's Complement
Q: Compute 7 − 3 in 4-bit binary.
7 = 0111
3 = 0011 → 2's complement of 3 = 1101
0111
+ 1101
-------
10100 → drop the carry → 0100 = 4
Answer: 4.
🧮 Solved Numerical 3 — Overflow Check
Q: 4-bit addition: 0111 (+7) + 0001 (+1). Check for overflow.
0111
+ 0001
------
1000 (represents −8 in 2's complement)
Both operands were positive but the result is negative → overflow occurred.
Answer: Overflow = 1.
🎯 CSS Exam Angle
Binary arithmetic and overflow-detection numericals are frequently repeated compulsory-style questions.
🔁 Repeated CSS Questions
- Perform binary subtraction using the 2's complement method with a worked example. (Numerical — very frequently repeated)
- Explain overflow detection in binary addition with an example.
- Briefly explain Booth's algorithm for binary multiplication.
⚠️ MCQ Trap
Overflow can only occur when adding two numbers of the same sign — adding a positive and a negative number can never cause overflow.