Menu Close

Memories and programmable logic: UPSC Electrical Engineering Optional PYQ Solutions (1996–2026)

All 10 questions UPSC has asked on memories and programmable logic in the Electrical Engineering Optional (Paper I, Digital Electronics) from 1996 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Digital Electronics topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.

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 were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
  • ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.

Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.

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):

2026 · 7a 2020 · 1e 2016 · 7a 2012 · 7a 2011 · 6c 2005 · 7a(iii) 2003 · 8a(ii) 2000 · 5b(i) 1997 · 6b 1996 · 12c

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Design a Programmable Logic Array (PLA) for a combinational logic circuit that computes the square of 3-bit binary numbers. Determine the minimum number of product terms required and construct the corresponding PLA programming table for the implementation.

2026 · Paper I · Q7a · 20 marks

Solution

Truth table. Let the input be ABC (A the MSB) and the output B5B4B3B2B1B0. The largest square is 72=49, so 6 output bits are needed.

N A B C N2 B5 B4 B3 B2 B1 B0
0 0 0 0 0 0 0 0 0 0 0
1 0 0 1 1 0 0 0 0 0 1
2 0 1 0 4 0 0 0 1 0 0
3 0 1 1 9 0 0 1 0 0 1
4 1 0 0 16 0 1 0 0 0 0
5 1 0 1 25 0 1 1 0 0 1
6 1 1 0 36 1 0 0 1 0 0
7 1 1 1 49 1 1 0 0 0 1

Simplified outputs. Reading each column (with small K-maps): B0=C,B1=0,B2=BC, B3=ABC+ABC,B4=AB+AC,B5=AB. Two facts make this easy: a square is odd only when N is odd, so B0=C; and every square is 0 or 1 modulo 4, so B1 is always 0.

Minimum number of product terms.

  • B0, B2 and B5 need one term each: C, BC, AB.
  • B3 is 1 only for N = 3 (011) and N = 5 (101). These differ in two bits, so they cannot be merged: two terms, ABC and ABC.
  • B4 is 1 for N = 4, 5, 7. That is not a single cube, so it needs two terms: AB (4, 5) and AC (5, 7).
  • No term of one output can be reused by another without adding terms elsewhere.

So the PLA needs 7 product terms. A search over all term sets in code confirms that no 6-term set exists. The PLA is 3 inputs × 7 product terms × 6 outputs, with B1 tied to 0.

PLA programming table. In the input columns, 1 means the true input is connected, 0 the complemented input, and – no connection. In the output columns, 1 means the term is connected to that OR gate.

Term Product A B C B5 B4 B3 B2 B1 B0
1 C – – 1 – – – – – 1
2 BC – 1 0 – – – 1 – –
3 ABC 0 1 1 – – 1 – – –
4 ABC 1 0 1 – – 1 – – –
5 AB 1 0 – – 1 – – – –
6 AC 1 – 1 – 1 – – – –
7 AB 1 1 – 1 – – – – –
AAABBBCCC1234567B0 B2 B3 B4 B5 AND arrayOR array
PLA for the square of a 3-bit number (× = programmed connection; B₁ is tied to 0). On a phone, swipe sideways to see all of it.

Note: some PLA devices have a programmable inverter (XOR) on each output. With that option, outputs can be made from their complements, for example B4=A+BC, and the count drops to 5 terms. For a plain AND–OR PLA, 7 is the answer.

✓ Checked by computer We built the truth table in code and searched every set of product terms to confirm that 7 is the minimum.

↑ Back to the question list

Implement the following Boolean functions with a 4 × 3 Programmable Logic Array (PLA): F1=BC+AB; F2=ABC+ABCD; F3=ABCD+ABCD

2020 · Paper I · Q1e · 10 marks

Solution

Reading the question. We read “4 × 3 PLA” as a PLA with 4 inputs (A, B, C, D) and 3 outputs (F1, F2, F3). The number of product terms is for us to keep small.

Minterms. Writing each function in minterms (A the MSB): F1=BC+AB=Σm(0,1,8,9,10,11), F2=ABC+ABCD=Σm(10,12,13), F3=ABCD+ABCD=Σm(1,11).

Sharing terms. Taken as printed, the functions need six different terms. But AB in F1 covers minterms 8–11. Minterms 10 and 11 are exactly the terms ABCD (in F2) and ABCD (in F3), and 8, 9 are already inside BC. So F1=BC+ABCD+ABCD, which uses two terms the PLA must make anyway. Only 5 product terms are then needed:

