BCS302 · COMPUTER ORGANIZATION AND ARCHITECTURE · Unit 2
Arithmetic and logic unit
Unit Scope & Exam Weightage: This is the numerical heart of COA: the ALU and its flag logic, carry-look-ahead addition, signed multiplication (array multiplier and Booth's algorithm), division and logic operations, floating-point arithmetic and the IEEE 754 single-precision format. AKTU repeatedly asks one 7-mark derivation or binary numerical and one 2-mark definition from this unit, for roughly 14 to 21 marks. The carry-look-ahead derivation, the Booth step table and the IEEE 754 bit field layout are the three most reliable full-credit topics.
Front Page: Importance-Wise Topic Roadmap (2023–26 PYQs)
| Priority | Topic (Exact Syllabus) | PYQs Asked | Marks Weightage | Tag |
|---|---|---|---|---|
| 1 | Booths algorithm and array multiplier | 5 (2023-24 ×3, 2024-25, 2025-26 ×2) |
7m × 3 + 2m × 2 | Survival Mode Numerical |
| 2 | Look ahead carries adders | 2 (2023-24/2025-26, 2024-25) |
7m × 2 | Survival Mode Derivation |
| 3 | Floating point arithmetic operation | 2 (2024-25/2025-26, 2025-26) |
2m + 7m | High-Yield Numerical |
| 4 | IEEE Standard for Floating Point Numbers | 1 (2023-24) |
7m | Bit-Pattern Numerical |
| 5 | Arithmetic & logic unit design | 2 (2024-25, 2025-26) |
7m + 2m | Core Concept |
| 6 | Multiplication: Signed operand multiplication | 1 (2024-25) |
7m | Supporting Concept |
| 7 | Division and logic operations | 0 direct | — | Predicted |
2-Hour Last-Night Survival Checklist:
- Booth (#1 Priority): Memorise the Q₀Q−1 rule —
00/11 → shift only,01 → A ← A+M,10 → A ← A−M— followed by an arithmetic shift ofA, Q, Q₋₁. Work−5×3once by hand before the exam. - CLA (#2 Priority): Write , , then expand from . Quote the O(log n) vs O(n) delay comparison.
- IEEE 754 (#3/#4 Priority): Single precision = 1 sign + 8 exponent (bias 127) + 23 fraction. For conversion: normalise to , set exponent , drop the leading 1.
- Arithmetic in floating point: align the smaller exponent by right-shifting its significand, add/subtract significands, normalise, then re-bias the exponent. Work
5.75 + (−2.5). - ALU design: be able to draw the ALU block with select lines, carry-in and the flag outputs Z, C, S, V; list five arithmetic and five logic micro-operations.
1. Arithmetic and Logic Unit Design
ALU (2 Marks): The Arithmetic and Logic Unit is the combinational datapath block that performs arithmetic and bitwise logic on register operands and reports the result together with status flags (carry, zero, sign, overflow). It is selected by an -bit operation code from the control unit.
1.1 Block View
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart LR
A["Operand A<br/>n bits"] --> ALU["ALU<br/>S1 S0 select"]
B["Operand B<br/>n bits"] --> ALU
CIN["Carry-in / shift-in"] --> ALU
SEL["Control unit<br/>operation code"] --> ALU
ALU --> R["Result F<br/>n bits"]
ALU --> FL["Flags<br/>Z, C, S, V"]
1.2 Operations and Flags
| Class | Operations | Flag effect |
|---|---|---|
| Arithmetic | ADD, ADC, SUB, SBC, INC, DEC, NEG | Z, C, S, V all updated |
| Logic | AND, OR, XOR, NOT, TEST | Z and S updated; C, V usually cleared |
| Shift/rotate | SHL, SHR, ASHL, ASHR, ROL, ROR | C gets the bit shifted out; V on arithmetic overflow |
For an -bit adder, the flags are:
detects signed overflow — adding two positives that produce a negative, or two negatives that produce a positive.
Examiner Tip: In a 7-mark ALU-design answer, show (i) the block diagram with select lines and carry-in, (ii) a function-selection table (e.g., S1S0 = 00 ADD, 01 SUB, 10 AND, 11 OR), (iii) one gate-level expression such as , and (iv) the four flag equations above.
After-Topic PYQ (2025-26 Sec B Q2c, 7 Marks): Explain the design of an Arithmetic and Logic Unit. Describe various arithmetic and logical operations performed by ALU.
After-Topic PYQ (2024-25 Sec A Q1d, 2 Marks): Discuss the role of ALU in a processor?
2. Look-Ahead Carry Adders Survival Mode
Carry Look-Ahead Adder (CLA): an adder that computes all carries in parallel from the input operands using carry-generate and carry-propagate signals, instead of waiting for the carry to ripple from bit 0 to bit .
2.1 Derivation of the Carry Equations
For bit position , define:
Now substitute the previous carry repeatedly:
All four carries depend only on , and , so they are formed after two gate levels rather than waiting for four ripple stages.
2.2 4-Bit CLA Structure
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
AB["A3..A0, B3..B0"] --> GP["G_i = A_i B_i<br/>P_i = A_i XOR B_i"]
GP --> CL["Carry look-ahead logic<br/>C1, C2, C3, C4"]
C0["C0"] --> CL
CL --> SUM["S_i = P_i XOR C_i"]
SUM --> RES["S3 S2 S1 S0 + C4"]
2.3 Ripple vs Look-Ahead
| Feature | Ripple carry adder | Carry look-ahead adder |
|---|---|---|
| Carry path | Serial through every full adder | Parallel Boolean network |
| Delay | , grows linearly with bit width | with hierarchical groups |
| Hardware | identical full adders, small | Extra and group logic, larger |
| Speed for 32/64 bits | Slow | Fast; used in high-performance ALUs |
| Cost | Low | Higher gate count and wiring |
Examiner Tip: The 7-mark CLA answer is essentially the four expanded carry equations. Write , , then through explicitly, then , and close with the delay comparison table. That is a complete derivation, not a memorised paragraph.
After-Topic PYQ (
2023-24 / 2025-26 Sec C Q4a— 7 Marks): Explain in detail the principle of carry looks ahead adder and design 4-bit CLA adder.After-Topic PYQ (
2024-25 Sec C Q4a— 7 Marks): Explain the concept of look-ahead carry adders in digital arithmetic circuits. Compare and contrast their performance with conventional ripple carry adders, highlighting advantages and disadvantages?
3. Signed Operand Multiplication and Multiplier Types
Signed multiplication: multiplication in which operands are held in 2's-complement form. The product of two -bit words may need bits; the sign of the result follows from the MSBs, and direct shift-and-add must correct for negative multipliers.
3.1 Types of Multipliers
| Type | Principle | Remark |
|---|---|---|
| Shift-and-add (unsigned) | For each multiplier bit 1, add shifted multiplicand | Simplest; fails directly for negative multiplier |
| Array multiplier | Combinational array of AND gates and adders generates all partial products in parallel | Fast, regular, large area |
| Booth multiplier | Recodes multiplier into signed digits, reducing the number of partial products | Preferred for signed operands |
| Wallace tree | Compresses partial products with carry-save adders | Very fast, irregular layout |
For signed operands, sign-extension of each partial product is required in a direct array, or Booth recoding is used so that runs of 1s are handled as a single subtraction.
Examiner Tip: For the 2-mark "name the multipliers" question write: array multiplier, Booth multiplier, shift-and-add multiplier and Wallace-tree multiplier. Add one phrase each — array = parallel combinational, Booth = recoding for signed numbers.
After-Topic PYQ (2023-24 Sec A Q1b, 2 Marks): Name the different types of multipliers.
After-Topic PYQ (2024-25 Sec C Q4b, 7 Marks): Discuss the process of signed operand multiplication in digital arithmetic circuits?
4. Array Multiplier
Array multiplier: a combinational network that forms every partial product with an AND gate and sums them through an array of half-adders and full-adders. For two -bit words it needs AND gates and roughly adders.
4.1 Structure
B3 B2 B1 B0 (multiplier)
A3 ─ AND ─ P33 ─ P32 ─ P31 ─ P30
A2 ─ AND ─ P23 ─ P22 ─ P21 ─ P20
A1 ─ AND ─ P13 ─ P12 ─ P11 ─ P10
A0 ─ AND ─ P03 ─ P02 ─ P01 ─ P00
\ \ \ \ → adder array → P7...P0
Each row is one shifted partial product; the carry-save array collapses them into the final -bit product.
4.2 Worked Pattern — ,
Multiplier bits from LSB: .
1101 (b0=1) 00001101
1101 (b1=1, shift 1) 00011010
0000 (b2=0) 00000000
1101 (b3=1, shift 3) 01101000
----------------------------------
sum 10001111 = 143
Check: , , and . ✓
Examiner Tip: In an array-multiplier numerical, show every partial product on its own shifted line and add them in columns. Writing only the final binary answer loses most of the 7 marks — the examiner awards step marks for the partial-product rows.
After-Topic PYQ (
2025-26 Sec B Q2a— 7 Marks): Multiply the following numbers using Array Multiplier technique: , .
5. Booth’s Algorithm
Booth's algorithm: a signed multiplication algorithm that examines adjacent multiplier bits . A run of 1s is replaced by one subtraction at its start and one addition just after its end, so long strings of 1s need only two operations instead of many additions.
5.1 The Recoding Rule
| Operation | Then | ||
|---|---|---|---|
| 0 | 0 | none | arithmetic shift right of |
| 0 | 1 | arithmetic shift right | |
| 1 | 0 | (i.e., ) | arithmetic shift right |
| 1 | 1 | none | arithmetic shift right |
Repeat exactly times for an -bit multiplier. In the shift, the sign bit of is replicated, moves into (or ), and old moves into .
5.2 4-Bit Illustration —
, , , , , count = 4.
| Step | Action | A | Q | ||
|---|---|---|---|---|---|
| init | — | — | 0000 | 0011 | 0 |
| 1 | 10 | 0010 | 1001 | 1 | |
| 2 | 11 | shift only | 0001 | 0100 | 1 |
| 3 | 01 | 1110 | 0010 | 0 | |
| 4 | 00 | shift only | 1111 | 0001 | 0 |
Final in 2's complement. ✓
Examiner Tip: The most common losing mistake is a logical shift instead of an arithmetic shift. State on the first line: "shift right with sign extension and move into the MSB of ". Also show before starting the table.
After-Topic PYQ (
2024-25 Sec B Q2b / predicted— 7 Marks): Describe Booth's algorithm for signed binary multiplication. Explain how it optimizes the multiplication process and discuss its advantages over traditional methods?After-Topic PYQ (2025-26 Sec A Q1f, 2 Marks): Explain signed number multiplication using Booth’s Algorithm. Multiply where and using Booth’s Algorithm.
6. Division and Logic Operations
Restoring division: an unsigned division algorithm that repeatedly shifts the partial remainder left, subtracts the divisor, and restores the previous remainder whenever the subtraction goes negative. A 0 quotient bit means "restore"; a 1 means "keep".
6.1 Restoring Division Steps
Let , = dividend, = divisor, count = :
1. Shift A,Q left by 1 bit (A1 = Q_msb is not lost)
2. A ← A − M
3. If A ≥ 0: set Q0 = 1 and keep A
If A < 0: set Q0 = 0 and A ← A + M (restore)
4. Decrement count; repeat until count = 0
Quotient = Q, remainder = A
Worked check: with 4-bit words: , . After four cycles the quotient is and the remainder is ; indeed . Non-restoring division avoids the restore step by adding back only in the following cycle, halving the number of add/subtract operations.
6.2 Logic Micro-Operations
With , :
| Micro-operation | RTL | Result | Use |
|---|---|---|---|
| AND / mask | 1000 | Clear selected bits | |
| OR / selective set | 1110 | Set selected bits | |
| XOR / selective complement | 0110 | Toggle selected bits | |
| Selective clear | 0010 | Reset where B = 1 | |
| NOT | 0101 | Complement all bits |
Examiner Tip: Division is unasked in the current PYQ set but sits in the syllabus. A predicted question is "explain restoring division with a numerical". Learn the four-step loop and quote the invariant , .
7. Floating Point Arithmetic and IEEE 754
Floating-point number (2 Marks): a number represented as significand × baseexponent, allowing a very wide range of magnitudes. IEEE 754 single precision uses 1 sign bit, 8 exponent bits with bias 127, and 23 fraction bits (32 bits total).
7.1 Single-Precision Layout
| S bit 31 |
Exponent E (8 bits) bias 127 |
Fraction f (23 bits) implicit leading 1 |
|---|
Special cases: ; ; NaN.
7.2 Worked Conversion —
, , so .
- fraction = followed by 14 zeros
Bit pattern: 0 10000101 01010100100000000000000
7.3 Worked Conversion —
, , so .
- fraction = + 11 zeros
Bit pattern: 1 10000111 00110011001100000000000
7.4 Floating-Point Addition — The Four Phases
%%{init: {'theme': 'base', 'look': 'handDrawn', 'themeVariables': {'fontFamily': "'Nunito', sans-serif", 'fontSize': '17px', 'primaryColor': '#EFEAD6', 'primaryBorderColor': '#0F766E', 'lineColor': '#23211C'}}}%%
flowchart TD
A["1. Align exponents<br/>shift smaller significand right"] --> B["2. Add/subtract significands<br/>with sign handling"]
B --> C["3. Normalise<br/>shift so form is 1.f × 2^E"]
C --> D["4. Re-bias exponent<br/>round and assemble S,E,f"]
Worked:
- ; .
- Align: .
- Add significands: , so the result is .
- Normalise: . True exponent , stored .
- Result , pattern
0 10000000 10100000000000000000000. ✓ ()
Examiner Tip: Always write the true value beside each bit pattern (, , ). If the arithmetic slips, the examiner can still award the method marks, and the magnitude check catches a wrong bias or a missing implicit 1.
After-Topic PYQ (2024-25/2025-26 Sec A Q1c, 2 Marks): Explain floating-point representation and its components.
After-Topic PYQ (
2025-26 Sec B Q2b— 7 Marks): Explain floating point arithmetic operations. Perform floating point addition using IEEE 754 format for .After-Topic PYQ (
2023-24 Sec C Q4b— 7 Marks): Represent the following decimal number in IEEE standard floating-point format in a single precision method (32 bit) representation method.\n(i) \n(ii)
Solved Exam-Ready Questions
Solved Q1 (2023-24 / 2025-26 Sec C Q4a — 7 Marks | Survival Mode)
Q: Explain in detail the principle of carry looks ahead adder and design 4-bit CLA adder.
Solution:
- Problem with ripple: each full adder must wait for from the previous stage, so the carry path delay is .
- Generate and propagate: produces a carry regardless of ; passes an incoming carry onward. Hence and .
- Expansion for 4 bits:
- Design: four AND/XOR pairs form ; one look-ahead network forms ; four XOR gates form ; is the carry-out.
- Delay: the carry network is two gate levels deep independent of bit position; group look-ahead extenders give for wider words.
- Trade-off: faster than ripple but with more gates and wiring.
- Conclusion: the CLA trades silicon area for speed by computing carries in parallel from , and .
Solved Q2 (2025-26 Sec B Q2a — 7 Marks)
Q: Multiply the following numbers using Array Multiplier technique: , .
Solution:
- , ; expected product .
- Form partial products for each multiplier bit (LSB first):
| shifted multiplicand | value | |
|---|---|---|
| 00001101 | 13 | |
| 00011010 | 26 | |
| 00000000 | 0 | |
| 01101000 | 104 |
- Column-sum: .
- Final 8-bit product: .
- Hardware note: each row is an AND-plane row; the adder array collapses the four rows into the product bits .
Solved Q3 (2023-24 Sec B Q2b — 7 Marks | Survival Mode)
Q: Show the multiplication process using Booth's algorithm when the following numbers are multiplied: .
Solution:
- , , , , , count = 8.
| Step | Operation | A (after op) | A (after ASR) | Q | ||
|---|---|---|---|---|---|---|
| init | — | — | 00000000 | — | 11101110 | 0 |
| 1 | 00 | none | 00000000 | 00000000 | 01110111 | 0 |
| 2 | 10 | 00001100 | 00000110 | 00111011 | 1 | |
| 3 | 11 | none | 00000110 | 00000011 | 00011101 | 1 |
| 4 | 11 | none | 00000011 | 00000001 | 10001110 | 1 |
| 5 | 01 | 11110101 | 11111010 | 11000111 | 0 | |
| 6 | 10 | 00000110 | 00000011 | 01100011 | 1 | |
| 7 | 11 | none | 00000011 | 00000001 | 10110001 | 1 |
| 8 | 11 | none | 00000001 | 00000000 | 11011000 | 1 |
- Final .
- Check: , and . ✓
- The two subtraction steps (2 and 6) and one addition (5) replace the many additions a shift-and-add multiplier would need — that is the optimisation.
Solved Q4 (2025-26 Sec A Q1f — 2 Marks)
Q: Explain signed number multiplication using Booth’s Algorithm. Multiply where and using Booth’s Algorithm.
Solution:
- , , , , , count = 4.
- Step 1 (10): , ASR → , , .
- Step 2 (11): shift only → , , .
- Step 3 (01): , ASR → , , .
- Step 4 (00): shift only → , , .
- Product , which equals . ✓
Solved Q5 (2024-25 Sec C Q4a — 7 Marks)
Q: Explain floating point arithmetic operations. Perform floating point addition using IEEE 754 format for .
Solution:
- → , ,
- → , ,
- Align exponents: shift the smaller-exponent significand right by one bit → .
- Add significands: . Sign bit of result = 0 because the positive magnitude is larger.
- Normalise: . No rounding needed.
- Re-bias: ; fraction followed by 20 zeros.
- Result: , bit pattern
0 10000000 10100000000000000000000.
Solved Q6 (2023-24 Sec C Q4b — 7 Marks)
Q: Represent the following decimal number in IEEE standard floating-point format in a single precision method (32 bit) representation method.\n(i) \n(ii)
Solution:
- Rule: ; write the binary, normalise, add 127 to the exponent, discard the leading 1.
- (i) . ; ; . Pattern:
0 10000101 01010100100000000000000. - (ii) . ; ; . Pattern:
1 10000111 00110011001100000000000. - Check: de-normalising (i) gives ; (ii) gives . ✓
Solved Q7 (2024-25 Sec C Q4a — 7 Marks)
Q: Explain the concept of look-ahead carry adders in digital arithmetic circuits. Compare and contrast their performance with conventional ripple carry adders, highlighting advantages and disadvantages?
Solution:
- A ripple carry adder chains through full adders; the MSB result waits for carry propagations.
- Define and . Then depends only on operands and .
- Expanded carries (write all four for a 4-bit adder): , , , .
- .
- Advantages: delay independent of bit position within a group; hierarchical look-ahead scales as ; essential for fast ALUs.
- Disadvantages: larger gate count, more wiring and power; group logic grows for very wide words.
- Conclusion: ripple is cheap and simple for narrow adders; CLA is chosen when clock period matters more than area.
Solved Q8 (2-Mark Cluster — 2024-25/2025-26 Sec A Q1c)
Q: Explain floating-point representation and its components.
Solution: A floating-point number is . Its components are the sign bit , the exponent field (biased by 127 in single precision, giving true exponents from to ), and the fraction/mantissa (23 bits, with a hidden leading 1 for normalised numbers). This format trades exactness for a very large dynamic range.
Practice Questions (Self-Test)
- (2 Marks) Define carry-generate and carry-propagate and write the recurrence .
- (2 Marks) Name four types of multipliers and state the distinguishing feature of each.
- (7 Marks) Derive for a 4-bit carry-look-ahead adder and count the gate levels.
- (7 Marks) Multiply by using an array multiplier; show all partial products.
- (7 Marks) Use Booth's algorithm to compute with 4-bit words; give the full step table.
- (7 Marks) Convert to IEEE 754 single precision.
- (7 Marks) Perform IEEE 754 addition and give the final 32-bit pattern.
- (7 Marks) Explain restoring division and work with 4-bit registers.
- (2 Marks) With , , find , and .
- (7 Marks) Draw and label the ALU block diagram with two operand inputs, carry-in, operation select, result and the four status flags.