52 Computer Architecture and Organization
Y input (all four bits) needs pre-processing in six cases (no pre-processing for rst two cases).
Depending upon the requirement (Table 3.8), Y input to be either inverted (for function select code be-
ing 010, 011 or 110) or cleared (for function select code being 100 or 111) or to be changed to 1111 (for
function select code being 101).
Finally, Cin input is to be pre-processed for seven cases, making the input as 0 or inverted or set to 1.
Only in one case (function select code being 001) no pre-processing is necessary for Cin input. There-
fore, a maximum of four types of operations are necessary for the input signals
R Pass the signal as it is (or as they are)
R Clear the signal to zero
R Invert or complement the signal
R Set the signal to 1 (or 1111 depending upon the bit-width).
We shall now discuss about the mechanism of implementing all these four operations.
To implement any one of the rst two operations, we may use 2-input AND gate(s). One of the
two inputs of the AND gate may be designated as ‘switch’ [ Figure 3.28 (a)]. If the switch is 1, the
other input signal would be available at the output of the AND gate as it is ( rst operation). How-
ever, if the switch is cleared to 0, then the other input signal would also be cleared to 0 at the output
(second operation). Note that for 4-bit inputs (cases of X and Y of our problem), we would need four
numbers of 2-input AND gates, and all four switches of these four AND gates must be connected
together.
Now let us take the next two operations of inverting a signal or setting it as 1. This may be achieved
by a 2-input XOR gate with one of its input acting as the switch and the other handling the 1-bit input
signal [Figure 3.28 (b)]. If the switch is 0, then the signal would pass as it is. However, if the switch is 1,
then the signal would be inverted. The question may come that how the signal would be set to 1?
Well, in that case rst the signal must be cleared to 0 (with AND gate) and then it is to be inverted
by XOR gate.
Figure 3.28 Implementation of (a) AND switch and (b) XOR switch
M03_GHOS1557_01_SE_C03.indd 52M03_GHOS1557_01_SE_C03.indd 52 4/29/11 5:02 PM4/29/11 5:02 PM