1Which logic gate produces an output of only when all of its inputs are ?
introduction to logic gates
Easy
A.OR gate
B.NOT gate
C.AND gate
D.XOR gate
Correct Answer: AND gate
Explanation:
The AND gate outputs only when every input is ; otherwise the output is .
Incorrect! Try again.
2The output of an OR gate is only when:
introduction to logic gates
Easy
A.All inputs are
B.Any one input is
C.All inputs are
D.Any one input is
Correct Answer: All inputs are
Explanation:
An OR gate outputs if at least one input is , so its output is only when all inputs are .
Incorrect! Try again.
3A NOT gate is also commonly known as a(n):
introduction to logic gates
Easy
A.Comparator
B.Multiplexer
C.Inverter
D.Buffer
Correct Answer: Inverter
Explanation:
The NOT gate reverses (inverts) its single input, so it is called an inverter.
Incorrect! Try again.
4The Boolean expression for a two-input AND gate with inputs and is:
introduction to logic gates
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
The AND operation is represented by multiplication, so the output is .
Incorrect! Try again.
5Which gate outputs when its two inputs are different?
introduction to logic gates
Easy
A.NOR gate
B.NAND gate
C.AND gate
D.XOR gate
Correct Answer: XOR gate
Explanation:
The XOR (exclusive-OR) gate outputs only when the inputs differ from each other.
Incorrect! Try again.
6A NAND gate is equivalent to which combination of gates?
combination of gates
Easy
A.OR gate followed by NOT gate
B.AND gate followed by OR gate
C.AND gate followed by NOT gate
D.NOT gate followed by AND gate
Correct Answer: AND gate followed by NOT gate
Explanation:
NAND means NOT-AND, so it is an AND gate whose output is passed through a NOT gate.
Incorrect! Try again.
7A NOR gate is formed by combining which gates?
combination of gates
Easy
A.AND gate followed by NOT gate
B.NOT gate followed by OR gate
C.OR gate followed by NOT gate
D.OR gate followed by AND gate
Correct Answer: OR gate followed by NOT gate
Explanation:
NOR means NOT-OR, so it is an OR gate followed by an inverter (NOT gate).
Incorrect! Try again.
8Which gate is called a universal gate because any circuit can be built using only it?
combination of gates
Easy
A.NOT gate
B.NAND gate
C.AND gate
D.XOR gate
Correct Answer: NAND gate
Explanation:
The NAND gate (like the NOR gate) is universal, since all other gates can be constructed from it alone.
Incorrect! Try again.
9The Boolean expression for a NOR gate with inputs and is:
combination of gates
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
A NOR gate is the complement of an OR gate, giving the output .
Incorrect! Try again.
10The output of a two-input XNOR gate is when:
combination of gates
Easy
A.Both inputs are equal
B.Both inputs are different
C.Any input is
D.Any input is
Correct Answer: Both inputs are equal
Explanation:
The XNOR gate outputs when both inputs are the same (both or both ).
Incorrect! Try again.
11In a switching circuit, two switches connected in series represent which logic operation?
implementation of logic gates to the switching circuits
Easy
A.XOR
B.AND
C.NOT
D.OR
Correct Answer: AND
Explanation:
Series switches allow current only when both are closed, matching the AND operation.
Incorrect! Try again.
12In a switching circuit, two switches connected in parallel represent which logic operation?
implementation of logic gates to the switching circuits
Easy
A.NAND
B.NOT
C.AND
D.OR
Correct Answer: OR
Explanation:
Parallel switches allow current when either switch is closed, matching the OR operation.
Incorrect! Try again.
13In switching circuit notation, a closed switch (current flows) is usually represented by the value:
implementation of logic gates to the switching circuits
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
A closed switch that allows current to flow is represented by logic , and an open switch by .
Incorrect! Try again.
14A switching circuit with a single switch whose state is the opposite of the input represents which gate?
implementation of logic gates to the switching circuits
Easy
A.AND gate
B.OR gate
C.NOT gate
D.XOR gate
Correct Answer: NOT gate
Explanation:
A switch whose output is always the complement of its input models the NOT (inverter) gate.
Incorrect! Try again.
15A function that is defined in terms of itself is called a:
introduction to recursion
Easy
A.Linear function
B.Iterative function
C.Recursive function
D.Constant function
Correct Answer: Recursive function
Explanation:
A recursive function refers to itself in its own definition, breaking a problem into smaller subproblems.
Incorrect! Try again.
16Every valid recursive definition must contain a:
introduction to recursion
Easy
A.Global variable
B.Loop counter
C.Base case
D.Return array
Correct Answer: Base case
Explanation:
A base case stops the recursion and prevents infinite self-calls; without it recursion never terminates.
Incorrect! Try again.
17A recurrence relation defines each term of a sequence using:
recurrence relation
Easy
A.A fixed constant only
B.One or more previous terms
C.The sum of all future terms
D.Only the first term
Correct Answer: One or more previous terms
Explanation:
A recurrence relation expresses a term as a function of one or more preceding terms of the sequence.
Incorrect! Try again.
18The Fibonacci sequence is defined by the recurrence:
recurrence relation
Easy
A.
B.
C.
D.
Correct Answer:
Explanation:
In the Fibonacci sequence each term is the sum of the two preceding terms.
Incorrect! Try again.
19A closed-form solution of a recurrence relation gives the -th term:
solving recurrence relation
Easy
A.Directly without previous terms
B.Only for the base case
C.As an approximate estimate only
D.Only after computing all previous terms
Correct Answer: Directly without previous terms
Explanation:
A closed-form solution expresses explicitly in terms of , so no earlier terms are needed.
Incorrect! Try again.
20For the linear homogeneous recurrence , the associated equation used to find the solution is called the:
linear homogenous recurrence relation with constant coefficient and their solution
Easy
A.Normal equation
B.Characteristic equation
C.Generating equation
D.Differential equation
Correct Answer: Characteristic equation
Explanation:
We solve linear homogeneous recurrences by forming and solving the characteristic equation, whose roots give the general solution.
Incorrect! Try again.
21For inputs and , what is the output of a NAND gate?
introduction to logic gates
Medium
A.Undefined
B.
C.
D.Depends on a third input
Correct Answer:
Explanation:
A NAND gate outputs only when all inputs are . Since , the NAND output is .
Incorrect! Try again.
22Which gate produces an output of only when its two inputs are different?
introduction to logic gates
Medium
A.AND
B.XOR
C.NOR
D.XNOR
Correct Answer: XOR
Explanation:
The XOR (exclusive-OR) gate outputs when inputs differ ( for ) and when they are equal.
Incorrect! Try again.
23A NOR gate output is HIGH () under which condition for inputs and ?
introduction to logic gates
Medium
A.When both and
B.When both and
C.When
D.For any combination of inputs
Correct Answer: When both and
Explanation:
NOR is the inverse of OR. only when both inputs are , so only when .
Incorrect! Try again.
24The Boolean expression is equivalent to which single gate?
combination of gates
Medium
A.NAND gate
B.NOR gate
C.XOR gate
D.AND gate
Correct Answer: NOR gate
Explanation:
By De Morgan's law, , which is exactly the NOR operation.
Incorrect! Try again.
25Which combination of gates behaves as a universal gate, capable of implementing any Boolean function on its own?
combination of gates
Medium
A.OR gate
B.NAND gate
C.AND gate
D.XNOR gate
Correct Answer: NAND gate
Explanation:
NAND (and NOR) are universal gates. Any Boolean function can be built using only NAND gates because NAND can realize NOT, AND, and OR.
Incorrect! Try again.
26How is a NOT gate constructed using only a single NOR gate?
combination of gates
Medium
A.Connect the output back to an input
B.Connect one input to permanently
C.Tie both inputs of the NOR gate together
D.Cascade two NOR gates in series
Correct Answer: Tie both inputs of the NOR gate together
Explanation:
With both inputs equal to , the NOR output is , which is the NOT operation.
Incorrect! Try again.
27The expression simplifies to which operation?
combination of gates
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Applying De Morgan's law: , the AND operation.
Incorrect! Try again.
28In a switching circuit, two switches connected in series represent which Boolean operation?
implementation of logic gates to the switching circuits
Medium
A.XOR
B.NOT
C.OR
D.AND
Correct Answer: AND
Explanation:
Series switches conduct only when both are closed, matching the AND operation where output is only if both inputs are .
Incorrect! Try again.
29Two switches connected in parallel correspond to which logic gate?
implementation of logic gates to the switching circuits
Medium
A.NAND gate
B.NOT gate
C.AND gate
D.OR gate
Correct Answer: OR gate
Explanation:
Parallel switches allow current when at least one is closed, matching the OR operation where output is if any input is .
Incorrect! Try again.
30A switching circuit has switch in series with a parallel combination of and . Which Boolean expression represents the circuit?
implementation of logic gates to the switching circuits
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The parallel part and gives , and placing in series multiplies it, giving .
Incorrect! Try again.
31For the circuit expression , what is the minimal equivalent switching function?
implementation of logic gates to the switching circuits
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Using the absorption identity , the circuit simplifies to two switches in parallel.
Incorrect! Try again.
32For the recursive definition with , what is ?
introduction to recursion
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
, , . Each step adds starting from .
Incorrect! Try again.
33Which component is essential in every recursive definition to prevent infinite recursion?
introduction to recursion
Medium
A.A loop counter
B.A base case
C.A return of zero
D.A global variable
Correct Answer: A base case
Explanation:
The base case gives a directly defined value that terminates the recursion; without it the recursion never stops.
Incorrect! Try again.
34The factorial function is defined as with . What is the value of ?
introduction to recursion
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
, computed by repeatedly applying the recursive rule down to the base case.
Incorrect! Try again.
35Which of the following is a recurrence relation of order ?
recurrence relation
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
The order equals the gap between the highest and lowest indices used. Depending on terms up to makes it a second-order relation.
Incorrect! Try again.
36Which recurrence relation is linear, homogeneous, and has constant coefficients?
recurrence relation
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
It is linear (no powers/products of terms), homogeneous (no extra function of ), and has constant coefficients and .
Incorrect! Try again.
37For the recurrence with , what is the closed-form solution?
solving recurrence relation
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
This is a geometric recurrence with ratio and initial value , giving .
Incorrect! Try again.
38Using iteration, the solution to with is:
solving recurrence relation
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Unrolling gives , the sum of the first integers.
Incorrect! Try again.
39What is the characteristic equation of the recurrence ?
linear homogenous recurrence relation with constant coefficient and their solution
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
Substituting gives , i.e. .
Incorrect! Try again.
40The characteristic roots of a recurrence are and . What is the general solution form?
linear homogenous recurrence relation with constant coefficient and their solution
Medium
A.
B.
C.
D.
Correct Answer:
Explanation:
For distinct real roots, the general solution is a linear combination , giving .
Incorrect! Try again.
41A logic gate produces output only when its two inputs are different. If this gate is fed with inputs and (the complement of ), what is the output for all values of ?
introduction to logic gates
Hard
A.Equal to
B.Always
C.Always
D.Equal to
Correct Answer: Always
Explanation:
The described gate is XOR. Since and are always different, for every value of .
Incorrect! Try again.
42The Boolean expression is functionally equivalent to which single gate output?
combination of gates
Hard
A. (XOR)
B. (AND)
C. (NAND)
D. (OR)
Correct Answer: (AND)
Explanation:
By De Morgan's law, , which is the AND function.
Incorrect! Try again.
43How many 2-input NAND gates are minimally required to implement a 2-input XOR gate?
combination of gates
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The standard NAND-only realization of XOR uses exactly four 2-input NAND gates, arranged so that .
Incorrect! Try again.
44Which of the following gates is a universal gate, meaning any Boolean function can be built using only copies of it?
introduction to logic gates
Hard
A.AND
B.XOR
C.OR
D.NOR
Correct Answer: NOR
Explanation:
NAND and NOR are the two universal gates. XOR, AND, and OR alone cannot express all Boolean functions (e.g., they cannot produce a constant complement freely).
Incorrect! Try again.
45In switching-circuit algebra, two switches connected in series correspond to which Boolean operation, and two in parallel to which?
implementation of logic gates to the switching circuits
Hard
A.Series = XOR, Parallel = AND
B.Series = AND, Parallel = OR
C.Series = OR, Parallel = XOR
D.Series = OR, Parallel = AND
Correct Answer: Series = AND, Parallel = OR
Explanation:
Current flows through series switches only if both are closed (logical AND), and through parallel switches if either is closed (logical OR).
Incorrect! Try again.
46A switching circuit realizes the function . Using Boolean simplification, the minimized form of is:
implementation of logic gates to the switching circuits
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Expand: . The simplified circuit needs fewer switches.
Incorrect! Try again.
47Consider the recursive function with and (the Lucas sequence). What is ?
introduction to recursion
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Computing: .
Incorrect! Try again.
48A recursive procedure makes two recursive calls each of size plus work per call. Which closed-form time complexity does this recurrence yield?
introduction to recursion
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
By the Master Theorem with , we have , matching , so .
Incorrect! Try again.
49The number of moves required to solve the Tower of Hanoi with disks satisfies with . What is the closed form of ?
recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Solving the non-homogeneous recurrence gives . Check: , , .
Incorrect! Try again.
50Which of the following is a first-order linear non-homogeneous recurrence relation with constant coefficients?
recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
First-order (depends on only), linear (no products/powers of terms), constant coefficient (), and non-homogeneous (constant term ). The others involve products, powers, or a variable coefficient.
Incorrect! Try again.
51Solve the recurrence with . The general solution has characteristic roots:
solving recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The characteristic equation is , giving roots and .
Incorrect! Try again.
52For the recurrence in the previous style, with , the explicit closed form is:
solving recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
With : and give . Thus .
Incorrect! Try again.
53A linear homogeneous recurrence has characteristic equation . What is the correct general form of the solution?
linear homogenous recurrence relation with constant coefficient and their solution
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
For a repeated root of multiplicity , the solution is , introducing the factor for the second linearly independent solution.
Incorrect! Try again.
54The recurrence has characteristic equation with complex roots . The real general solution is:
linear homogenous recurrence relation with constant coefficient and their solution
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Roots have modulus and argument , so the real form is .
Incorrect! Try again.
55A degree-3 homogeneous recurrence has characteristic roots . Which is the correct general solution?
linear homogenous recurrence relation with constant coefficient and their solution
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Root has multiplicity , contributing ; the simple root contributes .
Incorrect! Try again.
56Solve with . The closed form is:
solving recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Characteristic equation gives repeated root . With : and . So .
Incorrect! Try again.
57A circuit outputs . For how many of the four input combinations does ?
combination of gates
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
is the XNOR function, which is when . This happens for and , i.e., 2 combinations.
Incorrect! Try again.
58A lamp is controlled so that flipping either of two switches toggles the lamp state (a staircase switch). Which Boolean function of the two switch positions and describes the lamp?
implementation of logic gates to the switching circuits
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
A two-way (staircase) switch changes state whenever either switch changes, which is exactly the XOR relationship .
Incorrect! Try again.
59The recurrence is being solved. What is the correct form of the particular solution to try?
recurrence relation
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
The forcing term is and is not a root of the homogeneous characteristic equation (), so the standard trial form works without multiplying by .
Incorrect! Try again.
60A recursive definition sets and for . What is the closed-form expression for ?
introduction to recursion
Hard
A.
B.
C.
D.
Correct Answer:
Explanation:
Unrolling gives , the sum of the first positive integers.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →