NivaarExam PrepOfficial exam papers ↗

22-Elec-A4 Digital Systems and Computers · December 2017

Question 4 of 6: Two-bit subtractor and HS/FS cascade

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

National Exams — 16-Elec-A4 Digital Systems & Computers — December 2017. Closed book; 3 hours; six questions of 12 marks each, of which any five constitute a complete paper. All six are solved below as a study resource. Permitted aids: Casio or Sharp approved calculator; a sheet of Boolean identities and a flip-flop excitation table are supplied with the paper.

Reference texts. M. Morris Mano & M. D. Ciletti, Digital Design (Pearson); C. H. Roth & L. L. Kinney, Fundamentals of Logic Design (Cengage); J. F. Wakerly, Digital Design: Principles and Practices (Pearson); Hamacher, Vranesic & Zaky, Computer Organization (McGraw-Hill) for the interrupt / timer material.

Question 4: Two-bit subtractor and HS/FS cascade (12 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. Minuend $N_1=AB$, subtrahend $N_2=CD$ (each 2-bit unsigned, $A,C$ the MSBs); output $XYZ$ is the difference in 3-bit 2’s complement, value $=-4X+2Y+Z$.

Find. The truth table of $X,Y,Z$, their minimal SoP, and the wiring of the supplied HS + FS into a 2-bit subtractor.

Approach. Compute $(2A+B)-(2C+D)$ for all 16 input combinations, encode each signed value in 3-bit 2’s complement, minimise each output on a K-map, then recognise the ripple-borrow structure that the HS and FS implement.

(a) Truth table

(a) $XYZ = (AB)-(CD)$ in 3-bit 2’s complement
ABCDvalueXYZ
00000000
0001−1111
0010−2110
0011−3101
01001001
01010000
0110−1111
0111−2110
10002010
10011001
10100000
1011−1111
11003011
11012010
11101001
11110000

(b) K-map minimisation

K-map of $X$ (sign bit)
AB \ CD00011110
0000111312
0104051716
11012013015014
100809111010
$X=\sum m(1,2,3,6,7,11)$: groups $\overline{A}C$ (blue), $\overline{A}\,\overline{B}D$ (green), $\overline{B}CD$ (yellow).

$$X = \overline{A}\,C + \overline{A}\,\overline{B}\,D + \overline{B}\,C\,D.$$

K-map of $Z$ (LSB)
AB \ CD00011110
0000111302
0114050716
11112013015114
100819111010
$Z=\sum m(1,3,4,6,9,11,12,14)=B\oplus D$.

$$Z = B\overline{D} + \overline{B}D = B\oplus D.$$

The middle bit is a three-way exclusive-OR, $Y=A\oplus C\oplus(\overline{B}D)$, whose checkerboard map does not merge; written flat as a minimal SoP it is

K-map of $Y$
AB \ CD00011110
0000110312
0104051716
11112113015014
101809111010
$Y=\sum m(1,2,6,7,8,11,12,13)$; an XOR pattern — no cells merge, six product terms.

$$Y = \overline{A}\,\overline{B}\,\overline{C}\,D + \overline{A}BC + A\overline{B}CD + \overline{A}C\overline{D} + A\overline{C}\,\overline{D} + AB\overline{C}.$$

(c) HS + FS cascade

The 2-bit subtraction ripples a borrow from the LSB stage to the MSB stage. The half subtractor forms the least-significant bit and its borrow; the full subtractor forms the next bit, its borrow-in being the LSB borrow, and its borrow-out is the 2’s-complement sign bit:

Half Subtractor (HS) M S Diff Bout Full Subtractor (FS) M S Bin Diff Bout B D Z Z = B⊕D borrow B'·D A C Y X Y (difference) X (sign / borrow-out)
Completed cascade: HS on $(B,D)$ makes $Z$ and the LSB borrow; FS on $(A,C,\text{borrow})$ makes $Y$ and the sign bit $X$.
Question 4 results
OutputMinimal SoPCascade source
$Z$ (LSB)$B\oplus D$HS difference
$Y$$A\oplus C\oplus \overline{B}D$ (6-term SoP)FS difference
$X$ (sign)$\overline{A}C+\overline{A}\,\overline{B}D+\overline{B}CD$FS borrow-out