Top Banner Ad

BCS302 — Unit 2: Arithmetic and logic unit

Table of Contents (34 sections)

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:

  1. 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 of A, Q, Q₋₁. Work −5×3 once by hand before the exam.
  2. CLA (#2 Priority): Write Gi=AiBiG_i=A_iB_i, Pi=Ai⊕BiP_i=A_i\oplus B_i, then expand C1…C4C_1\dots C_4 from Ci+1=Gi+PiCiC_{i+1}=G_i+P_iC_i. Quote the O(log n) vs O(n) delay comparison.
  3. IEEE 754 (#3/#4 Priority): Single precision = 1 sign + 8 exponent (bias 127) + 23 fraction. For conversion: normalise to 1.f×2E1.f\times2^E, set exponent E+127E+127, drop the leading 1.
  4. 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).
  5. ALU design: be able to draw the ALU block with S0,S1S_0,S_1 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 mm-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 nn-bit adder, the flags are:

Z=1 iff F=0,S=Fn−1,C=Cout,V=Cin(n−1)⊕Cout(n−1)Z = 1 \text{ iff } F = 0, \qquad S = F_{n-1}, \qquad C = C_{out}, \qquad V = C_{in(n-1)} \oplus C_{out(n-1)}

VV 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 Fi=Ai⊕Bi⊕CiF_i = A_i \oplus B_i \oplus C_i, 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 n−1n-1.

2.1 Derivation of the Carry Equations

For bit position ii, define:

Gi=AiBi(carry generated at i),Pi=Ai⊕Bi(carry propagated through i)G_i = A_i B_i \quad (\text{carry generated at } i), \qquad P_i = A_i \oplus B_i \quad (\text{carry propagated through } i) Ci+1=Gi+PiCiC_{i+1} = G_i + P_i C_i Si=Pi⊕CiS_i = P_i \oplus C_i

Now substitute the previous carry repeatedly:

C1=G0+P0C0C2=G1+P1G0+P1P0C0C3=G2+P2G1+P2P1G0+P2P1P0C0C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0\begin{aligned} C_1 &= G_0 + P_0 C_0 \\ C_2 &= G_1 + P_1 G_0 + P_1P_0 C_0 \\ C_3 &= G_2 + P_2 G_1 + P_2P_1 G_0 + P_2P_1P_0 C_0 \\ C_4 &= G_3 + P_3 G_2 + P_3P_2 G_1 + P_3P_2P_1 G_0 + P_3P_2P_1P_0 C_0 \end{aligned}

All four carries depend only on GiG_i, PiP_i and C0C_0, 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 O(n)O(n), grows linearly with bit width O(log⁡n)O(\log n) with hierarchical groups
Hardware nn identical full adders, small Extra G/PG/P 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 GiG_i, PiP_i, then C1C_1 through C4C_4 explicitly, then Si=Pi⊕CiS_i=P_i\oplus C_i, 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 nn-bit words may need 2n2n 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 AiBjA_iB_j with an AND gate and sums them through an array of half-adders and full-adders. For two nn-bit words it needs n2n^2 AND gates and roughly n(n−1)n(n-1) 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 2n2n-bit product.

4.2 Worked Pattern — A=1101A=1101, B=1011B=1011

Multiplier bits from LSB: b0=1, b1=1, b2=0, b3=1b_0=1,\ b_1=1,\ b_2=0,\ b_3=1.

  1101        (b0=1)       00001101
  1101        (b1=1, shift 1) 00011010
  0000        (b2=0)       00000000
  1101        (b3=1, shift 3) 01101000
  ----------------------------------
  sum                       10001111  = 143

Check: 11012=131101_2=13, 10112=111011_2=11, and 13×11=143=10001111213\times11=143=10001111_2. ✓

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: A=1101A = 1101, B=1011B = 1011.


5. Booth’s Algorithm

Booth's algorithm: a signed multiplication algorithm that examines adjacent multiplier bits Q0Q−1Q_0Q_{-1}. 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

Q0Q_0 Q−1Q_{-1} Operation Then
0 0 none arithmetic shift right of A,Q,Q−1A,Q,Q_{-1}
0 1 A←A+MA \leftarrow A + M arithmetic shift right
1 0 A←A−MA \leftarrow A - M (i.e., A+M‾+1A + \overline{M}+1) arithmetic shift right
1 1 none arithmetic shift right

Repeat exactly nn times for an nn-bit multiplier. In the shift, the sign bit of AA is replicated, A0A_0 moves into Q3Q_3 (or Q7Q_7), and old Q0Q_0 moves into Q−1Q_{-1}.

5.2 4-Bit Illustration — −5×3=−15-5 \times 3 = -15

M=1011  (−5)M=1011\;(-5), −M=0101-M=0101, A=0000A=0000, Q=0011Q=0011, Q−1=0Q_{-1}=0, count = 4.

Step Q0Q−1Q_0Q_{-1} Action A Q Q−1Q_{-1}
init — — 0000 0011 0
1 10 A←A−M=0101A\leftarrow A-M=0101 0010 1001 1
2 11 shift only 0001 0100 1
3 01 A←A+M=1100A\leftarrow A+M=1100 1110 0010 0
4 00 shift only 1111 0001 0

Final A,Q=1111 0001=−15A,Q = 1111\,0001 = -15 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 AA right with sign extension and move A0A_0 into the MSB of QQ". Also show −M=M‾+1-M = \overline{M}+1 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 A×BA \times B where A=−5A = -5 and B=3B = 3 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 A=0A=0, QQ = dividend, MM = divisor, count = nn:

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: 11÷311 \div 3 with 4-bit words: Q=1011Q=1011, M=0011M=0011. After four cycles the quotient is Q=00112=3Q=0011_2=3 and the remainder is A=00102=2A=0010_2=2; indeed 11=3×3+211 = 3\times3+2. Non-restoring division avoids the restore step by adding MM back only in the following cycle, halving the number of add/subtract operations.

6.2 Logic Micro-Operations

With A=1010A=1010, B=1100B=1100:

Micro-operation RTL Result Use
AND / mask A←A∧BA \leftarrow A \land B 1000 Clear selected bits
OR / selective set A←A∨BA \leftarrow A \lor B 1110 Set selected bits
XOR / selective complement A←A⊕BA \leftarrow A \oplus B 0110 Toggle selected bits
Selective clear A←A∧B‾A \leftarrow A \land \overline{B} 0010 Reset where B = 1
NOT A←A‾A \leftarrow \overline{A} 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 A=partial remainderA = \text{partial remainder}, Q=quotient bits accumulatedQ = \text{quotient bits accumulated}.


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
N=(−1)S×(1.f)2×2E−127,Estored=Etrue+127N = (-1)^S \times (1.f)_2 \times 2^{E-127}, \qquad E_{\text{stored}} = E_{\text{true}} + 127

Special cases: E=0,f=0⇒±0E=0,f=0 \Rightarrow \pm0; E=255,f=0⇒±∞E=255,f=0 \Rightarrow \pm\infty; E=255,f≠0⇒E=255,f\neq0 \Rightarrow NaN.

7.2 Worked Conversion — (85.125)10(85.125)_{10}

85=1010101285 = 1010101_2, 0.125=0.00120.125 = 0.001_2, so 85.125=1010101.0012=1.0101010012×2685.125 = 1010101.001_2 = 1.010101001_2 \times 2^6.

  • S=0S = 0
  • E=6+127=133=100001012E = 6 + 127 = 133 = 10000101_2
  • fraction = 010101001010101001 followed by 14 zeros

Bit pattern: 0 10000101 01010100100000000000000

7.3 Worked Conversion — (−307.1875)10(-307.1875)_{10}

307=1001100112307 = 100110011_2, 0.1875=0.001120.1875 = 0.0011_2, so 307.1875=100110011.00112=1.0011001100112×28307.1875 = 100110011.0011_2 = 1.001100110011_2\times2^8.

  • S=1S = 1
  • E=8+127=135=100001112E = 8 + 127 = 135 = 10000111_2
  • fraction = 001100110011001100110011 + 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: 5.75+(−2.5)5.75 + (-2.5)

  • 5.75=101.112=1.01112×225.75 = 101.11_2 = 1.0111_2\times2^2; −2.5=−10.12=−1.012×21-2.5 = -10.1_2 = -1.01_2\times2^1.
  • Align: −1.012×21=−0.1012×22-1.01_2\times2^1 = -0.101_2\times2^2.
  • Add significands: 1.0111−0.1010=0.11011.0111 - 0.1010 = 0.1101, so the result is 0.11012×220.1101_2\times2^2.
  • Normalise: 1.1012×211.101_2\times2^1. True exponent E=1E=1, stored E=128=100000002E=128=10000000_2.
  • Result =3.25= 3.25, pattern 0 10000000 10100000000000000000000. ✓ (5.75−2.5=3.255.75-2.5=3.25)

Examiner Tip: Always write the true value beside each bit pattern (85.12585.125, −307.1875-307.1875, 3.253.25). 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 (5.75)10+(−2.5)10(5.75)_{10} + (-2.5)_{10}.

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) (85.125)10(85.125)_{10}\n(ii) (−307.1875)10(-307.1875)_{10}


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:

  1. Problem with ripple: each full adder must wait for CiC_i from the previous stage, so the carry path delay is O(n)O(n).
  2. Generate and propagate: Gi=AiBiG_i=A_iB_i produces a carry regardless of CiC_i; Pi=Ai⊕BiP_i=A_i\oplus B_i passes an incoming carry onward. Hence Ci+1=Gi+PiCiC_{i+1}=G_i+P_iC_i and Si=Pi⊕CiS_i=P_i\oplus C_i.
  3. Expansion for 4 bits:
