GATE CS & DA Preparation Guide Module 5
Digital logic and computer organisation (CS sections 2-3) interview questions
Interview questions on digital logic and computer organisation (CS sections 2-3): warm-ups, then what each harder question tests and how a good answer starts.
Warm-up questions
Short questions with short answers, each answered in full.
-
Fresher
What is the difference between a prime implicant and an essential prime implicant?
Answered in the lesson Boolean minimisation: K-maps and the tabular method
-
Fresher
Why do computers store signed integers in two's complement rather than in sign-magnitude?
Answered in the lesson Circuit design, number systems and IEEE 754
-
Fresher
What is an effective address, and how many memory reads do direct and indirect addressing need for their operand?
Answered in the lesson Instruction sets, addressing modes, ALU and control
-
Fresher
What is locality of reference, and why does it let a small cache serve most memory accesses?
Answered in the lesson Memory hierarchy, interfacing and cache mapping
-
Fresher
Why is the speedup of a k-stage pipeline less than k in practice?
Answered in the lesson Pipelining, hazards, interrupts and DMA
Questions with model answers
What each question tests, the first step of a good answer and the follow-ups to expect.
-
Fresher to mid
A classmate's K-map program always circles the largest remaining group first. It passes every textbook example you try, then gives five terms where four are enough. What kind of function breaks it, and how would you change the algorithm so that it is always right?
- What it tests
- Understanding prime and essential prime implicants, why largest-first is a heuristic, and turning the chart procedure into a correct algorithm.
- First step
- Separate finding the groups from choosing them, and recall which groups every minimal cover must contain. Then ask whether the largest group on a map is always one of those.
- Follow-ups
-
- Is taking the essential prime implicants first always safe?
- What do you do when no essential prime implicant exists?
- How large can the chart get for 8 variables?
From the lesson Boolean minimisation: K-maps and the tabular method
Model answer, Pro. Model answers open with any pass; prices are in the notice on this page.Opening the model answers with your pass…
Model answers open with any MySmartCoPilot pass.
- Pro pass · 1 week₹79$2.99
- 30 days₹179$5.99
- 1 year₹1,699$45
One payment; a pass never renews. The price shown is the total you pay: no fees or charges are added at checkout.
Passes can’t be bought right now, so the model answers can’t be opened at the moment. If you have a pass, enter your licence key.
It also opens every other in-depth part in Learn and every Pro tool. Sales are final, except where the law gives you a right to withdraw, for example in the EU and the UK (refund policy).
In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Fresher to mid
For a function with don't-cares, your minimal sum of products and your minimal product of sums give different outputs on one input. A friend says one of them must be wrong. Is that true? Explain, and say how you would check both answers.
- What it tests
- What a don't-care means, how SOP and POS minimisation each use them, and checking an answer against the specified rows only.
- First step
- Recall what a don't-care promises: the input never occurs, or its output does not matter. Then ask whether the two expressions must agree on such an input for both to be correct.
- Follow-ups
-
- Can the minimal SOP and POS also differ in cost?
- Why not get the POS by factoring the SOP?
- When must a don't-care be fixed to a value?
From the lesson Boolean minimisation: K-maps and the tabular method
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher
A numerical answer question asks for the number of essential prime implicants of a four-variable function with two don't-cares. How do you get an exact count in about three minutes, and where do most candidates lose the mark?
- What it tests
- A reliable order of work on a K-map, the definitions of prime and essential prime implicants, and the role of don't-cares in the chart.
- First step
- Draw the map with the don't-cares, list every prime implicant before choosing anything, and only then look at each 1 to see how many of the listed groups cover it.
- Follow-ups
-
- How do don't-cares change which implicants are essential?
- How would you check the count in the remaining time?
- The question asks for prime implicants instead. What changes?
From the lesson Boolean minimisation: K-maps and the tabular method
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
An 8-bit ALU sets its signed overflow flag from the carry out of the most significant bit. Which additions does it get wrong, roughly how many of the 65,536 possible ones, and how should the flag be computed?
- What it tests
- The difference between unsigned carry and signed overflow, the carry-in versus carry-out rule, and checking a design rule exhaustively.
- First step
- Write down when a signed 8-bit sum really overflows: only when both operands have the same sign and the true sum leaves −128 to 127. Then compare that with when the carry out of bit 7 is 1, starting with −1 + 1.
- Follow-ups
-
- Why does the correct rule work for subtraction too?
- Which flag does an unsigned comparison use?
- How would you test the fix?
From the lesson Circuit design, number systems and IEEE 754
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
A program adds 0.1 to a single-precision total ten times and then tests whether the total equals 1.0. The test fails. Explain why, bit by bit, and say how you would compare floating-point results instead.
- What it tests
- How decimal fractions are stored in binary, rounding at every operation, the size of one unit in the last place, and tolerant comparison.
- First step
- Start with what is actually stored for 0.1: its binary expansion repeats, so single precision keeps the nearest value with a 24-bit significand, which is not exactly 0.1. Then follow what each addition does to the total.
- Follow-ups
-
- Would double precision make the test pass?
- Why is a fixed tolerance such as 1e-9 not always right?
- When is exact equality of floats correct?
From the lesson Circuit design, number systems and IEEE 754
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
You designed a mod-6 counter on three flip-flops, treating the two unused states as don't-cares. On some boards it sometimes never starts counting after power-on. What could have happened, and how do you change the design so it cannot?
- What it tests
- The meaning of don't-cares in state machines, analysing unused states, lock-out, and designing for a known start state.
- First step
- List the two unused states and work out where your next-state equations send each of them. Ask whether every unused state reaches the counting sequence, and what the flip-flops hold right after power-on.
- Follow-ups
-
- How would you check a design with many unused states?
- Is an asynchronous reset enough on its own?
- Does the choice of flip-flop type change the analysis?
From the lesson Circuit design, number systems and IEEE 754
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
A branch at byte address 2,000 on a machine with 4-byte instructions has the offset −12. Your friend says the target is 1,988 and you say 1,992. Who is right, what decides it, and what other answer could a third convention give?
- What it tests
- Reading PC-relative conventions precisely: which PC the offset is added to, and whether the offset counts bytes or instructions.
- First step
- Write down the two candidate bases: the address of the branch itself and the updated PC, the address of the next instruction. Then ask whether the offset counts bytes or whole instructions.
- Follow-ups
-
- What does RISC-V do?
- Why do processors use the updated PC at all?
- How far can a 12-bit offset reach in each convention?
From the lesson Instruction sets, addressing modes, ALU and control
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
A 16-bit instruction format has 4-bit register fields. It must hold 12 three-register instructions and at least 100 one-register instructions, and as many two-register instructions as possible. How many two-register instructions fit, and how much room is left for zero-register ones?
- What it tests
- Expanding opcodes: counting escape values, capacity per format, and planning the formats in the right order.
- First step
- Lay out each format's opcode width: 4 bits with three register fields, 8 bits with two, 12 with one and 16 with none. Count how many 4-bit values the three-register instructions leave as escapes, and what each escape opens in the next format.
- Follow-ups
-
- What if the one-register requirement were 120?
- Can the formats be planned in a different order?
- How would a decoder tell the formats apart?
From the lesson Instruction sets, addressing modes, ALU and control
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
You design the control unit of an 8-bit teaching processor with 40 instructions, and every year students will add new instructions to it. Would you build hardwired or microprogrammed control? Justify the choice with the costs you would estimate.
- What it tests
- The speed and flexibility trade-off between the two kinds of control, estimating control-memory size, and matching a design to how it will change.
- First step
- Start from the requirement that matters most here: instructions change every year. Then estimate what each design costs in speed, in memory and in the work of adding one instruction.
- Follow-ups
-
- How would you estimate the control memory?
- What does the choice cost in speed?
- Would you change your answer for a high-performance processor?
From the lesson Instruction sets, addressing modes, ALU and control
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
For a 32-bit processor you must choose a 32 KiB cache with 64-byte blocks, either direct-mapped or 4-way set-associative. Compare their tag storage and lookup hardware with numbers, and say which suits a loop that alternates between two arrays placed exactly 32 KiB apart.
- What it tests
- Address splitting, tag-directory sizing, the cost of associativity, and recognising conflict misses from an address pattern.
- First step
- Split the address for both caches: 512 lines, a 6-bit offset, and the index and tag that follow from the number of sets. Then work out which lines two addresses exactly one cache size apart map to.
- Follow-ups
-
- How many bits does LRU add to the 4-way cache?
- What does the 4-way lookup cost in time?
- Would a 64 KiB direct-mapped cache fix the loop?
From the lesson Memory hierarchy, interfacing and cache mapping
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
A routine over a 64 × 64 array of 4-byte integers becomes eight times slower after a colleague swaps its two loops. With a 4 KiB direct-mapped cache and 32-byte blocks, explain the slowdown with miss counts, and give two fixes other than swapping the loops back.
- What it tests
- Row-major layout, spatial locality, conflict misses from a power-of-two stride, and loop and data transformations.
- First step
- Work out how far apart in memory two consecutive accesses are in each loop order, and how many integers one block holds. Then find which cache lines the elements of one column map to.
- Follow-ups
-
- Why does a power-of-two row length make it worse?
- How does blocking help a matrix multiplication?
- Would a 2-way cache of the same size fix it?
From the lesson Memory hierarchy, interfacing and cache mapping
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
A logging service appends 100 MB of records per second and almost never reads them back. Would you want its stores to go through a write-back, write-allocate cache, or to bypass the cache? Estimate the memory traffic of each choice.
- What it tests
- Write policies and write-allocate, traffic estimates, cache pollution, and when streaming stores pay off.
- First step
- Follow one 64-byte block of log through each policy: what is read from memory on the first write, what is written when, and what else the block pushes out of the cache.
- Follow-ups
-
- What does the extra traffic do to the rest of the program?
- How do non-temporal stores help?
- When is write-back with write-allocate still the right choice?
From the lesson Memory hierarchy, interfacing and cache mapping
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
On a 5-stage pipeline, how many cycles does LW R1,0(R9); ADD R2,R1,R3; LW R4,8(R9); SUB R5,R4,R2; OR R6,R5,R1 take without forwarding and with full forwarding? Say which values are forwarded and which stalls remain.
- What it tests
- Finding RAW dependences, applying the stall rules with and without forwarding, and drawing or reasoning through a space-time diagram.
- First step
- List each instruction's sources and the instruction that last wrote each one, with the distance between them. Then state when your pipeline writes and reads the register file, because the stall counts depend on it.
- Follow-ups
-
- Can reordering the instructions remove the remaining stalls?
- What changes if branches or stores are added?
- How would a 7-stage pipeline change the counts?
From the lesson Pipelining, hazards, interrupts and DMA
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 3 minutes
-
Mid to senior
Your 5-stage pipeline decides branches in EX. 18 % of instructions are branches and 70 % of those are taken. Would you move the branch decision to ID, or keep it in EX and add a predictor that is right 90 % of the time? Compare the CPIs and the hidden costs.
- What it tests
- Branch penalties, the effect of prediction accuracy, and the clock-period cost of moving work into an earlier stage.
- First step
- Write the penalty of each option in cycles per branch, and say what each needs to fetch the right instruction early: a comparator and an adder in ID, or a predictor that also knows the target address at fetch.
- Follow-ups
-
- What if moving the decision to ID lengthens the clock by 5 %?
- Why does a predicted-taken branch need the target at fetch?
- Would a delayed branch help here?
From the lesson Pipelining, hazards, interrupts and DMA
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
-
Fresher to mid
A sensor delivers 2-byte samples, 250,000 a second, to a microcontroller whose interrupt handler takes 6 µs. Would you use one interrupt per sample, a 32-sample buffer with one interrupt per batch, or DMA? Show the processor time each one costs.
- What it tests
- Turning a device rate and overheads into processor and bus shares, and matching the input method to the rate.
- First step
- Find the time between samples first. Then compare it with the handler's 6 µs for one interrupt per sample, and work out how the share changes when one interrupt serves many samples.
- Follow-ups
-
- What does the handler's copying add for the 32-sample buffer?
- What does DMA cost the processor while it runs?
- Which method gives the lowest delay for each sample?
From the lesson Pipelining, hazards, interrupts and DMA
Model answer, Pro.In the answer:
- Model answer
- Follow-up answers
- Common mistakes
- Rubric
- Variants
- about 2 minutes
All GATE CS & DA Preparation Guide interview questions · The GATE CS & DA Preparation Guide track