All 26 questions UPSC has asked on digital electronics in the Physics Optional (Paper II, Solid State Physics, Devices and Electronics) from 1996 to 2024, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Solid State Physics, Devices and Electronics topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the numbers or the algebra were worked out again independently in code (Python with SymPy) and agree with ours.
- ✓ Proof checked step by step every step of the argument was checked.
- ✓ Checked step by step for descriptive questions, every statement was checked against standard textbooks.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2024 · 8b(i) 2024 · 8b(ii) 2022 · 5e 2016 · 5b 2015 · 5d 2013 · 8b 2012 · 8b 2011 · 5f 2011 · 8b 2010 · 8c 2009 · 5e 2007 · 5c(i) 2007 · 8b 2006 · 5c(i) 2005 · 5c(i) 2004 · 8b 2004 · 8c 2003 · 5c 2002 · 5d(i) 2001 · 8a 2001 · 8b 2000 · 1d 1999 · 1d 1998 · 4b 1997 · 4b 1996 · 4a
How is digital system different from analog system? What are the principal reasons for the widespread use of digital electronics?
Solution
Analog versus digital systems.
| Analog | Digital |
|---|---|
| Signals vary continuously and can take any value in a range (e.g. a microphone voltage) | Signals take only discrete values, usually two (0 and 1, LOW and HIGH) |
| Information is carried by the exact value of a voltage or current | Information is coded as binary numbers; only the level (0 or 1) matters |
| Noise and drift add directly to the signal and accumulate stage by stage | Small noise does not change a 0 into a 1, so it is rejected; signals can be regenerated perfectly |
| Processing by amplifiers, filters, integrators | Processing by logic gates, flip-flops, arithmetic circuits, processors |
| Accuracy limited by component tolerances | Accuracy set by the number of bits, can be made as high as needed |
| Examples: radio receiver, audio amplifier, thermometer | Computers, digital watches, mobile phones, digital TV |
Reasons for the widespread use of digital electronics.
- Noise immunity and reliability: a signal need only be recognised as 0 or 1; it can be regenerated without loss at every stage, so it can be copied and transmitted over long distances without degradation.
- Accuracy and precision set by word length, not by component tolerances; results are exactly repeatable.
- Storage: information is easily stored in large, cheap memories (semiconductor, magnetic, optical) for any length of time.
- Programmability: one hardware design (a microprocessor) can do many different tasks by changing the software.
- Integration: digital circuits use simple, repetitive switching elements ideal for ICs; millions or billions of gates on a chip, with low cost, small size and low power (CMOS).
- Easy design with Boolean algebra and computer-aided tools; error detection and correction, encryption and compression are possible.
- Compatibility with computers and digital communication. (Analog circuits are still needed at the interfaces – sensors, amplifiers, ADC/DAC, RF.)
✓ Checked step by step We checked the comparison and the list of reasons step by step.
Give logic diagram, Boolean equation and truth tables of AND, OR and NOT gates. Show that NAND and NOR gates can be utilized as a Universal Gate.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
Why NAND and NOR gates are called universal gates? Give the logic diagram, Boolean equation and the truth table of a X–OR gate.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
Why are NAND and NOR gates called universal gates? Give the logic diagram, Boolean equation and the truth table of a NAND gate.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
Simplify the logical expression .
Solution
Expand the bracket: , since . (D drops out entirely; the circuit reduces to one AND gate with an inverter on B.)
✓ Checked by computer We checked the simplification against the full truth table in code.
Construct a digital circuit to add three bits A, B and C and provide their sum and carry as outputs. Show appropriate Boolean expressions and truth table to justify the outputs.
Solution
Full adder. It adds three bits A, B and C (C is the carry from the previous column) and gives a sum bit S and a carry-out .
| A | B | C | 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 |
Boolean expressions (sum of products from the table): (S = 1 when an odd number of inputs are 1). (carry when at least two inputs are 1).
Circuit. Two half adders and an OR gate: the first half adder gives and ; the second adds C, giving and ; the OR of the two carries is .
The truth table above, obtained by evaluating these gates for all eight inputs, confirms the outputs.
✓ Checked by computer We checked the sum and carry expressions against all eight input combinations in code.
Explain the race problem encountered in an RS latch and how it can be avoided. Build a Mod-10 counter using JK flip-flops and explain its working.
Solution
Race problem in an RS latch. In a NOR-gate RS latch the input forces both and to 0, which is logically inconsistent. If S and R then return to 0 simultaneously, both gates try to switch to 1 at the same moment; whichever gate is slightly faster wins, and the final state is unpredictable. This dependence on unequal propagation delays is a race (the condition is “forbidden” or “indeterminate”). In a clocked (gated) latch the same happens if S = R = 1 when the clock pulse ends.
How to avoid it.
- Never apply : e.g. use a D latch/flip-flop, with produced by an inverter.
- Use a JK flip-flop, in which the outputs are fed back to the input gates so that makes the flip-flop toggle – a defined state.
- A JK flip-flop with a level-sensitive clock has its own race-around problem (it toggles repeatedly while the clock is high if the pulse is longer than the propagation delay). This is removed by edge triggering or a master–slave arrangement, so that the outputs change only once per clock pulse.
Mod-10 (decade) counter with JK flip-flops.
Circuit. Four negative-edge-triggered JK flip-flops FF0–FF3 with , so each toggles on every falling edge at its clock input. The external clock drives FF0; the output clocks FF1, clocks FF2, clocks FF3 (ripple, or asynchronous, counter). Four flip-flops alone would count 0–15 (mod-16). A two-input NAND gate fed with and drives the active-low CLEAR inputs of all four flip-flops.
Working.
| Clock pulses | Count | |
|---|---|---|
| 0 | 0000 | 0 |
| 1 | 0001 | 1 |
| 2 | 0010 | 2 |
| 3 | 0011 | 3 |
| 4 | 0100 | 4 |
| 5 | 0101 | 5 |
| 6 | 0110 | 6 |
| 7 | 0111 | 7 |
| 8 | 1000 | 8 |
| 9 | 1001 | 9 |
| 10 | 1010 → 0000 | 0 |
FF0 divides the clock by 2, FF1 by 4, and so on, so the outputs count up in binary. On the tenth pulse the state becomes 1010; this is the first state in which , so the NAND output goes LOW and immediately clears all flip-flops to 0000 (the state 1010 lasts only a few nanoseconds). The counter therefore goes through ten states, 0 to 9, and gives one output pulse for every ten input pulses – a decade counter, used in frequency counters, digital clocks and displays (with BCD-to-seven-segment decoders).
✓ Checked step by step We checked the race condition and the counting sequence with its reset step by step.
Simplify the logical expression using a Karnaugh map.
Solution
Karnaugh map (rows A, columns BC in Gray code 00, 01, 11, 10):
| 1 | 1 | 0 | 0 | |
| 0 | 0 | 1 | 1 |
( gives 1s in the two left cells of the top row; and give 1s in the two right cells of the bottom row.)
Grouping. The two 1s of the top row form a pair (, C eliminated); the two 1s of the bottom row form a pair (, C eliminated). The term is already covered. – an XNOR (equality) function of A and B; C is irrelevant. (Algebraically, .)
✓ Checked by computer We checked the Karnaugh-map result against the full truth table in code.
Simplify the logical expression and draw the logical circuit to implement it.
Solution
By De Morgan, . So Circuit: invert A and C and feed , B, to a three-input AND gate (Y = 1 only for A = 0, B = 1, C = 0).
✓ Checked by computer We checked the simplification against the full truth table in code.
Why NAND and NOR gates are called universal gates? Give the logic diagram, Boolean equation and the truth table of a NAND gate. Design an OR gate using only NAND gates.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
Verify that the circuit shown below is an exclusive OR.
[Figure: Logic circuit of four two-input NAND gates with inputs A and B and output Y. Gate 1 has inputs A and B; its output is labelled . Gate 2 (upper) has inputs A and ; its output is labelled . Gate 3 (lower) has inputs and B; its output is labelled . Gate 4 has inputs and ; its output is Y.]
Solution
Label the gate outputs as in the figure: By De Morgan, . Hence Truth table check:
| A | B | Y | |||
|---|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 0 |
Y is 1 exactly when the inputs differ, so the circuit is an exclusive-OR gate.
✓ Proof checked step by step We evaluated the four-NAND circuit for all four input pairs in code.
Simplify the equation: using Boolean algebra Give the logic circuit for the equation before and after the simplification.
Solution
Expand: . By De Morgan : is covered by (absorption, ): D is redundant. The original needs an inverter, three ANDs (one with three inputs), a NAND and two ORs; the simplified form needs just a NAND gate and an AND gate.
(If the second term is read as instead of , the result is , as in the 2015 question.)
✓ Checked by computer We checked the simplification against the full truth table in code.
Give the Boolean expression and the truth table for an XOR gate. Why are NAND gates called universal gates? Realise OR and XOR gates employing only NAND gates.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
Simplify the logical expression by using Karnaugh map and realise f using NAND gates only.
Solution
Karnaugh map (rows AB, columns CD, Gray code):
| 0 | 0 | 0 | 0 | |
| 0 | 1 | 1 | 1 | |
| 0 | 1 | 1 | 1 | |
| 0 | 0 | 0 | 0 |
( and fill the and columns of the B-rows; fills the column of the B-rows.)
Groups: the quad in columns , of rows , gives ; the quad in columns , of the same rows gives . NAND-only realisation. By double complementation and De Morgan, two NAND gates form and , and a third NAND combines them.
✓ Checked by computer We checked the Karnaugh-map result against the full truth table in code.
Draw the logic circuit for the following Boolean expression: What are the ‘Y’ values for the input combinations: (1) 1, 1, 0; (2) 1, 0, 1; (3) 0, 0, 1?
Solution
Circuit: a NOR gate on A and B, an inverter on C, and an OR gate combining their outputs.
| A, B, C | Y | ||
|---|---|---|---|
| (1) 1, 1, 0 | 0 | 1 | 1 |
| (2) 1, 0, 1 | 0 | 0 | 0 |
| (3) 0, 0, 1 | 1 | 0 | 1 |
(Equivalently , a NAND of and C.)
✓ Checked by computer We evaluated the expression for the three input combinations in code.
Give the two forms of the De Morgan’s theorem.
Solution
De Morgan’s theorems.
- The complement of a product equals the sum of the complements:
- The complement of a sum equals the product of the complements: They extend to any number of variables: and .
Proof by truth table (first form):
| A | B | ||
|---|---|---|---|
| 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
(the second form follows in the same way). In gate terms: a NAND gate is equivalent to an OR gate with inverted inputs, and a NOR gate to an AND gate with inverted inputs (“break the bar, change the sign”). The theorems are used to simplify expressions and to convert circuits to all-NAND or all-NOR form.
✓ Checked step by step We checked both forms on all input combinations.
What is the principle used in ‘half-adder’? Give the truth table for it.
Solution
Principle of the half adder. Binary addition of two bits follows the rules The result needs two output bits: the sum S (the bit in the same column) and the carry C (the bit passed to the next column). A half adder adds two single bits A and B (it has no carry input, hence “half”).
(i) Truth (math) table for adding two bits.
| A | B | Sum S | Carry C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
(ii) Boolean expressions (from the rows where each output is 1): (iii) Exclusive-OR. The sum is 1 when exactly one input is 1 – this is the exclusive-OR function: (Equivalently : “A or B, but not both”.)
(iv) Logic diagram. An XOR gate gives the sum and an AND gate the carry, both fed from A and B.
To add multi-bit numbers held in two registers, a half adder is used for the least significant bits and full adders (each made of two half adders and an OR gate) for the higher bits, the carry rippling from column to column.
✓ Checked step by step We checked the half-adder truth table and its XOR derivation step by step.
Explain the operation of the following circuit is a gate. Draw the truth table and find the operation carried out by this gate neglecting the source impedance.
[Figure: Diode–transistor logic gate. Three inputs A, B and C, each connected through a diode D to a common node P; the diodes are drawn with their cathodes towards the inputs (anodes at P). An input waveform stepping from 0 V up to 12 V is drawn beside the inputs. Node P is connected to +12V through a 15K resistor. From P a resistor R1 (15K), shunted by a speed-up capacitor C1, goes to the base of transistor Q; the base is also connected to −12V through a 100 K resistor. Q is an npn transistor with its emitter to ground and its collector (C) connected to +12 V through a 2.2 K resistor; the output Y is taken from the collector.]
junction saturation voltages and diode voltages in forward direction. Find the minimum value of .
Solution
Operation. This is a diode–transistor logic (DTL) gate. Neglect the diode forward drops and the transistor’s junction voltages, as instructed.
Any input LOW (0 V): the diode connected to that input is forward biased, so node P is clamped to about 0 V. The base then sees a divider between P (0 V) through 15 kΩ and −12 V through 100 kΩ: The base–emitter junction is reverse biased, Q is cut off, and the output is V (HIGH, 1).
All inputs HIGH (+12 V): all diodes are reverse biased (P cannot exceed +12 V). Current flows from +12 V through the 15 kΩ resistor and (15 kΩ) into the base, which is near 0 V: Part of it goes to −12 V through 100 kΩ: The base current is mA. Q saturates and V (LOW, 0).
Truth table (positive logic, 1 = +12 V):
| A | B | C | Y |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 0 |
The diodes with the pull-up resistor form an AND gate and the transistor an inverter: the circuit is a three-input NAND gate, . The capacitor is a speed-up capacitor for faster switching.
Minimum . In saturation the collector current is For saturation, :
✓ Checked by computer We computed the base currents in the two input states and the minimum h_fe in code.
Show that a negative logic OR gate is like a positive logic AND gate.
Solution
In positive logic the higher voltage represents 1 (H = 1, L = 0); in negative logic the lower voltage represents 1 (L = 1, H = 0).
Consider a gate whose voltage table is that of a positive-logic AND gate: the output is H only when both inputs are H.
| A | B | Y (voltages) | Positive logic | Negative logic |
|---|---|---|---|---|
| L | L | L | 0 0 → 0 | 1 1 → 1 |
| L | H | L | 0 1 → 0 | 1 0 → 1 |
| H | L | L | 1 0 → 0 | 0 1 → 1 |
| H | H | H | 1 1 → 1 | 0 0 → 0 |
Read in negative logic, the output is 0 only when both inputs are 0 and 1 otherwise – the OR function. So the same physical gate is a positive-logic AND and a negative-logic OR: a negative-logic OR gate is like a positive-logic AND gate (and likewise a negative-logic AND is a positive-logic OR). This is the duality principle: changing from positive to negative logic complements every variable, and by De Morgan .
✓ Proof checked step by step We checked the equivalence by comparing the two truth tables row by row.
Combinational switching circuit can perform an addition of the numbers held in two registers. (i) Write down the math table for the addition of two bits. (ii) Write down a Boolean expression for the necessary circuit functions. (iii) Arrive at the Exclusive-OR function. (iv) Draw the logic diagram for the circuit which performs the addition.
Solution
Principle of the half adder. Binary addition of two bits follows the rules The result needs two output bits: the sum S (the bit in the same column) and the carry C (the bit passed to the next column). A half adder adds two single bits A and B (it has no carry input, hence “half”).
(i) Truth (math) table for adding two bits.
| A | B | Sum S | Carry C |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
(ii) Boolean expressions (from the rows where each output is 1): (iii) Exclusive-OR. The sum is 1 when exactly one input is 1 – this is the exclusive-OR function: (Equivalently : “A or B, but not both”.)
(iv) Logic diagram. An XOR gate gives the sum and an AND gate the carry, both fed from A and B.
To add multi-bit numbers held in two registers, a half adder is used for the least significant bits and full adders (each made of two half adders and an OR gate) for the higher bits, the carry rippling from column to column.
✓ Checked step by step We checked the half-adder truth table and its XOR derivation step by step.
(i) What are sequential switching circuits (ii) Describe a simple sequential circuit. (iii) Describe a clocked RS Flip-Flop, (iv) Briefly describe ROMs.
Solution
(i) Sequential switching circuits. In a combinational circuit the outputs depend only on the present inputs. In a sequential circuit the outputs depend on the present inputs and on the past history – the circuit has memory, provided by storage elements (latches, flip-flops) and feedback. Its behaviour is described by a state table or state diagram. Examples: flip-flops, registers, counters, sequence detectors, memories.
(ii) A simple sequential circuit – the SR latch. Two NOR (or NAND) gates cross-coupled, the output of each fed back to an input of the other. With it holds whichever state it is in (memory); sets ; resets ; is not allowed. It stores one bit.
(iii) Clocked RS flip-flop.
Two NAND gates “steer” S and R into a NAND latch only while the clock is HIGH. When CLK = 0 both steering gates give 1 and the latch holds its state, whatever S and R do. When CLK = 1:
| S | R | |
|---|---|---|
| 0 | 0 | (no change) |
| 0 | 1 | 0 (reset) |
| 1 | 0 | 1 (set) |
| 1 | 1 | indeterminate (forbidden) |
The clock synchronises many flip-flops in a system so that they change state only at defined times. (Practical versions are edge triggered; the JK and D flip-flops remove the forbidden state.)
(iv) Read-only memories (ROMs). A ROM stores fixed binary data that can be read but not changed in normal operation; it is non-volatile (keeps its data without power). It consists of an address decoder that selects one of word lines from an -bit address, and an array of cells (diodes or transistors present or absent at the crossings) that put the stored word on the output bit lines. Any combinational function can be stored as a look-up table. Types: mask ROM (programmed during manufacture), PROM (fuses blown once by the user), EPROM (erasable by UV light), EEPROM and Flash (electrically erasable). Uses: firmware and BIOS, microprogram stores, look-up tables, code converters and character generators.
✓ Checked step by step We checked the descriptions of the clocked RS flip-flop and of ROMs step by step.
A circuit of a NOT gate is given in the figure below. Explain how you will determine the values of the resistances , R and .
[Figure: Single-transistor (npn, common-emitter) NOT gate. Input : a rectangular pulse of height 5 V applied between ground (o) and the input terminal; input connected through series resistor to the base. From the base node a resistor R goes down to a –5 V supply. Collector connected through load resistor to the +5 V supply; output taken from the collector. Emitter (arrow outward) connected to ground.]
Solution
The transistor works as a switch: input 0 V must make it cut off ( V), and input 5 V must make it saturate ( V). The resistor R to −5 V ensures firm cut-off.
1. Choose from the allowed collector current in saturation (and the fan-out and speed needed). For mA: A smaller gives faster switching and higher fan-out but more power.
2. Choose and for saturation when V. The base current is the current through minus that through R: (usually with a safety factor of 1.5–2 for overdrive).
3. Check cut-off when : with no transistor current the base voltage is set by the divider between 0 V and −5 V: which must stay below about 0 V even when the collector leakage (maximum temperature) flows out through , i.e. with some margin.
Example. kΩ, kΩ, kΩ, V: which saturates the transistor ( mA) if – comfortably met by a switching transistor with . At : V, so the transistor is firmly off. A speed-up capacitor across may be added.
✓ Checked by computer We checked the saturation and cut-off conditions for a sample design in code.
Simplify the given Boolean expression and draw the corresponding logic circuit using NAND gates:
Solution
Let . Then (distributive law). NAND realisation. (De Morgan), so one NAND gate makes (inputs tied) and a second NAND gate combines A and :
✓ Checked by computer We checked the simplification against the full truth table in code.
Simplify the following logic function and draw the corresponding logic diagram:-
Solution
First, (distributive law, ). Then This is the majority function: Y = 1 when at least two of the three inputs are 1 (it is also the carry of a full adder). It needs three two-input AND gates and a three-input OR gate.
✓ Checked by computer We checked the simplification against the full truth table in code.
Simplify the following logic function and draw the corresponding logic gates:
Solution
- ; then (absorption).
- ; then :
- : the last term matters only when , where it equals . So Y is 0 only for A = 1, B = 0, C = 0. Circuit: an inverter on A and a three-input OR gate (or, equivalently, a three-input NAND of A, and ).
✓ Checked by computer We checked the simplification against the full truth table in code.
Define ex-OR. Give its truth table and draw the possible logic blocks.
Solution
Basic gates (two inputs A, B; output Y).
| A | B | AND | OR | NAND | NOR | XOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
NOT: (A = 0 gives 1; A = 1 gives 0).
- AND: output 1 only if all inputs are 1 ().
- OR: output 1 if any input is 1 ().
- NOT: output is the complement of the input ().
- NAND (NOT-AND): – output 0 only when all inputs are 1.
- NOR (NOT-OR): – output 1 only when all inputs are 0.
Exclusive-OR (XOR). Output 1 when the inputs are different, 0 when they are the same: It can be built from AND, OR and NOT gates (two ANDs fed with and , followed by an OR), or from four NAND gates (below). It acts as an inequality detector, a controlled inverter and a modulo-2 adder (the sum output of a half adder); its complement is XNOR (equality).
Why NAND and NOR are universal gates. Any Boolean function can be written using AND, OR and NOT. Each of these can be built from NAND gates alone, or from NOR gates alone, so either type by itself can realise any logic circuit. (This simplifies manufacture: a whole IC can be made of one kind of gate.)
With NAND gates:
- NOT: tie the inputs together, .
- AND: NAND followed by a NAND inverter, .
- OR: invert each input with a NAND, then NAND them: (De Morgan). This is the required OR gate using only NAND gates (three gates).
With NOR gates:
- NOT: .
- OR: NOR followed by a NOR inverter, .
- AND: invert each input with a NOR, then NOR them: .
XOR using only NAND gates (four gates):
, , , . Then
✓ Checked step by step We checked every truth table and each NAND/NOR construction by evaluating all input combinations.
More on Solid State Physics, Devices and Electronics
- All Physics PYQ solutions, topic by topic
- Solid State Physics, Devices and Electronics topic-wise PYQs (questions only, for practice)
- Physics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Physics booklist
Questions: UPSC Civil Services (Main) Examination, Physics Paper II, 1996–2024. Solutions: Optional Province. Found an error? Tell us.

