Memory and Pipelines: GATE ECE practice questions with solutions
This topic covers memory size and address lines, chip arrays and decoding, addressing modes, instruction formats, CPI and pipelines. The 15 original questions follow the GATE EC format: 9 MCQ, 2 MSQ and 4 NAT, from 5 easy, 7 medium and 3 hard.
Three ideas to know:
- Address lines count locations; data lines count bits per location.
- A k-stage pipeline needs k + n − 1 cycles for n instructions.
- Total cycles = fill cycles + one per instruction + every stall cycle.
It helps GATE EC and ECE students revising Digital Circuits for the exam or a semester test. Helpful background: Pipelining and Addressing modes. Start with the 5 easy questions, then work up to the 3 hard ones.
Related
Q.1
EasyMCQ1 mark
A memory is organized as 64K × 8 (65,536 locations of 8 bits each). The number of address lines it needs is
Show answer and solutionHide answer and solution
Answer: (A)
Key idea: Address lines count locations; data lines count bits per location.
1. Each address picks one location. 2. 64K = 65,536 = 2¹⁶ locations.
3. So 16 address lines are needed; the 8 is the data width.
Common mistake: Counting every bit (64K × 8 = 2¹⁹) gives 19, option (D).
You need: Memory organization
Q.2
EasyMCQ1 mark
Which type of memory must be refreshed periodically to keep its data?
Show answer and solutionHide answer and solution
Answer: (B)
Key idea: DRAM stores charge (1 transistor, 1 capacitor) and needs refresh; SRAM stores state in a latch (6 transistors) and does not.
1. A DRAM cell stores a bit as charge on a small capacitor, which leaks away.
2. The charge must be read and rewritten every few milliseconds.
3. SRAM holds data in a latch, and ROM and flash are non-volatile.
Common mistake: Thinking that every volatile memory needs refresh and choosing SRAM, option (A).
You need: SRAM and DRAM
Q.3
EasyNAT1 mark
A memory of 8K × 8 is built from chips of 1K × 4. The number of chips needed is ______.
Numerical answer: type a number.
Show answer and solutionHide answer and solution
Answer: 16
Key idea: Multiply the number of chips needed for width by the number needed for depth.
1. Width: 8 ÷ 4 = 2 chips side by side.
2. Depth: 8K ÷ 1K = 8 rows.
3. Total 2 × 8 = 16 chips.
Common mistake: Expanding only the depth gives 8.
You need: Memory expansion
Q.4
EasyMCQ1 mark
In the instruction ADD R1, #5 (add 5 to R1 and store the result in R1), the operand #5 uses which addressing mode?
Show answer and solutionHide answer and solution
Answer: (C)
Key idea: Immediate operands are values; direct operands are addresses.
1. The # marks a constant that is part of the instruction itself.
2. An operand held inside the instruction uses immediate addressing.
Common mistake: Treating 5 as a memory address gives direct addressing, option (B).
You need: Addressing modes
Q.5
EasyMCQ1 mark
An ideal 5-stage pipeline with balanced stages and no stalls runs a very long program. Its speedup over the same design without pipelining approaches
Show answer and solutionHide answer and solution
Answer: (D)
Key idea: The ideal pipeline speedup equals the number of stages.
1. For n instructions on k stages, speedup = n·k ÷ (k + n − 1).
2. As n grows, this tends to k = 5.
Common mistake: Subtracting the fill cycles from the stage count gives 4, option (A); the fill cost vanishes for long programs.
You need: Pipelining
Q.6
MediumNAT2 marks
A 5-stage pipeline has a 2 ns clock (the stage delay including the pipeline register). With no stalls, the time to complete 100 instructions is ______ ns.
Numerical answer: type a number.
Show answer and solutionHide answer and solution
Answer: 208
Key idea: A k-stage pipeline needs k + n − 1 cycles for n instructions.
1. The first instruction takes 5 cycles.
2. Each of the other 99 finishes one cycle later.
3. Total (5 + 99) × 2 ns = 208 ns.
Common mistake: Multiplying 100 instructions by one cycle each gives 200 ns, which leaves out the 4 cycles needed to fill the pipeline.
You need: Pipelining, throughput
Q.7
MediumMCQ2 marks
A datapath takes 14 ns per instruction without pipelining. It is split into 4 stages of 3, 5, 4 and 2 ns, and each pipeline register adds 1 ns. For a very long program with no stalls, the speedup is about
Show answer and solutionHide answer and solution
Answer: (B)
Key idea: An unbalanced pipeline runs at the speed of its slowest stage, plus the register overhead.
1. The clock must fit the slowest stage plus the register: 5 + 1 = 6 ns.
2. One instruction finishes every 6 ns.
3. Speedup = 14 ÷ 6 = 2.33.
Common mistake: Leaving out the pipeline-register delay gives 14 ÷ 5 = 2.8, option (C).
You need: Pipelining, stage balance
Q.8
MediumMCQ2 marks
A processor has 32-bit instructions and 32 general-purpose registers. One instruction format has two register fields and a 16-bit immediate field, and the remaining bits form the opcode. The maximum number of opcodes in this format is
Show answer and solutionHide answer and solution
Answer: (C)
Key idea: Field widths are log₂ of the number of choices, and the fields must add up to the instruction length.
1. 32 registers need log₂ 32 = 5 bits per field, so 10 bits for two fields.
2. Opcode bits = 32 − 10 − 16 = 6. 3. 2⁶ = 64 opcodes.
Common mistake: Giving each register field 6 bits leaves 4 opcode bits and 16 opcodes, option (B).
You need: Instruction formats
Q.9
MediumMCQ1 mark
A load uses base-plus-displacement addressing: the base register R2 holds 0x1000 and the displacement in the instruction is 0x24. The effective address is
Show answer and solutionHide answer and solution
Answer: (A)
Key idea: Displacement addressing adds a constant from the instruction to a register.
1. Effective address = contents of the base register + displacement. 2. 0x1000 + 0x24 = 0x1024.
Common mistake: Using the displacement alone as the address gives 0x0024, option (B).
You need: Addressing modes
Q.10
MediumMSQ2 marks
For a classic 5-stage pipeline (IF, ID, EX, MEM, WB) with full forwarding and branches resolved in EX with no prediction (instructions after a taken branch are flushed), which of the following statements are true?
One or more options are correct.
Show answer and solutionHide answer and solution
Answer: (A), (C) and (D)
Key idea: Forwarding fixes ALU-to-ALU hazards but not the load-use case.
1. The loaded value is ready only after MEM, one cycle too late for the next instruction's EX, so one stall remains: (A) true and (B) false.
2. When the branch is resolved in EX, the two instructions fetched behind it (in IF and ID) are flushed: 2 cycles, (C) true.
3. (D) is the definition of a structural hazard.
Common mistake: Believing forwarding fixes everything and choosing (B).
You need: Pipeline hazards
Q.11
MediumNAT1 mark
A 4-bit × 4-bit unsigned multiplier is built as a ROM lookup table: the two operands form the address and the 8-bit product is the data. The ROM size in bits is ______.
Numerical answer: type a number.
Show answer and solutionHide answer and solution
Answer: 2048
Key idea: ROM size = 2^(address bits) × word width.
1. The address has 4 + 4 = 8 bits: 2⁸ = 256 words.
2. Each word holds the 8-bit product. 3. 256 × 8 = 2048 bits.
Common mistake: Counting only the number of words, 256, and forgetting the 8-bit width.
You need: ROM, lookup tables
Q.12
MediumMCQ2 marks
A program's instruction mix is 50% ALU instructions (CPI 1), 30% loads and stores (CPI 2) and 20% branches (CPI 3). The average CPI is
Show answer and solutionHide answer and solution
Answer: (D)
Key idea: Average CPI is weighted by how often each instruction type occurs.
1. CPI = Σ (fraction × CPI). 2. 0.5 × 1 + 0.3 × 2 + 0.2 × 3 = 0.5 + 0.6 + 0.6 = 1.7.
Common mistake: Averaging the three CPIs without weights, (1 + 2 + 3) ÷ 3, gives 2.0, option (A).
You need: CPU performance, CPI
Q.13
HardNAT2 marks
A 5-stage pipeline runs 1000 instructions. 20% are branches that each cause a 2-cycle penalty, and 10% are loads that each cause a 1-cycle stall; nothing else stalls. Counting the 4 cycles needed to fill the pipeline, the total number of clock cycles is ______.
Numerical answer: type a number.
Show answer and solutionHide answer and solution
Answer: 1504
Key idea: Total cycles = fill cycles + one per instruction + every stall cycle.
1. Without stalls: 5 + 999 = 1004 cycles.
2. Branch penalties: 1000 × 0.2 × 2 = 400 cycles.
3. Load stalls: 1000 × 0.1 × 1 = 100 cycles.
4. Total 1004 + 400 + 100 = 1504.
Common mistake: Leaving out the fill cycles gives 1000 + 500 = 1500.
You need: Pipelining, stalls
Q.14
HardMCQ2 marks
A 16K × 8 memory is built from eight 2K × 8 chips. A 3-to-8 decoder driven by address bits A13, A12, A11 selects chip 0 to chip 7, and A10 to A0 go to every chip. For the 14-bit address 0x2A5C, which chip is selected and what is the address inside that chip?
Show answer and solutionHide answer and solution
Answer: (B)
Key idea: Split the address at the decoder boundary: the high bits pick the chip, the low bits the location.
1. 0x2A5C = 10 1010 0101 1100 in 14 bits (A13 to A0).
2. A13 A12 A11 = 101 = 5, so chip 5 is selected.
3. A10 to A0 = 010 0101 1100 = 0x25C.
Common mistake: Reading the leading hex digit 2 as the chip number gives chip 2, option (A); the chip bits do not line up with hex digits.
You need: Memory address decoding
Q.15
HardMSQ2 marks
A single-cycle processor has a 8 ns clock. A multicycle version uses a 2 ns clock and needs 5 cycles for loads, 4 for stores, 4 for ALU instructions and 3 for branches. The program mix is 25% loads, 10% stores, 50% ALU and 15% branches. Which of the following statements are true?
One or more options are correct.
Show answer and solutionHide answer and solution
Answer: (A), (C) and (D)
Key idea: Compare designs by average time per instruction = CPI × clock period.
1. CPI = 0.25 × 5 + 0.10 × 4 + 0.50 × 4 + 0.15 × 3 = 1.25 + 0.40 + 2.00 + 0.45 = 4.1: (A) true.
2. Average time = 4.1 × 2 ns = 8.2 ns: (D) true.
3. The single-cycle design takes 1 cycle of 8 ns for every instruction: (C) true. 4. 8.2 ns > 8 ns, so the multicycle design is slightly slower here: (B) false.
Common mistake: Comparing only clock periods (2 ns against 8 ns) and choosing (B).
You need: Single-cycle and multicycle datapaths, CPI
Past GATE questions on this topic
- GATE 2026 EC, Q.42: Memory addressing (2 marks, MCQ)