C1=G0+P0C0,C2=G1+P1G0+P1P0C0C_1=G_0+P_0C_0,\quad C_2=G_1+P_1G_0+P_1P_0C_0 C3=G2+P2G1+P2P1G0+P2P1P0C0C_3=G_2+P_2G_1+P_2P_1G_0+P_2P_1P_0C_0 C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0C_4=G_3+P_3G_2+P_3P_2G_1+P_3P_2P_1G_0+P_3P_2P_1P_0C_0
  1. Design: four AND/XOR pairs form Gi,PiG_i,P_i; one look-ahead network forms C1…C4C_1\dots C_4; four XOR gates form SiS_i; C4C_4 is the carry-out.
  2. Delay: the carry network is two gate levels deep independent of bit position; group look-ahead extenders give O(log⁡n)O(\log n) for wider words.
  3. Trade-off: faster than ripple but with more gates and wiring.
  4. Conclusion: the CLA trades silicon area for speed by computing carries in parallel from AA, BB and C0C_0.

Solved Q2 (2025-26 Sec B Q2a — 7 Marks)

Q: Multiply the following numbers using Array Multiplier technique: A=1101A = 1101, B=1011B = 1011.

Solution:

  • A=11012=13A=1101_2=13, B=10112=11B=1011_2=11; expected product 143=100011112143=10001111_2.
  • Form partial products for each multiplier bit (LSB first):
