Skip to main content

Chapter 5 · 5 hours

Arithmetic Circuits

IOE past exam questions

Past questions and answers

16 questions set from this chapter, 1 of them more than once. Most asked first.

  • Asked 2 times
  • 2081 Baisakh · 5 marks
  • 2074 Chaitra · 3 marks

Design and explain the circuit to add the following bits 1011 and 1100 using block-diagrams.

Answer

Two 4-bit numbers are added with a 4-bit parallel (ripple-carry) adder: four full adders, one for each bit position, with the carry of each stage feeding the next. The first stage's carry-in is 0 (a half adder could be used there).

Let A=A3A2A1A0=1011A = A_3A_2A_1A_0 = 1011 and B=B3B2B1B0=1100B = B_3B_2B_1B_0 = 1100.

Block diagram

   A3 B3     A2 B2     A1 B1     A0 B0
   1  1      0  1      1  0      1  0
   |  |      |  |      |  |      |  |
  +-----+   +-----+   +-----+   +-----+
C4<| FA3 |<C3| FA2 |<C2| FA1 |<C1| FA0 |<-C0=0
  +-----+   +-----+   +-----+   +-----+
     |         |         |         |
     S3        S2        S1        S0

Each full adder computes

Si=Ai⊕Bi⊕Ci,Ci+1=AiBi+Ci(Ai⊕Bi)S_i = A_i \oplus B_i \oplus C_i, \qquad C_{i+1} = A_iB_i + C_i(A_i \oplus B_i)

Working, stage by stage

StageAiA_iBiB_iCiC_iSiS_iCi+1C_{i+1}
FA010010
FA110010
FA201010
FA311001
  1. FA0 adds the LSBs 1 + 0 with C0=0C_0 = 0: sum 1, carry 0.
  2. FA1 adds 1 + 0 + 0: sum 1, carry 0.
  3. FA2 adds 0 + 1 + 0: sum 1, carry 0.
  4. FA3 adds 1 + 1 + 0: sum 0, carry 1, which appears as C4C_4 (the fifth bit of the result).

Answer: 1011+1100=1011121011 + 1100 = 10111_2 (C4=1C_4 = 1, S3S2S1S0=0111S_3S_2S_1S_0 = 0111). Check: 11+12=23=10111211 + 12 = 23 = 10111_2.

All bits are applied at the same time (parallel), but the final result is valid only after the carry has rippled through all four stages. IC 7483/74283 is a ready-made 4-bit parallel adder.

  • 2081 Bhadra · 3 marks

Perform addition of (-65) and (+15) using signed 1's complement representation with the 8-bit format.

Answer

In signed 1's complement form a negative number is the 1's complement (all bits inverted) of its positive value; the MSB is the sign bit. An end-around carry, if produced, is added back to the LSB.

Step 1: Represent the numbers in 8 bits

+65=0100 0001−65=1011 1110(1’s complement)+15=0000 1111\begin{aligned} +65 &= 0100\,0001 \\ -65 &= 1011\,1110 \quad (\text{1's complement}) \\ +15 &= 0000\,1111 \end{aligned}

Step 2: Add

   1011 1110   (-65)
 + 0000 1111   (+15)
 -----------
   1100 1101

There is no end-around carry out of the MSB, so the result is already in final form. The sign bit is 1, so the result is negative and is in 1's complement form.

Step 3: Find the magnitude

1100 1101‾=0011 0010=32+16+2=50\overline{1100\,1101} = 0011\,0010 = 32 + 16 + 2 = 50

Answer: (−65)+(+15)=1100 1101(-65) + (+15) = 1100\,1101 in 8-bit signed 1's complement, which is −50-50. Check: −65+15=−50-65 + 15 = -50. No overflow, because the operands have opposite signs.

  • 2076 Asoj · 5 marks

Explain the operation of two 4-bit parallel adder with neat diagram.

Answer

A 4-bit parallel adder adds two 4-bit binary numbers A=A3A2A1A0A = A_3A_2A_1A_0 and B=B3B2B1B0B = B_3B_2B_1B_0 at the same time. It uses four full adders connected in cascade: the carry-out of each full adder is the carry-in of the next higher stage. It is also called a ripple-carry adder (IC 7483 / 74283).

Diagram

  A3 B3      A2 B2      A1 B1      A0 B0
   | |        | |        | |        | |
 +-----+    +-----+    +-----+    +-----+
 | FA3 |<C3-| FA2 |<C2-| FA1 |<C1-| FA0 |<- C0
 +-----+    +-----+    +-----+    +-----+
  |   |        |          |          |
 C4   S3       S2         S1         S0

Each full adder gives

Si=Ai⊕Bi⊕Ci,Ci+1=AiBi+BiCi+AiCiS_i = A_i \oplus B_i \oplus C_i, \qquad C_{i+1} = A_iB_i + B_iC_i + A_iC_i

Operation

  1. All bits of A and B are applied to the full adders at the same time; C0C_0 is normally 0.
  2. FA0 adds A0A_0, B0B_0, C0C_0 and gives S0S_0 and C1C_1.
  3. C1C_1 goes to FA1, which then gives S1S_1 and C2C_2, and so on.
  4. FA3 gives S3S_3 and the final carry C4C_4, which is the fifth bit of the sum.
  5. The output C4S3S2S1S0C_4S_3S_2S_1S_0 is valid only after the carry has passed through all stages.

Example: A=0110 (6)A = 0110\ (6), B=0111 (7)B = 0111\ (7):

StageAiA_iBiB_iCiC_iSiS_iCi+1C_{i+1}
001010
111001
211111
300110

Result C4S3S2S1S0=01101=13C_4S_3S_2S_1S_0 = 01101 = 13.

Cascading two 4-bit adders

Two such 4-bit adders give an 8-bit adder: C4C_4 of the lower adder (bits 0–3) is connected to C0C_0 of the upper adder (bits 4–7).

Limitation: carry propagation delay. In the worst case the carry passes through every stage, so delay ≈n×tcarry\approx n \times t_{carry}. A carry look-ahead adder removes this.

  • 2072 Chaitra · 2 marks

Perform (10.001)₂ - (11.101)₂ using 2's complement method.

Answer

To find A−BA - B by 2's complement: add the 2's complement of BB to AA. If an end carry occurs, drop it and the result is positive. If no end carry occurs, the result is negative: take the 2's complement of the sum and put a minus sign.

Make both numbers the same length: A=10.001A = 10.001, B=11.101B = 11.101.

Step 1: 2's complement of B

1’s complement of 11.101=00.010add 1 at LSB=00.010+00.001=00.011\begin{aligned} \text{1's complement of } 11.101 &= 00.010 \\ \text{add 1 at LSB} &= 00.010 + 00.001 = 00.011 \end{aligned}

Step 2: Add to A

   10.001
 + 00.011
 --------
   10.100    (no end carry)

Step 3: No end carry, so the answer is negative. Take the 2's complement of 10.100:

1’s complement=01.011+ 0.001=01.100\begin{aligned} \text{1's complement} &= 01.011 \\ +\,0.001 &= 01.100 \end{aligned}

Answer: (10.001)2−(11.101)2=−(1.1)2(10.001)_2 - (11.101)_2 = -(1.1)_2

Check in decimal: 2.125−3.625=−1.5=−(1.1)22.125 - 3.625 = -1.5 = -(1.1)_2.

  • 2070 Chaitra · 2+2 marks

When FFH is ANDed with C0H what will be the resulting number? Subtract (26)₁₀ from (16)₁₀ using 2's complement binary method.

Answer

FFH AND C0H

AND each bit pair:

 FFH = 1111 1111
 C0H = 1100 0000
 AND = 1100 0000

Answer: FFH⋅C0H=C0HFF_H \cdot C0_H = C0_H. (ANDing with FFHFF_H leaves the other number unchanged.)

(16)₁₀ − (26)₁₀ by 2's complement (8-bit)

16=0001 000026=0001 10102’s complement of 26=1110 0101+1=1110 0110\begin{aligned} 16 &= 0001\,0000 \\ 26 &= 0001\,1010 \\ \text{2's complement of } 26 &= 1110\,0101 + 1 = 1110\,0110 \end{aligned}
   0001 0000   (+16)
 + 1110 0110   (-26)
 -----------
   1111 0110   (no end carry)

No end carry, so the result is negative. Its magnitude is the 2's complement of the sum:

1111 0110‾+1=0000 1001+1=0000 1010=10\overline{1111\,0110} + 1 = 0000\,1001 + 1 = 0000\,1010 = 10

Answer: 16−26=1111 011016 - 26 = 1111\,0110 (2's complement form) =−10= -10.

  • 2069 Chaitra · 8 marks

Design a combinational logic that performs multiplication between two 4 bit numbers using binary parallel adder and other gates.

Answer

A binary multiplier multiplies two numbers by forming partial products with AND gates and adding them with binary parallel adders (BPA), in the same way as long multiplication by hand.

Let A=A3A2A1A0A = A_3A_2A_1A_0 (multiplicand) and B=B3B2B1B0B = B_3B_2B_1B_0 (multiplier). The product has 4+4=84 + 4 = 8 bits, P7…P0P_7 \dots P_0.

Partial products

                    A3   A2   A1   A0
                  x B3   B2   B1   B0
 ------------------------------------
                  A3B0 A2B0 A1B0 A0B0
             A3B1 A2B1 A1B1 A0B1
        A3B2 A2B2 A1B2 A0B2
   A3B3 A2B3 A1B3 A0B3
 ------------------------------------
 P7  P6   P5   P4   P3   P2   P1   P0

Each partial-product bit AjBiA_jB_i is one 2-input AND gate, so 16 AND gates are needed. Adding the four rows needs three 4-bit parallel adders.

Design

  1. Row 0: A3B0 A2B0 A1B0 A0B0A_3B_0\,A_2B_0\,A_1B_0\,A_0B_0. Its LSB A0B0A_0B_0 is directly P0P_0.
  2. Adder 1: adds row 1 (A3B1…A0B1A_3B_1 \dots A_0B_1) to the upper three bits of row 0 (0,A3B0,A2B0,A1B00, A_3B_0, A_2B_0, A_1B_0). Its sum LSB is P1P_1; its carry and upper three sum bits go on.
  3. Adder 2: adds row 2 (A3B2…A0B2A_3B_2 \dots A_0B_2) to (carry of adder 1, upper three sum bits of adder 1). Its sum LSB is P2P_2.
  4. Adder 3: adds row 3 (A3B3…A0B3A_3B_3 \dots A_0B_3) to (carry of adder 2, upper three sum bits of adder 2). Its four sum bits give P6P5P4P3P_6P_5P_4P_3 and its carry gives P7P_7.
 A x B0 (4 AND) -> [b3 b2 b1 | b0=P0]
                     |
 A x B1 (4 AND) -> [ 4-bit BPA #1 ] -> s0 = P1
                     | carry + s3 s2 s1
 A x B2 (4 AND) -> [ 4-bit BPA #2 ] -> s0 = P2
                     | carry + s3 s2 s1
 A x B3 (4 AND) -> [ 4-bit BPA #3 ] -> s0 = P3
                     |
               Cout=P7, s3 s2 s1 = P6 P5 P4

Each adder's carry-in C0=0C_0 = 0.

Example: 1101×10111101 \times 1011 (13 × 11)

StepOperationResultProduct bit
Row 0A⋅B0=1101A \cdot B_0 = 1101upper bits 0110P0=1P_0 = 1
Adder 10110+11010110 + 1101 (A⋅B1A\cdot B_1)1 0011P1=1P_1 = 1, pass 1001
Adder 21001+00001001 + 0000 (A⋅B2A\cdot B_2)0 1001P2=1P_2 = 1, pass 0100
Adder 30100+11010100 + 1101 (A⋅B3A\cdot B_3)1 0001P3=1P_3 = 1, P7P6P5P4=1000P_7P_6P_5P_4 = 1000

Product =1000 11112=143= 1000\,1111_2 = 143, and 13×11=14313 \times 11 = 143.

Hardware: 16 AND gates and three 4-bit parallel adders (e.g. three IC 7483). In general an n×mn \times m-bit multiplier needs n⋅mn \cdot m AND gates and (m−1)(m-1) nn-bit adders.

  • 2068 Chaitra · 8 marks

Draw the block diagram of n-bit full adder and explain its operation.

Answer

An n-bit full adder (n-bit parallel adder) adds two n-bit binary numbers A=An−1…A1A0A = A_{n-1}\dots A_1A_0 and B=Bn−1…B1B0B = B_{n-1}\dots B_1B_0 plus an input carry C0C_0. It is made by cascading nn one-bit full adders: the carry output of each stage is connected to the carry input of the next higher stage.

Block diagram

 A(n-1)B(n-1)     A2 B2      A1 B1      A0 B0
    |  |          |  |       |  |       |  |
 +--------+    +------+   +------+   +------+
 | FA n-1 |<...| FA2  |<--| FA1  |<--| FA0  |<-C0
 +--------+ C3 +------+ C2+------+ C1+------+
   |    |         |          |          |
  Cn   S(n-1)     S2         S1         S0

One stage (full adder)

Si=Ai⊕Bi⊕CiS_i = A_i \oplus B_i \oplus C_i Ci+1=AiBi+Ci(Ai⊕Bi)C_{i+1} = A_iB_i + C_i(A_i \oplus B_i)
AiA_iBiB_iCiC_iSiS_iCi+1C_{i+1}
00000
00110
01010
01101
10010
10101
11001
11111

Operation

  1. All 2n2n input bits are applied at the same time (parallel inputs). C0C_0 is 0 for plain addition (it is set to 1 for 2's complement subtraction).
  2. FA0 adds A0A_0, B0B_0, C0C_0 and gives S0S_0 and C1C_1.
  3. C1C_1 enters FA1, which produces S1S_1 and C2C_2; the carry ripples stage by stage to the left.
  4. The last stage gives Sn−1S_{n-1} and the final carry CnC_n. The result is the (n+1)(n+1)-bit number CnSn−1…S0C_nS_{n-1}\dots S_0.

Example (n = 4): A=1001 (9)A = 1001\ (9), B=0111 (7)B = 0111\ (7), C0=0C_0 = 0:

StageAiA_iBiB_iCiC_iSiS_iCi+1C_{i+1}
011001
101101
201101
310101

Result =1 0000=16= 1\,0000 = 16.

Timing and expansion

  • Each stage must wait for the carry from the previous stage, so the worst-case delay is about n⋅tcn \cdot t_c (where tct_c is the carry delay of one full adder). This carry propagation delay grows with nn.
  • Larger adders are built by cascading 4-bit adder ICs (7483/74283): C4C_4 of one IC goes to C0C_0 of the next.
  • For high speed, the carry chain is replaced by a carry look-ahead generator, which forms all carries directly from Gi=AiBiG_i = A_iB_i and Pi=Ai⊕BiP_i = A_i \oplus B_i.
  • With XOR gates on the B inputs and C0=1C_0 = 1, the same circuit works as an n-bit subtractor (adder/subtractor).
  • 2068 Baisakh · 4+2+2 marks

Draw the circuit of 4 bit RCA (Ripple Carry Adder), using only block diagrams. What are the problems associated with RCA. Explain how these problems can be eliminated.

Answer

A ripple carry adder (RCA) is a parallel adder made of full adders in cascade, where the carry out of each stage is the carry in of the next, so the carry "ripples" from LSB to MSB.

4-bit RCA (block diagram)

  A3 B3      A2 B2      A1 B1      A0 B0
   | |        | |        | |        | |
 +-----+    +-----+    +-----+    +-----+
 | FA3 |<C3-| FA2 |<C2-| FA1 |<C1-| FA0 |<- C0
 +-----+    +-----+    +-----+    +-----+
  |   |        |          |          |
 C4   S3       S2         S1         S0
Si=Ai⊕Bi⊕Ci,Ci+1=AiBi+Ci(Ai⊕Bi)S_i = A_i \oplus B_i \oplus C_i, \qquad C_{i+1} = A_iB_i + C_i(A_i \oplus B_i)

Problems with RCA

  1. Carry propagation delay: stage ii cannot give a correct sum until CiC_i arrives. In the worst case (e.g. 1111+00011111 + 0001) the carry passes through all stages, so the total delay is about n×tcarryn \times t_{carry}. For a 32-bit adder this is very slow.
  2. Delay grows linearly with word length, so the RCA limits the speed of the ALU and processor clock.
  3. Glitches: outputs change several times while the carry ripples, giving temporary wrong values and extra power use.

Eliminating the problems: carry look-ahead adder (CLA)

The CLA generates every carry directly from the inputs, without waiting for the previous stage. Define for each bit

Gi=AiBi (generate),Pi=Ai⊕Bi (propagate)G_i = A_iB_i \ (\text{generate}), \qquad P_i = A_i \oplus B_i \ (\text{propagate})

Then Ci+1=Gi+PiCiC_{i+1} = G_i + P_iC_i. Expanding:

C1=G0+P0C0C2=G1+P1G0+P1P0C0C3=G2+P2G1+P2P1G0+P2P1P0C0C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0\begin{aligned} C_1 &= G_0 + P_0C_0 \\ C_2 &= G_1 + P_1G_0 + P_1P_0C_0 \\ C_3 &= G_2 + P_2G_1 + P_2P_1G_0 + P_2P_1P_0C_0 \\ C_4 &= G_3 + P_3G_2 + P_3P_2G_1 + P_3P_2P_1G_0 + P_3P_2P_1P_0C_0 \end{aligned} Si=Pi⊕CiS_i = P_i \oplus C_i
 A,B -> [P,G gen] -> [Carry look-ahead] -> C1..C4
             |                               |
             +---------> [XOR: S = P xor C] <+

All carries are two-level AND-OR functions of GG, PP and C0C_0, so every carry appears after a fixed delay (about 2 gate delays after PP, GG), independent of nn. IC 74182 is a carry look-ahead generator. Other methods: carry-select and carry-skip adders, and grouping 4-bit CLA blocks with a second level of look-ahead for wide adders.

  • 2082 Baisakh · 5 marks

Design a combinational circuit whose input is 4-bit number and output is 2's complement of input number.

Answer

The circuit takes a 4-bit number A3A2A1A0A_3A_2A_1A_0 and gives Y3Y2Y1Y0Y_3Y_2Y_1Y_0 = its 2's complement (A‾+1\overline{A} + 1, keeping 4 bits).

Truth table

A3A2A1A0A_3A_2A_1A_0Y3Y2Y1Y0Y_3Y_2Y_1Y_0A3A2A1A0A_3A_2A_1A_0Y3Y2Y1Y0Y_3Y_2Y_1Y_0
0000000010001000
0001111110010111
0010111010100110
0011110110110101
0100110011000100
0101101111010011
0110101011100010
0111100111110001

Simplified expressions

From K-maps (or from the rule "copy bits up to and including the first 1 from the right, then invert the rest"):

  • Y0=1Y_0 = 1 for odd numbers only: Y0=A0Y_0 = A_0
  • Y1=1Y_1 = 1 for 01, 10 in A1A0A_1A_0: Y1=A1⊕A0Y_1 = A_1 \oplus A_0
  • Y2Y_2 equals A2A_2 when A1A0=00A_1A_0 = 00, else A2′A_2': Y2=A2⊕(A1+A0)Y_2 = A_2 \oplus (A_1 + A_0)
  • Y3Y_3 equals A3A_3 when A2A1A0=000A_2A_1A_0 = 000, else A3′A_3': Y3=A3⊕(A2+A1+A0)Y_3 = A_3 \oplus (A_2 + A_1 + A_0)
Y0=A0Y1=A1⊕A0Y2=A2⊕(A1+A0)Y3=A3⊕(A2+A1+A0)\begin{aligned} Y_0 &= A_0 \\ Y_1 &= A_1 \oplus A_0 \\ Y_2 &= A_2 \oplus (A_1 + A_0) \\ Y_3 &= A_3 \oplus (A_2 + A_1 + A_0) \end{aligned}

Circuit

A0 ------------------------------> Y0
A1, A0 ----------[XOR]-----------> Y1
A1, A0 --[OR]--> X1 = A1+A0
A2, X1 ----------[XOR]-----------> Y2
A2, X1 --[OR]--> X2 = A2+A1+A0
A3, X2 ----------[XOR]-----------> Y3

Gates: 3 XOR and 2 OR gates (the second OR adds A2A_2 to the first OR output).

Check: A=0110A = 0110: Y0=0Y_0 = 0, Y1=1⊕0=1Y_1 = 1\oplus0 = 1, Y2=1⊕1=0Y_2 = 1\oplus1 = 0, Y3=0⊕1=1Y_3 = 0\oplus1 = 1, so Y=1010Y = 1010, and 16−6=10=101016 - 6 = 10 = 1010. Correct.

(Alternative: invert each bit with NOT gates and add 1 using a 4-bit parallel adder with C0=1C_0 = 1.)

  • 2081 Bhadra · 5+4 marks

Design half adder and half subtractor in a single circuit. Perform following operation: a) (47)₁₀ - (26)₁₀ subtraction using 2's complement method. b) (10010)₂ - (10011)₂ using 1's complement method.

Answer

Half adder and half subtractor in one circuit

Inputs AA, BB. Outputs: sum SS, carry CC, difference DD, borrow BoB_o (A−BA - B).

ABSCDBoB_o
000000
011011
101010
110100
S=D=A⊕B,C=AB,Bo=A′BS = D = A \oplus B, \qquad C = AB, \qquad B_o = A'B

The sum and difference are the same function, so one XOR gate serves both. Add one AND gate for CC and one NOT plus one AND gate for BoB_o.

A --+--------------[XOR]---+--> S (= D)
B --|--+-----------[   ]   |
    |  |
    +--|-----------[AND]------> C
    |  +-----------[   ]
    |  |
    +-[NOT]--A'----[AND]------> Bo
       +-----------[   ]

Total: 1 XOR, 2 AND, 1 NOT.

(If one output pair with a mode input MM is preferred: S/D=A⊕BS/D = A \oplus B, C/Bo=(A⊕M)BC/B_o = (A \oplus M)B, giving carry when M=0M=0 and borrow when M=1M=1.)

a) (47)₁₀ − (26)₁₀ by 2's complement (8-bit)

47=0010 111126=0001 10102’s complement of 26=1110 0101+1=1110 0110\begin{aligned} 47 &= 0010\,1111 \\ 26 &= 0001\,1010 \\ \text{2's complement of } 26 &= 1110\,0101 + 1 = 1110\,0110 \end{aligned}
    0010 1111   (+47)
  + 1110 0110   (-26)
  -----------
  1 0001 0101

An end carry occurs: discard it. The result is positive.

Answer: 0001 01012=16+4+1=210001\,0101_2 = 16 + 4 + 1 = 21. Check: 47−26=2147 - 26 = 21.

b) (10010)₂ − (10011)₂ by 1's complement

1’s complement of 10011=01100\text{1's complement of } 10011 = 01100
   10010
 + 01100
 -------
   11110   (no end-around carry)

No end carry, so the result is negative; take its 1's complement:

11110‾=00001\overline{11110} = 00001

Answer: (10010)2−(10011)2=−(00001)2=−1(10010)_2 - (10011)_2 = -(00001)_2 = -1. Check: 18−19=−118 - 19 = -1.

  • 2081 Bhadra · 5 marks

Design a full subtractor circuit using half subtractors and one OR gate.

Answer

A full subtractor subtracts BB and a borrow-in BinB_{in} from AA, giving difference DD and borrow-out BoB_o. A half subtractor subtracts YY from XX: D=X⊕YD = X \oplus Y, B=X′YB = X'Y.

Truth table and expressions

ABBinB_{in}DBoB_o
00000
00111
01011
01101
10010
10100
11000
11111
D=A⊕B⊕BinD = A \oplus B \oplus B_{in} Bo=A′B′Bin+A′BBin′+A′BBin+ABBin=A′B(Bin′+Bin)+Bin(A′B′+AB)=A′B+(A⊕B)′ Bin\begin{aligned} B_o &= A'B'B_{in} + A'BB_{in}' + A'BB_{in} + ABB_{in} \\ &= A'B(B_{in}' + B_{in}) + B_{in}(A'B' + AB) \\ &= A'B + (A \oplus B)'\,B_{in} \end{aligned}

Using two half subtractors and one OR gate

  • HS1 with inputs AA, BB: D1=A⊕BD_1 = A \oplus B, B1=A′BB_1 = A'B.
  • HS2 with inputs D1D_1, BinB_{in}: D=D1⊕Bin=A⊕B⊕BinD = D_1 \oplus B_{in} = A \oplus B \oplus B_{in}, B2=D1′Bin=(A⊕B)′BinB_2 = D_1'B_{in} = (A \oplus B)'B_{in}.
  • OR gate: Bo=B1+B2=A′B+(A⊕B)′BinB_o = B_1 + B_2 = A'B + (A \oplus B)'B_{in}, which matches the expression above.
        +-----+  D1   +-----+
A ----->| HS1 |------>| HS2 |----------> D
B ----->|     |  Bin->|     |
        +-----+       +-----+
           | B1          | B2
           +---->[OR]<---+
                   |
                   +-----------------> Bo

Check: A=0,B=1,Bin=1A=0, B=1, B_{in}=1: HS1 gives D1=1D_1 = 1, B1=1B_1 = 1; HS2 gives D=0D = 0, B2=0B_2 = 0; Bo=1B_o = 1. So 0−1−1=−20 - 1 - 1 = -2, i.e. D=0D = 0 with borrow 1. Correct.

  • 2078 Bhadra · 6 marks

Design a 3 bit binary multiplier using binary parallel adder (BPA).

Answer

A 3-bit binary multiplier multiplies A=A2A1A0A = A_2A_1A_0 by B=B2B1B0B = B_2B_1B_0 to give a 6-bit product P5…P0P_5\dots P_0. Partial products are made with AND gates and added with binary parallel adders (BPA).

Partial products

               A2    A1    A0
             x B2    B1    B0
 -----------------------------
               A2B0  A1B0  A0B0
         A2B1  A1B1  A0B1
   A2B2  A1B2  A0B2
 -----------------------------
 P5 P4   P3    P2    P1    P0
  • 3×3=93 \times 3 = 9 AND gates make the partial-product bits.
  • Two 3-bit parallel adders add the three rows.

Design steps

  1. P0=A0B0P_0 = A_0B_0 directly.
  2. Adder 1 (3-bit): adds row 1 (A2B1,A1B1,A0B1A_2B_1, A_1B_1, A_0B_1) to (0,A2B0,A1B00, A_2B_0, A_1B_0). LSB of its sum gives P1P_1.
  3. Adder 2 (3-bit): adds row 2 (A2B2,A1B2,A0B2A_2B_2, A_1B_2, A_0B_2) to (carry of adder 1, upper two sum bits of adder 1). LSB gives P2P_2, the next two sum bits give P3P4P_3P_4, and its carry is P5P_5.
 A2B0 A1B0  A0B0 -----------------------> P0
  |    |
  0  A2B0 A1B0 + A2B1 A1B1 A0B1
       [ 3-bit BPA #1 ] --- S0 --------> P1
        C, S2, S1
           +   A2B2 A1B2 A0B2
       [ 3-bit BPA #2 ] --- S0 --------> P2
        C   S2   S1
        |    |    +--------------------> P3
        |    +-------------------------> P4
        +------------------------------> P5

Both adders have carry-in =0= 0.

Example: 101×011101 \times 011 (5 × 3)

StepOperationResultProduct bit
Row 0A⋅B0=101A\cdot B_0 = 101pass 010P0=1P_0 = 1
Adder 1010+101010 + 101 (A⋅B1A\cdot B_1)0 111P1=1P_1 = 1, pass 011
Adder 2011+000011 + 000 (A⋅B2A\cdot B_2)0 011P2=1P_2 = 1, P5P4P3=001P_5P_4P_3 = 001

Product =0011112=15= 001111_2 = 15, and 5×3=155 \times 3 = 15.

Hardware needed: 9 AND gates and two 3-bit parallel adders (or two 4-bit adders such as IC 7483 with the top bit tied to 0).

  • 2078 Kartik · 5+2 marks

Define and design 2-bit binary fast adder. Draw the circuit diagram of full subtractor using half subtractor.

Answer

2-bit binary fast adder

A fast adder (carry look-ahead adder) is a parallel adder in which all carries are produced directly from the input bits and the input carry, instead of waiting for the carry to ripple through each stage. This makes the addition time almost independent of the number of bits.

For each bit:

Gi=AiBi (carry generate),Pi=Ai⊕Bi (carry propagate)G_i = A_iB_i \ (\text{carry generate}), \qquad P_i = A_i \oplus B_i \ (\text{carry propagate})

Carries for 2 bits (A1A0+B1B0+C0A_1A_0 + B_1B_0 + C_0):

C1=G0+P0C0C2=G1+P1C1=G1+P1G0+P1P0C0\begin{aligned} C_1 &= G_0 + P_0C_0 \\ C_2 &= G_1 + P_1C_1 = G_1 + P_1G_0 + P_1P_0C_0 \end{aligned}

Sums:

S0=P0⊕C0,S1=P1⊕C1S_0 = P_0 \oplus C_0, \qquad S_1 = P_1 \oplus C_1
A0,B0 -[XOR]-P0   -[AND]-G0
A1,B1 -[XOR]-P1   -[AND]-G1

C1 = G0 + P0.C0           (1 AND, 1 OR)
C2 = G1 + P1.G0 + P1.P0.C0 (2 AND, 1 OR)

S0 = P0 xor C0 ; S1 = P1 xor C1  (2 XOR)
C2 is the output carry.

Since C2C_2 comes from a two-level AND–OR circuit, it is ready after the same delay as C1C_1.

Full subtractor using half subtractors

D=A⊕B⊕Bin,Bo=A′B+(A⊕B)′BinD = A \oplus B \oplus B_{in}, \qquad B_o = A'B + (A \oplus B)'B_{in}
  • HS1 (AA, BB): D1=A⊕BD_1 = A \oplus B, B1=A′BB_1 = A'B
  • HS2 (D1D_1, BinB_{in}): D=D1⊕BinD = D_1 \oplus B_{in}, B2=D1′BinB_2 = D_1'B_{in}
  • Bo=B1+B2B_o = B_1 + B_2 (one OR gate)
A --->[ HS1 ]--D1-->[ HS2 ]----------> D
B --->[     ]  Bin->[     ]
         |B1           |B2
         +----->[OR]<--+
                  +------------------> Bo
  • 2076 Asoj

Explain 2-bit fast Adder with its logical diagram and write the advantage of fast Adder.

Answer

A fast adder (carry look-ahead adder, CLA) is a parallel adder that produces the carries for all bit positions at the same time, directly from the inputs, instead of letting the carry ripple from stage to stage.

Principle

For bit ii:

  • Carry generate Gi=AiBiG_i = A_iB_i: a carry is produced regardless of CiC_i.
  • Carry propagate Pi=Ai⊕BiP_i = A_i \oplus B_i: an incoming carry is passed on.
Ci+1=Gi+PiCi,Si=Pi⊕CiC_{i+1} = G_i + P_iC_i, \qquad S_i = P_i \oplus C_i

2-bit fast adder

C1=G0+P0C0C2=G1+P1G0+P1P0C0S0=P0⊕C0S1=P1⊕C1\begin{aligned} C_1 &= G_0 + P_0C_0 \\ C_2 &= G_1 + P_1G_0 + P_1P_0C_0 \\ S_0 &= P_0 \oplus C_0 \\ S_1 &= P_1 \oplus C_1 \end{aligned}

Logic diagram

A0 B0 --+--[XOR]--> P0
        +--[AND]--> G0
A1 B1 --+--[XOR]--> P1
        +--[AND]--> G1

P0,C0 ----[AND]--+
G0 --------------+--[OR]--> C1

P1,G0 ----[AND]--+
P1,P0,C0 -[AND]--+--[OR]--> C2 (carry out)
G1 --------------+

P0,C0 --[XOR]--> S0
P1,C1 --[XOR]--> S1

Working: the P and G signals appear after one gate delay; C1C_1 and C2C_2 appear after two more gate delays (AND then OR); the sums after one more XOR delay. C2C_2 does not wait for C1C_1.

Example: A=11A = 11, B=01B = 01, C0=0C_0 = 0: G0=1,P0=0,G1=0,P1=1G_0 = 1, P_0 = 0, G_1 = 0, P_1 = 1; C1=1C_1 = 1, C2=0+1⋅1+0=1C_2 = 0 + 1\cdot1 + 0 = 1; S0=0S_0 = 0, S1=1⊕1=0S_1 = 1 \oplus 1 = 0. Result C2S1S0=100=4C_2S_1S_0 = 100 = 4 (3 + 1). Correct.

Advantages of a fast adder

  1. Much higher speed: carry delay is constant (about 3–4 gate delays), not nn times one stage delay as in a ripple adder.
  2. Delay does not grow with word length within a block, so it suits fast ALUs.
  3. Blocks can be cascaded with a second level of look-ahead (IC 74182) for wide adders.
  4. Output settles quickly, with fewer glitches.

(Cost: more gates and gates with many inputs, so very wide single-level CLAs are impractical.)

  • 2076 Asoj

Write a short note on binary parallel adder.

Answer

A binary parallel adder is a combinational circuit that adds two n-bit binary numbers with all bits applied at the same time. It is made of nn full adders in cascade; the carry output of each full adder goes to the carry input of the next higher stage.

  A3 B3      A2 B2      A1 B1      A0 B0
 +-----+    +-----+    +-----+    +-----+
 | FA3 |<C3-| FA2 |<C2-| FA1 |<C1-| FA0 |<- C0
 +-----+    +-----+    +-----+    +-----+
  |   |        |          |          |
 C4   S3       S2         S1         S0

Each stage: Si=Ai⊕Bi⊕CiS_i = A_i \oplus B_i \oplus C_i, Ci+1=AiBi+Ci(Ai⊕Bi)C_{i+1} = A_iB_i + C_i(A_i \oplus B_i).

Operation: FA0 adds the LSBs with C0C_0 (0 for plain addition); its carry goes to FA1, and so on. The result is C4S3S2S1S0C_4S_3S_2S_1S_0. Example: 0101+0011=010000101 + 0011 = 01000 (5 + 3 = 8).

Features and uses:

  • IC 7483/74283 is a 4-bit binary parallel adder; ICs are cascaded (C4C_4 to next C0C_0) for 8, 12, 16 bits.
  • With XOR gates on B and C0=1C_0 = 1 it becomes an adder/subtractor (2's complement).
  • Used in multipliers, BCD adders and the ALU.

Limitation: carry propagation (ripple) delay; worst-case delay is n×n \times one-stage carry delay. A carry look-ahead adder overcomes this.

  • 2075 Chaitra · 4 marks

Construct Full Adder using half Adder.

Answer

A full adder adds three bits AA, BB, CinC_{in} and gives sum SS and carry CoutC_{out}. A half adder adds two bits: S=X⊕YS = X \oplus Y, C=XYC = XY.

Full adder expressions

ABCinC_{in}SCoutC_{out}
00000
00110
01010
01101
10010
10101
11001
11111
S=A⊕B⊕CinS = A \oplus B \oplus C_{in} Cout=A′BCin+AB′Cin+ABCin′+ABCin=AB+Cin(A′B+AB′)=AB+Cin(A⊕B)\begin{aligned} C_{out} &= A'BC_{in} + AB'C_{in} + ABC_{in}' + ABC_{in} \\ &= AB + C_{in}(A'B + AB') = AB + C_{in}(A \oplus B) \end{aligned}

Construction with two half adders and an OR gate

  • HA1 (AA, BB): S1=A⊕BS_1 = A \oplus B, C1=ABC_1 = AB
  • HA2 (S1S_1, CinC_{in}): S=S1⊕Cin=A⊕B⊕CinS = S_1 \oplus C_{in} = A \oplus B \oplus C_{in}, C2=Cin(A⊕B)C_2 = C_{in}(A \oplus B)
  • OR: Cout=C1+C2=AB+Cin(A⊕B)C_{out} = C_1 + C_2 = AB + C_{in}(A \oplus B)
       +-----+  S1   +-----+
A ---->| HA1 |------>| HA2 |-----------> S
B ---->|     | Cin ->|     |
       +-----+       +-----+
          | C1          | C2
          +---->[OR]<---+
                  +--------------------> Cout

Check: A=1,B=0,Cin=1A=1, B=0, C_{in}=1: S1=1,C1=0S_1 = 1, C_1 = 0; S=0,C2=1S = 0, C_2 = 1; Cout=1C_{out} = 1. So 1+0+1=1021+0+1 = 10_2. Correct.

Questions from Old Question Collection (EX 502) (IOE EX 502 exam papers (BEL/BEX/BCT II/I) from 2068 to 2081) and Old Question Collection (BEI, EX 401) (IOE EX 401 exam papers (BEI I/I) from 2075 to 2082). Answers are written for this site; check them against your class notes.

Chapter titles and hours from the IOE syllabus ↗