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 and .
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
Working, stage by stage
| Stage | |||||
|---|---|---|---|---|---|
| FA0 | 1 | 0 | 0 | 1 | 0 |
| FA1 | 1 | 0 | 0 | 1 | 0 |
| FA2 | 0 | 1 | 0 | 1 | 0 |
| FA3 | 1 | 1 | 0 | 0 | 1 |
- FA0 adds the LSBs 1 + 0 with : sum 1, carry 0.
- FA1 adds 1 + 0 + 0: sum 1, carry 0.
- FA2 adds 0 + 1 + 0: sum 1, carry 0.
- FA3 adds 1 + 1 + 0: sum 0, carry 1, which appears as (the fifth bit of the result).
Answer: (, ). Check: .
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
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
Answer: in 8-bit signed 1's complement, which is . Check: . 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 and 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
Operation
- All bits of A and B are applied to the full adders at the same time; is normally 0.
- FA0 adds , , and gives and .
- goes to FA1, which then gives and , and so on.
- FA3 gives and the final carry , which is the fifth bit of the sum.
- The output is valid only after the carry has passed through all stages.
Example: , :
| Stage | |||||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 1 | 1 | 1 | 1 | 1 |
| 3 | 0 | 0 | 1 | 1 | 0 |
Result .
Cascading two 4-bit adders
Two such 4-bit adders give an 8-bit adder: of the lower adder (bits 0–3) is connected to of the upper adder (bits 4–7).
Limitation: carry propagation delay. In the worst case the carry passes through every stage, so delay . A carry look-ahead adder removes this.
- 2072 Chaitra · 2 marks
Perform (10.001)₂ - (11.101)₂ using 2's complement method.
Answer
To find by 2's complement: add the 2's complement of to . 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: , .
Step 1: 2's complement of B
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:
Answer:
Check in decimal: .
- 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: . (ANDing with leaves the other number unchanged.)
(16)₁₀ − (26)₁₀ by 2's complement (8-bit)
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:
Answer: (2's complement form) .
- 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 (multiplicand) and (multiplier). The product has bits, .
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 is one 2-input AND gate, so 16 AND gates are needed. Adding the four rows needs three 4-bit parallel adders.
Design
- Row 0: . Its LSB is directly .
- Adder 1: adds row 1 () to the upper three bits of row 0 (). Its sum LSB is ; its carry and upper three sum bits go on.
- Adder 2: adds row 2 () to (carry of adder 1, upper three sum bits of adder 1). Its sum LSB is .
- Adder 3: adds row 3 () to (carry of adder 2, upper three sum bits of adder 2). Its four sum bits give and its carry gives .
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 .
Example: (13 × 11)
| Step | Operation | Result | Product bit |
|---|---|---|---|
| Row 0 | upper bits 0110 | ||
| Adder 1 | () | 1 0011 | , pass 1001 |
| Adder 2 | () | 0 1001 | , pass 0100 |
| Adder 3 | () | 1 0001 | , |
Product , and .
Hardware: 16 AND gates and three 4-bit parallel adders (e.g. three IC 7483). In general an -bit multiplier needs AND gates and -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 and plus an input carry . It is made by cascading 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)
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Operation
- All input bits are applied at the same time (parallel inputs). is 0 for plain addition (it is set to 1 for 2's complement subtraction).
- FA0 adds , , and gives and .
- enters FA1, which produces and ; the carry ripples stage by stage to the left.
- The last stage gives and the final carry . The result is the -bit number .
Example (n = 4): , , :
| Stage | |||||
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 | 1 |
| 2 | 0 | 1 | 1 | 0 | 1 |
| 3 | 1 | 0 | 1 | 0 | 1 |
Result .
Timing and expansion
- Each stage must wait for the carry from the previous stage, so the worst-case delay is about (where is the carry delay of one full adder). This carry propagation delay grows with .
- Larger adders are built by cascading 4-bit adder ICs (7483/74283): of one IC goes to of the next.
- For high speed, the carry chain is replaced by a carry look-ahead generator, which forms all carries directly from and .
- With XOR gates on the B inputs and , 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
Problems with RCA
- Carry propagation delay: stage cannot give a correct sum until arrives. In the worst case (e.g. ) the carry passes through all stages, so the total delay is about . For a 32-bit adder this is very slow.
- Delay grows linearly with word length, so the RCA limits the speed of the ALU and processor clock.
- 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
Then . Expanding:
A,B -> [P,G gen] -> [Carry look-ahead] -> C1..C4
| |
+---------> [XOR: S = P xor C] <+
All carries are two-level AND-OR functions of , and , so every carry appears after a fixed delay (about 2 gate delays after , ), independent of . 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 and gives = its 2's complement (, keeping 4 bits).
Truth table
| 0000 | 0000 | 1000 | 1000 | |
| 0001 | 1111 | 1001 | 0111 | |
| 0010 | 1110 | 1010 | 0110 | |
| 0011 | 1101 | 1011 | 0101 | |
| 0100 | 1100 | 1100 | 0100 | |
| 0101 | 1011 | 1101 | 0011 | |
| 0110 | 1010 | 1110 | 0010 | |
| 0111 | 1001 | 1111 | 0001 |
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"):
- for odd numbers only:
- for 01, 10 in :
- equals when , else :
- equals when , else :
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 to the first OR output).
Check: : , , , , so , and . Correct.
(Alternative: invert each bit with NOT gates and add 1 using a 4-bit parallel adder with .)
- 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 , . Outputs: sum , carry , difference , borrow ().
| A | B | S | C | D | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 0 | 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 | 0 | 0 |
The sum and difference are the same function, so one XOR gate serves both. Add one AND gate for and one NOT plus one AND gate for .
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 is preferred: , , giving carry when and borrow when .)
a) (47)₁₀ − (26)₁₀ by 2's complement (8-bit)
0010 1111 (+47)
+ 1110 0110 (-26)
-----------
1 0001 0101
An end carry occurs: discard it. The result is positive.
Answer: . Check: .
b) (10010)₂ − (10011)₂ by 1's complement
10010
+ 01100
-------
11110 (no end-around carry)
No end carry, so the result is negative; take its 1's complement:
Answer: . Check: .
- 2081 Bhadra · 5 marks
Design a full subtractor circuit using half subtractors and one OR gate.
Answer
A full subtractor subtracts and a borrow-in from , giving difference and borrow-out . A half subtractor subtracts from : , .
Truth table and expressions
| A | B | D | ||
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
Using two half subtractors and one OR gate
- HS1 with inputs , : , .
- HS2 with inputs , : , .
- OR gate: , which matches the expression above.
+-----+ D1 +-----+
A ----->| HS1 |------>| HS2 |----------> D
B ----->| | Bin->| |
+-----+ +-----+
| B1 | B2
+---->[OR]<---+
|
+-----------------> Bo
Check: : HS1 gives , ; HS2 gives , ; . So , i.e. 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 by to give a 6-bit product . 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
- AND gates make the partial-product bits.
- Two 3-bit parallel adders add the three rows.
Design steps
- directly.
- Adder 1 (3-bit): adds row 1 () to (). LSB of its sum gives .
- Adder 2 (3-bit): adds row 2 () to (carry of adder 1, upper two sum bits of adder 1). LSB gives , the next two sum bits give , and its carry is .
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 .
Example: (5 × 3)
| Step | Operation | Result | Product bit |
|---|---|---|---|
| Row 0 | pass 010 | ||
| Adder 1 | () | 0 111 | , pass 011 |
| Adder 2 | () | 0 011 | , |
Product , and .
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:
Carries for 2 bits ():
Sums:
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 comes from a two-level AND–OR circuit, it is ready after the same delay as .
Full subtractor using half subtractors
- HS1 (, ): ,
- HS2 (, ): ,
- (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 :
- Carry generate : a carry is produced regardless of .
- Carry propagate : an incoming carry is passed on.
2-bit fast adder
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; and appear after two more gate delays (AND then OR); the sums after one more XOR delay. does not wait for .
Example: , , : ; , ; , . Result (3 + 1). Correct.
Advantages of a fast adder
- Much higher speed: carry delay is constant (about 3–4 gate delays), not times one stage delay as in a ripple adder.
- Delay does not grow with word length within a block, so it suits fast ALUs.
- Blocks can be cascaded with a second level of look-ahead (IC 74182) for wide adders.
- 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 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: , .
Operation: FA0 adds the LSBs with (0 for plain addition); its carry goes to FA1, and so on. The result is . Example: (5 + 3 = 8).
Features and uses:
- IC 7483/74283 is a 4-bit binary parallel adder; ICs are cascaded ( to next ) for 8, 12, 16 bits.
- With XOR gates on B and 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 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 , , and gives sum and carry . A half adder adds two bits: , .
Full adder expressions
| A | B | S | ||
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
Construction with two half adders and an OR gate
- HA1 (, ): ,
- HA2 (, ): ,
- OR:
+-----+ S1 +-----+
A ---->| HA1 |------>| HA2 |-----------> S
B ---->| | Cin ->| |
+-----+ +-----+
| C1 | C2
+---->[OR]<---+
+--------------------> Cout
Check: : ; ; . So . 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 ↗