Term Product A B C D F1 F2 F3
1 BC – 0 0 – 1 – –
2 ABC 1 1 0 – – 1 –
3 ABCD 1 0 1 0 1 1 –
4 ABCD 0 0 0 1 – – 1
5 ABCD 1 0 1 1 1 – 1
AAABBBCCCDDD12345F1 F2 F3 AND arrayOR array
4 × 5 × 3 PLA (× = programmed connection). On a phone, swipe sideways to see all of it.

Fewer is not possible. F3’s minterms 1 and 11 have no neighbours in F3, so it needs two 4-literal terms. F2 needs ABC and ABCD (minterm 10 is isolated in F2). F1 still needs a term for minterms 0 and 8. So the PLA is 4 inputs × 5 product terms × 3 outputs.

✓ Checked by computer We checked in code that the five product terms give exactly the three functions, and that no 4-term PLA can.

↑ Back to the question list

What is a PLA? Realize the following functions using an appropriate PLA: f1=AB+CD f2=AB+AB f3=AD+BC+BD

2016 · Paper I · Q7a · 10 marks

Solution

What is a PLA? A programmable logic array is a combinational device with:

  • an AND array, in which each product term can be connected to any input or its complement, and
  • an OR array, in which each output can be connected to any product term.

Both arrays are programmable, so any set of sum-of-products functions can be made, and a product term can be shared by several outputs. A PLA is described by its size: n inputs × k product terms × m outputs. In a PROM the AND array is fixed (a full decoder, all 2n minterms). In a PAL the OR array is fixed. The PLA is the most flexible of the three.

Product terms. f1=AB+CD,f2=AB+AB,f3=AD+BC+BD. Each expression is already minimal. In f3, all three terms are needed: minterm 13 (1101) is covered only by AD, minterm 6 (0110) only by BC, and minterm 1 (0001) only by BD. No term appears in two functions, so we need 7 product terms. The PLA is 4 × 7 × 3.

Term Product A B C D f1 f2 f3
1 AB 1 1 – – 1 – –
2 CD – – 1 1 1 – –
3 AB 0 1 – – – 1 –
4 AB 1 0 – – – 1 –
5 AD 1 – – 1 – – 1
6 BC – 1 1 – – – 1
7 BD – 0 – 1 – – 1
AAABBBCCCDDD1234567f1 f2 f3 AND arrayOR array
4 × 7 × 3 PLA (× = programmed connection). On a phone, swipe sideways to see all of it.

✓ Checked by computer We checked in code that the seven terms realise the three functions and that no 6-term PLA can.

↑ Back to the question list

What would be the binary address for a memory system having a capacity of 1024 bits. For the above memory system, what is the decimal address for the binary address 1011001101? What is the address in hexadecimal?

2012 · Paper I · Q7a · 20 marks

Solution

Reading the question. The printed “1024 bits” is a misprint for 1024 bits, a standard memory size.

Address length. Each bit needs its own address. 1024=210, so the address is 10 bits long. The addresses run from 00000000002(0)to11111111112(1023),that is 000H to 3FFH.

Decimal value of 1011001101. 1⋅29+0⋅28+1⋅27+1⋅26+0⋅25+0⋅24+1⋅23+1⋅22+0⋅21+1⋅20 =512+128+64+8+4+1=717.

Hexadecimal. Group the bits in fours from the right: 1011001101, that is 2, C, D. So the address is 2CD H. Check: 2×256+12×16+13=512+192+13=717.

Note: if the 1024 bits were arranged as 128 bytes (128 × 8), only log2128=7 address bits would be needed. The question asks for bit addresses, so 10 bits is the answer.

✓ Checked by computer We checked the conversions in code.

↑ Back to the question list

Write the full form of FPGA and explain why it is useful for prototyping of digital circuits.

2011 · Paper I · Q6c · 20 marks

Solution

Full form. FPGA stands for Field-Programmable Gate Array. “Field-programmable” means the user configures it after manufacture, at their own bench, not at the chip factory.

What it contains.

  • Configurable logic blocks (CLBs): each has small look-up tables (LUTs, typically 4–6 inputs) that can make any function of their inputs, plus flip-flops for sequential logic.
  • Programmable interconnect: routing channels and switch boxes that join the blocks in any pattern.
  • I/O blocks around the edge, configurable for different voltage standards.
  • In modern devices, also block RAM, multipliers (DSP blocks), clock managers and even processor cores.

The configuration is held in SRAM cells (in most FPGAs) and is loaded from a flash memory at power-up.

CLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FFCLBLUT + FF■ switch box — routing channel ▭ I/O block
Island-style FPGA architecture.

Why it is useful for prototyping.

  1. No fabrication step. A design written in VHDL or Verilog is synthesised, placed and routed, and loaded as a bit-stream in minutes. An ASIC needs masks and weeks or months in a foundry.
  2. Reprogrammable. If a bug is found, we change the code and reload the same chip. Many design iterations cost nothing extra.
  3. Real hardware at real speed. The circuit runs at tens to hundreds of MHz with real inputs and outputs. This finds timing and interface problems that simulation misses, and is far faster than simulating a large design.
  4. Low cost for small numbers. There are no mask (NRE) costs, so one or a few boards are cheap.
  5. Debugging aids. Internal signals can be watched with embedded logic analysers, and test logic can be added and removed freely.
  6. Path to production. The same HDL code can later be moved to an ASIC for volume production, or the FPGA itself can be shipped in low-volume products.

So FPGAs let a designer try out, test and correct a digital system in real hardware quickly and cheaply before committing it to silicon.

✓ Answer checked step by step We checked each point against standard descriptions of FPGA architecture and the design flow.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Using a bipolar 32×8 PROM, implement the following equations simultaneously: F1=Σm(0,1,3,5,7,21); F2=Σm(2,3,4,7,11,12,15,26); F3=Σm(8,9,11,13,20,23)

2005 · Paper I · Q7a(iii) · 5 marks

Solution

Size of the PROM. A 32 × 8 PROM has 32=25 words, so it has 5 address inputs A4A3A2A1A0, and 8 data outputs D0–D7. Each function of 5 variables is one output column. We use D0=F1, D1=F2, D2=F3, and leave D3–D7 unused (programmed 0).

Inside, the 5-to-32 decoder makes all 32 minterms (fixed AND array). The programmable OR array connects each minterm to the outputs that need it.

5-to-32decoderprogrammableOR array(fuses)A4 A3 A2 A1 A0 D0 = F₁D1 = F₂D2 = F₃D3 D4 D5 D6 D7 32 words × 8 bits
The 32 × 8 PROM used for three functions of five variables.

Programming table. Only the 17 addresses where at least one function is 1 are shown. All other words, and D3–D7 everywhere, hold 0.

Address (decimal) A4A3A2A1A0 F1 (D0) F2 (D1) F3 (D2)
0 00000 1 0 0
1 00001 1 0 0
2 00010 0 1 0
3 00011 1 1 0
4 00100 0 1 0
5 00101 1 0 0
7 00111 1 1 0
8 01000 0 0 1
9 01001 0 0 1
11 01011 0 1 1
12 01100 0 1 0
13 01101 0 0 1
15 01111 0 1 0
20 10100 0 0 1
21 10101 1 0 0
23 10111 0 0 1
26 11010 0 1 0

Programming a bipolar PROM. A bipolar PROM stores each bit as a small fuse link (nichrome or titanium–tungsten) in series with a transistor. As supplied, every fuse is intact. During programming, a current pulse blows the fuses at the bit positions that must change (for example, every position where the table shows 0, if an intact fuse reads as 1). It can be programmed only once. No minimisation is needed, because the PROM makes every minterm anyway.

✓ Checked by computer We listed the minterms of all three functions in code and built the PROM table from them.

↑ Back to the question list

It is desired to generate the following three Boolean functions F1=abc+abc+bc; F2=abc+ab+abc; F3=abc+abc+ac By using an OR gate array as shown in Figure, where P1 to P5 are the product terms in one or more of the variables, a,a,b,b,c and c. Write down the terms P1, P2, P3, P4 and P5.

P1 P2 P3 P4 P5 F1 F2 F3
Figure redrawn from the question paper.

2003 · Paper I · Q8a(ii) · 10 marks

Solution

Minterms of the three functions (a the MSB): F1=abc+abc+bc=Σm(2,3,5,7), F2=abc+ab+abc=Σm(2,5,6,7), F3=abc+abc+ac=Σm(0,1,3,7).

What the OR array needs. From the figure, F1=P1+P2, F2=P2+P3 and F3=P4+P5. So each function must be written as a sum of just two product terms, and F1 and F2 must share one of them.

F1 and F2. On a K-map, F1={2,3,5,7} splits only into {2,3}=ab and {5,7}=ac. F2={2,5,6,7} splits into {2,6}=bc and {5,7}=ac. The common term is ac: F1=ab+ac,F2=ac+bc.

F3. F3={0,1,3,7} splits into {0,1}=ab and {3,7}=bc: F3=ab+bc.

Answer. P1=ab,P2=ac,P3=bc,P4=ab,P5=bc. (P4 and P5 can be swapped; P1, P2, P3 are the only choice.)

aaabbbcccP1 P2 P3 P4 P5 F1 F2 F3 AND arrayOR array
The complete PLA: AND array for P₁–P₅ and the given OR array. On a phone, swipe sideways to see all of it.

✓ Checked by computer We checked in code that the five terms give all three functions, and that the choice of P1, P2 and P3 is unique.

↑ Back to the question list

This question has the following parts.

(i) Design a combinational circuit having 3 inputs and 6 outputs with the condition that the output number is square of the input number.

(ii) A computer uses RAM chips of capacity 1024 × 1. How many chips are required and how their address and data bus be connected to provide a memory capacity of 1024 bytes? How chips would be connected to provide memory of 16 K bytes?

2000 · Paper I · Q5b(i) · 10 marks · also asked 2000 (Q5b(ii))

Solution

(i) Squaring circuit. With input ABC (A the MSB) and output B5…B0, the truth table is:

N A B C N2 B5B4B3B2B1B0
0 000 0 000000
1 001 1 000001
2 010 4 000100
3 011 9 001001
4 100 16 010000
5 101 25 011001
6 110 36 100100
7 111 49 110001

Simplifying each output column: B0=C,B1=0,B2=BC,B3=C(A⊕B),B4=A(B+C),B5=AB. B1 is always 0 because every square is 0 or 1 modulo 4. The circuit needs two inverters, four AND gates, one XOR and one OR gate:

ABCBCB₀B₁ = 0B₂B₃B₄B₅
Gate circuit for the square of a 3-bit number.

The same table can also be stored in an 8 × 4 ROM (for B5, B4, B3, B2), with B0 and B1 wired directly.

(ii) Memory from 1024 × 1 RAM chips.

1024 bytes (1 KB). We need 1024×8 bits, but each chip gives 1024×1. So we need 1024×81024×1=8chips, connected side by side. All 8 chips share the 10 address lines A0–A9 (210=1024), the chip select and the read/write line. Each chip supplies one bit of the byte, so chip k is connected to data line Dk.

1K×1bit 7D7 1K×1bit 6D6 1K×1bit 5D5 1K×1bit 4D4 1K×1bit 3D3 1K×1bit 2D2 1K×1bit 1D1 1K×1bit 0D0 Address bus A₀–A₉ (10 lines, common)CS, R/W̅ (common)8-bit data bus D₇–D₀: one bit from each chip
1 KB from eight 1024 × 1 chips. On a phone, swipe sideways to see all of it.

16 KB. We need 16×1024×8 bits, so 16×1024×81024=128chips. They are arranged as 16 banks of 8 chips; each bank is a 1 KB block like the one above.

  • The address now needs log2(16×1024)=14 lines.
  • A0–A9 go to every chip and select the location inside a chip.
  • A10–A13 go to a 4-to-16 decoder. Each decoder output drives the chip-select of all 8 chips in one bank, so only one bank is active at a time.
  • Chip k of every bank is connected to data line Dk. The inactive banks keep their outputs in the high-impedance state.
4-to-16decoderA₁₃ A₁₂ A₁₁ A₁₀CS0D7 D6 D5 D4 D3 D2 D1 D0 bank 0(0000–03FF H)CS1D7 D6 D5 D4 D3 D2 D1 D0 bank 1(0400–07FF H)⋮CS15D7 D6 D5 D4 D3 D2 D1 D0 bank 15(3C00–3FFF H)A₀–A₉ to all 128 chips; chip Dk of every bank to data line Dk
16 KB from 128 chips: 16 banks of 8. Each decoder output selects all 8 chips of its bank. On a phone, swipe sideways to see all of it.

✓ Checked by computer We checked the squaring equations against all eight inputs and the chip counts in code.

↑ Back to the question list

Name the different types of Read- Only-Memories and briefly discuss their attributes in terms of programmability volatility, erasability, technology used and utility.

1997 · Paper I · Q6b · 20 marks

Solution

A read-only memory (ROM) keeps its data when the power is off. The types differ in how and how often the data can be written.

Type Programmed by Erasable? Technology Typical use
Mask ROM Manufacturer, with a custom metal mask No MOS or bipolar; a transistor is present or absent at each bit Large volumes of fixed code: character generators, firmware in mass products
PROM User, once, with a PROM programmer No (one-time) Bipolar fuse links (or antifuses); a fuse is blown to change a bit Small runs, prototypes, look-up tables, logic functions
EPROM User, electrically Yes, whole chip, by UV light through a quartz window (about 15–20 min) MOS floating-gate transistor (FAMOS); trapped charge stores a bit Development and low-volume firmware
EEPROM (E²PROM) User, electrically, in circuit Yes, electrically, byte by byte (about 10⁵–10⁶ cycles) Floating gate with thin tunnel oxide (FLOTOX) Settings, calibration data, small non-volatile stores
Flash User, electrically, in circuit Yes, electrically, in blocks One-transistor floating-gate cell (NOR or NAND) Firmware, memory cards, solid-state drives

