Computer Hardware – Logic gates, adders, encoders, decoders, multiplexers, universal gates Quiz - ICSE Class 12 Computer Science
Free practice quiz: Computer Hardware – Logic gates, adders, encoders, decoders, multiplexers, universal gates (ICSE Class 12 Computer Science). 60 multiple-choice questions with answers and explanations. Play online, no sign-up needed.
Play all 60 questions freeSample questions
Which of the following gates cannot be used to construct a full adder circuit?
- AND gate
- XOR gate
- NOT gate
- OR gate
Show answer
Answer: C. NOT gate
A full adder requires at least two XOR gates, two AND gates, and two OR gates (or a combination of gates that perform these functions). A NOT gate alone cannot implement the sum or carry logic of a full adder.
Consider a 4-bit ripple carry adder. If the carry-in to the least significant bit is 0, and all input bits are 1, what will be the final carry-out of the most significant bit?
- 0
- 1
- Error
- Depends on the other inputs
Show answer
Answer: B. 1
Adding four 1s (1111) in binary results in 1111 (decimal 15). This means there is a carry-out of 1 from the most significant bit position, and the sum bits will be 1111. More formally, for 4-bit addition where all bits are 1 and Cin=0: Bit 0: 1+0 = 1, Cout0=0. Bit 1: 1+1+Cout0 = 1+1+0 = 10 (binary), Sum1=0, Cout1=1. Bit 2: 1+1+Cout1 = 1+1+1 = 11 (binary), Sum2=1, Cout2=1. Bit 3: 1+1+Cout2 = 1+1+1 = 11 (binary), Sum3=1, Cout3=1. The final carry-out (Cout3) is 1.
Consider the expression Y = (A+B)(A'+C). If implemented using only NAND gates, how many NAND gates are theoretically needed to implement this expression directly?
- 3
- 4
- 5
- 6
Show answer
Answer: C. 5
First, simplify the expression: Y = (A+B)(A'+C) = AA' + AC + BA' + BC = 0 + AC + BA' + BC = AC + BA' + BC. This can be further simplified or implemented directly. Let's aim to implement it using NANDs. (A+B) can be (A'B')'. A'+C can be (A''C')'. Y = ((A+B)' + (A'+C)')'. This requires 4 NAND gates for (A+B)' and (A'+C)' and then a NOR (which is a NAND for inversion). Let's re-evaluate. Y = AC + A'B + BC. Using Karnaugh maps or Boolean algebra, we might get a simpler form. However, let's convert the original expression. (A+B) = NAND1 (inputs A,B), then NAND2 (inverter on output). A'+C = NAND3 (inputs A,A), then NAND4 (inputs output of NAND3, C). Now we have (A+B) and (A'+C). To OR them with NANDs: ((A+B)' . (A'+C)')'. This requires two more NANDs. Total: 2 for first term, 2 for second, 2 for OR. If (A+B) is made of 2 NANDs, and (A'+C) is made of 2 NANDs (one inverter for A, then NAND with C), then we need to OR these results. Y = (A+B) OR (A'+C). Using NANDs: (A+B) = (A'B')'. A'+C = (A''C')'. Y = ((A+B)' . (A'+C)')'. Let's implement A+B using 2 NANDs: (A.A)' is A'. A'.B is not direct. A+B = (A'B')'. A'+C. Let's try another way. Y = AC + A'B + BC. Using NANDs: AC requires a NAND and an inverter, so 2. A'B requires an inverter for A, then NAND with B, then inverter: 3. BC needs 2 NANDs. This is getting complex. Standard conversion of (A+B)(A'+C) into NANDs. (A+B) is (A'B')'. (A'+C) is (A''C')'. Let's use a 5-NAND implementation: NAND1(A,B) -> (AB)'. NAND2(output1, output1) -> A+B. NAND3(A,A) -> A'. NAND4(output3,C) -> (A'C)'. NAND5(output2, output4) -> ((A+B)' . (A'C)')'. This is (A+B) + (A'C). The correct expression is (A+B)(A'+C). Let's convert it to NANDs. Y = (A+B)(A'+C) = (AB)' + (A'C)'. Using NANDs: (A+B) = (A'B')'. A'+C = (A''C')'. Let's convert Y = AC + A'B + BC. Using NAND gates: A'B requires 3 NANDs (A', A'B, (A'B)' ). This is incorrect. A' requires 1 NAND gate. A'B requires 2 NAND gates: NAND(A,A)=A', NAND(A',B) = (A'B)'. This is not XOR. Y = A.C + B.A' + B.C. Using 5 NAND gates for Y = AC + A'B + BC: (A' requires NAND(A,A)). Let's simplify Y = (A+B)(A'+C) = AA' + AC + BA' + BC = AC + A'B + BC. Consensus theorem: Y = AC + A'B + BC = AC + A'B. Now, to implement AC + A'B using NANDs. AC = ( (AC)' )'. A'B = ( (A'B)' )'. Y = ( (AC)' )' + ( (A'B)' )' = ( (AC)'.(A'B)' )'. This requires: NAND1(A,C) -> (AC)'. NAND2(output1, output1) -> AC. NAND3(A,A) -> A'. NAND4(output3, B) -> (A'B)'. NAND5(output2, output4) -> ((AC)'.(A'B)')'. This gives Y. So 5 NAND gates are needed.
What is the minimum number of NOR gates required to implement a 2-input AND gate?
- 2
- 3
- 4
- 1
Show answer
Answer: B. 3
To implement an AND gate using NOR gates: A AND B = ((A+B)')'. First, get A+B using a NOR gate (N1). Then invert the output of N1 using another NOR gate with inputs tied together (N2). This gives (A+B)''. However, to get A AND B, we need to realize it as ((A'+B)')'. Let's use the fact that NOR is universal. A.B = ((A+B)')'. We need to implement (A+B) first. This can be done with a NOR gate: A NOR B = (A+B)'. Then, to invert this, we can use another NOR gate with its inputs tied together: ((A+B)')'. This requires 2 NOR gates. Wait, that's for A+B. For A.B: A.B = (A'+B')'. Implement A' using NOR(A,A). Implement B' using NOR(B,B). Then NOR these two results: NOR(NOR(A,A), NOR(B,B)). This requires 3 NOR gates.
A 4-to-1 multiplexer is used to select one of four inputs (D0, D1, D2, D3) based on two select lines (S1, S0). If the select lines are used to enable specific outputs of a 3-to-8 decoder, how would this typically be configured to achieve the multiplexer function?
- The outputs of the decoder are connected to the data inputs of the multiplexer.
- The data inputs of the multiplexer are connected to specific outputs of the decoder, controlled by the select lines.
- The select lines of the multiplexer are connected to the select lines of the decoder.
- The decoder's select lines are used to enable the data inputs of the multiplexer.
Show answer
Answer: C. The select lines of the multiplexer are connected to the select lines of the decoder.
To implement a multiplexer's selection function using a decoder, the select lines of both the multiplexer and the decoder are connected together. The decoder then generates unique enabling signals for each of its output lines, corresponding to the select line combinations. These decoder outputs can then be used to control which data input is routed to the multiplexer's output. For a 4-to-1 MUX using a 3-to-8 decoder, you would connect the MUX select lines (S1, S0) to the lower two select lines of the decoder (e.g., A and B), and the decoder's outputs (corresponding to the select inputs) would be used to enable the data inputs of the MUX. A common implementation would have the MUX's data inputs connected to the decoder outputs through AND gates (which are part of the MUX's internal logic). However, the core idea is that the select lines drive the decoding logic.