bjb_j shifted multiplicand value
b0=1b_0=1 00001101 13
b1=1b_1=1 00011010 26
b2=0b_2=0 00000000 0
b3=1b_3=1 01101000 104
  • Column-sum: 13+26+0+104=14313+26+0+104 = 143.
  • Final 8-bit product: 10001111210001111_2.
  • Hardware note: each row is an AND-plane row; the adder array collapses the four rows into the product bits P7…P0P_7\dots P_0.

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: (−12)∗(−18)(-12) * (-18).

Solution:

  • M=−12=111101002M=-12=11110100_2, −M=+12=000011002-M=+12=00001100_2, Q=−18=111011102Q=-18=11101110_2, A=00000000A=00000000, Q−1=0Q_{-1}=0, count = 8.
Step Q0Q−1Q_0Q_{-1} Operation A (after op) A (after ASR) Q Q−1Q_{-1}
init — — 00000000 — 11101110 0
1 00 none 00000000 00000000 01110111 0
2 10 A←A−MA\leftarrow A-M 00001100 00000110 00111011 1
3 11 none 00000110 00000011 00011101 1
4 11 none 00000011 00000001 10001110 1
5 01 A←A+MA\leftarrow A+M 11110101 11111010 11000111 0
6 10 A←A−MA\leftarrow A-M 00000110 00000011 01100011 1
7 11 none 00000011 00000001 10110001 1
8 11 none 00000001 00000000 11011000 1
  • Final A,Q=00000000  11011000=+216A,Q = 00000000\;11011000 = +216.
  • Check: (−12)×(−18)=+216(-12)\times(-18)=+216, and 110110002=21611011000_2=216. ✓
  • 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 A×BA \times B where A=−5A = -5 and B=3B = 3 using Booth’s Algorithm.

Solution:

  • M=1011M=1011, −M=0101-M=0101, Q=0011Q=0011, A=0000A=0000, Q−1=0Q_{-1}=0, count = 4.
  • Step 1 (10): A=0101A=0101, ASR → A=0010A=0010, Q=1001Q=1001, Q−1=1Q_{-1}=1.
  • Step 2 (11): shift only → A=0001A=0001, Q=0100Q=0100, Q−1=1Q_{-1}=1.
  • Step 3 (01): A←A+M=1100A\leftarrow A+M = 1100, ASR → A=1110A=1110, Q=0010Q=0010, Q−1=0Q_{-1}=0.
  • Step 4 (00): shift only → A=1111A=1111, Q=0001Q=0001, Q−1=0Q_{-1}=0.
  • Product A,Q=111100012=−15A,Q = 11110001_2 = -15, which equals (−5)×3(-5)\times 3. ✓

Solved Q5 (2024-25 Sec C Q4a — 7 Marks)

Q: Explain floating point arithmetic operations. Perform floating point addition using IEEE 754 format for (5.75)10+(−2.5)10(5.75)_{10} + (-2.5)_{10}.

Solution:

  1. 5.75=101.112=1.01112×225.75 = 101.11_2 = 1.0111_2\times2^2 → S=0S=0, E=129=10000001E=129=10000001, f=0111000…f=0111000\ldots
  2. −2.5=−10.12=−1.012×21-2.5 = -10.1_2 = -1.01_2\times2^1 → S=1S=1, E=128=10000000E=128=10000000, f=0100000…f=0100000\ldots
  3. Align exponents: shift the smaller-exponent significand right by one bit → −0.1012×22-0.101_2\times2^2.
  4. Add significands: 1.0111+(−0.1010)=0.11011.0111 + (-0.1010) = 0.1101. Sign bit of result = 0 because the positive magnitude is larger.
  5. Normalise: 0.1101×22=1.1012×210.1101\times2^2 = 1.101_2\times2^1. No rounding needed.
  6. Re-bias: E=1+127=128=100000002E = 1+127 = 128 = 10000000_2; fraction =101=101 followed by 20 zeros.
  7. Result: 3.253.25, 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) (85.125)10(85.125)_{10}\n(ii) (−307.1875)10(-307.1875)_{10}

Solution:

  1. Rule: N=(−1)S(1.f)2 2E−127N=(-1)^S(1.f)_2\,2^{E-127}; write the binary, normalise, add 127 to the exponent, discard the leading 1.
  2. (i) 85.125=1010101.0012=1.0101010012×2685.125 = 1010101.001_2 = 1.010101001_2\times2^6. S=0S=0; E=133=10000101E=133=10000101; f=01010100100000000000000f=01010100100000000000000. Pattern: 0 10000101 01010100100000000000000.
  3. (ii) 307.1875=100110011.00112=1.0011001100112×28307.1875 = 100110011.0011_2 = 1.001100110011_2\times2^8. S=1S=1; E=135=10000111E=135=10000111; f=00110011001100000000000f=00110011001100000000000. Pattern: 1 10000111 00110011001100000000000.
  4. Check: de-normalising (i) gives 1.330078125×64=85.1251.330078125\times64=85.125; (ii) gives −1.199951171875×256=−307.1875-1.199951171875\times256=-307.1875. ✓

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:

  1. A ripple carry adder chains Ci+1=AiBi+(Ai⊕Bi)CiC_{i+1}=A_iB_i+(A_i\oplus B_i)C_i through nn full adders; the MSB result waits for nn carry propagations.
  2. Define Gi=AiBiG_i=A_iB_i and Pi=Ai⊕BiP_i=A_i\oplus B_i. Then Ci+1=Gi+PiCiC_{i+1}=G_i+P_iC_i depends only on operands and C0C_0.
  3. Expanded carries (write all four for a 4-bit adder): C1=G0+P0C0C_1=G_0+P_0C_0, C2=G1+P1G0+P1P0C0C_2=G_1+P_1G_0+P_1P_0C_0, C3=G2+P2G1+P2P1G0+P2P1P0C0C_3=G_2+P_2G_1+P_2P_1G_0+P_2P_1P_0C_0, C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0C_4=G_3+P_3G_2+P_3P_2G_1+P_3P_2P_1G_0+P_3P_2P_1P_0C_0.
  4. Si=Pi⊕CiS_i=P_i\oplus C_i.
  5. Advantages: delay independent of bit position within a group; hierarchical look-ahead scales as O(log⁡n)O(\log n); essential for fast ALUs.
  6. Disadvantages: larger gate count, more wiring and power; group logic grows for very wide words.
  7. 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 N=(−1)S×(1.f)2×2E−biasN=(-1)^S\times(1.f)_2\times2^{E-\text{bias}}. Its components are the sign bit SS, the exponent field EE (biased by 127 in single precision, giving true exponents from −126-126 to +127+127), and the fraction/mantissa ff (23 bits, with a hidden leading 1 for normalised numbers). This format trades exactness for a very large dynamic range.


Practice Questions (Self-Test)

  1. (2 Marks) Define carry-generate and carry-propagate and write the recurrence Ci+1C_{i+1}.
  2. (2 Marks) Name four types of multipliers and state the distinguishing feature of each.
  3. (7 Marks) Derive C4C_4 for a 4-bit carry-look-ahead adder and count the gate levels.
  4. (7 Marks) Multiply A=0111A=0111 by B=1101B=1101 using an array multiplier; show all partial products.
  5. (7 Marks) Use Booth's algorithm to compute 6×(−3)6\times(-3) with 4-bit words; give the full step table.
  6. (7 Marks) Convert (−19.625)10(-19.625)_{10} to IEEE 754 single precision.
  7. (7 Marks) Perform IEEE 754 addition 12.5+(−3.75)12.5 + (-3.75) and give the final 32-bit pattern.
  8. (7 Marks) Explain restoring division and work 13÷313\div3 with 4-bit registers.
  9. (2 Marks) With A=1100A=1100, B=1010B=1010, find A∧BA\land B, A∨BA\lor B and A⊕BA\oplus B.
  10. (7 Marks) Draw and label the ALU block diagram with two operand inputs, carry-in, operation select, result and the four status flags.