Attributes in brief.

  • Volatility: all are non-volatile; data stay for years without power.
  • Programmability: fixed at the factory (mask ROM), once by the user (PROM), or many times by the user (EPROM, EEPROM, flash).
  • Erasability: none for mask ROM and PROM; UV erasure of the whole chip for EPROM; electrical erasure for EEPROM (byte) and flash (block). Writing is much slower than reading for all of them.
  • Technology and density: mask ROM and flash are the densest and cheapest per bit; EEPROM needs two transistors per cell, so it is less dense and dearer.
  • Utility: mask ROM for proven code made in volume; PROM and EPROM where code changes occasionally; EEPROM and flash where data must be updated in the field.

✓ Answer checked step by step We checked each entry against the standard descriptions of these memory types.

↑ Back to the question list

Explain what you understand by: (i) MMIC (ii) MOSFET (iii) NMOS Growth (iv) CMOS Development (v) RAM Device (vi) SRAM Cell (vii) DRAM Cell.

1996 · Paper I · Q12c · 20 marks

Solution

(i) MMIC – Monolithic Microwave Integrated Circuit. An IC that works at microwave frequencies (about 300 MHz to 300 GHz). All the active devices (GaAs MESFETs or HEMTs, HBTs) and passive parts (thin-film resistors, MIM capacitors, spiral inductors, microstrip lines) are made on one semi-insulating substrate, usually GaAs. MMICs are small, light, reproducible and need no tuning. They are used as low-noise amplifiers, power amplifiers, mixers, oscillators and switches in radar, satellite links and mobile phones.

(ii) MOSFET – Metal-Oxide-Semiconductor Field-Effect Transistor. A gate electrode sits on a thin SiO₂ layer over the channel between source and drain. The gate voltage controls the channel charge, and so the drain current, through the electric field; almost no gate current flows (input resistance about 1012 Ω or more). In an enhancement n-MOSFET, a channel forms only when VGS>VT; a depletion MOSFET has a channel at VGS=0. In saturation, ID=k(VGS−VT)2. MOSFETs are small and simple to make, so they are the basic device of digital ICs.

(iii) NMOS growth. Early MOS ICs used p-channel (PMOS) devices. In the 1970s n-channel (NMOS) technology replaced PMOS, because electrons have about 2–3 times the mobility of holes: NMOS gates were faster and smaller. With silicon-gate processes and depletion-mode load transistors, NMOS made the first large LSI chips possible: microprocessors such as the 8080, 8085 and Z80, and the early DRAMs. Its weakness is static power: a gate with its output low draws current all the time, which limits how many gates fit on one chip.

(iv) CMOS development. Complementary MOS (CMOS), invented in 1963, pairs a p-MOSFET and an n-MOSFET so that in either logic state one of them is off. Static current is therefore almost zero; power is drawn mainly while switching (P≈CVDD2f). CMOS also has rail-to-rail outputs and good noise margins. It was first used in watches and calculators. As chips grew to millions of gates in the 1980s, NMOS power became a problem, and CMOS took over almost all digital ICs: processors, memories and ASICs. Device scaling has kept CMOS the dominant technology since.

(v) RAM device. Random-access memory is read/write memory in which any location can be reached in the same time, by its address. A RAM has address lines, data lines and control lines (chip select, read/write). It is volatile: data are lost when the power is removed. The two kinds are static RAM (SRAM) and dynamic RAM (DRAM).

(vi) SRAM cell. Each bit is held in a latch of two cross-coupled CMOS inverters (four transistors). Two access transistors, switched on by the word line, connect the latch to the bit lines BL and BL. This makes the six-transistor (6T) cell. The data stay as long as power is on, with no refresh. SRAM is fast but takes more area per bit, so it is used for cache memory and registers.

QQBLBLWL
Six-transistor SRAM cell.

(vii) DRAM cell. Each bit is stored as charge on a small capacitor, reached through one access transistor (the 1T-1C cell). The word line turns on the transistor and the bit line reads or writes the charge. Reading destroys the stored charge, so the sense amplifier rewrites it. The charge also leaks away, so every cell must be refreshed every few milliseconds. The cell is very small, so DRAM gives the highest density and lowest cost per bit; it is used for main memory.

Bit lineWord lineCS
One-transistor DRAM cell.

✓ Answer checked step by step We checked each note against the standard device and memory-cell descriptions.

↑ Back to the question list

More on Digital Electronics

Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper I, 1996–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted