GATE / CS ARCHIVE

SUBJECT COLLECTION

Computer Organization & Architecture · Input/Output, DMA & Interrupts

51 questions, newest first

GATE CSE has asked 51 questions on Input/Output, DMA & Interrupts (Computer Organization & Architecture) from 1991 to 2026, in 28 of the 46 papers; the most recent is in GATE CSE 2026 Set 2. In the last five years it carried 0.8 marks per 100-mark paper on average, against 0.7 since 2003. Since 2014 the questions have been 7 MCQ and 3 NAT. 8 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
Show
1 mark · MCQ
Report issue

Vectored interrupts and daisy-chain priority

Input/Output, DMA & Interrupts

Question 18, GATE 2026: S1 says non-vectored interrupts usually take longer than vectored interrupts to start the device ISR. S2 says daisy-chain interrupt handling has the CPU poll every input device separately. Options: A both true; B both false; C only S1 true; D only S2 true.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

S1 says non-vectored interrupts usually take longer than vectored interrupts to start the device ISR. S2 says daisy-chain interrupt handling has the CPU poll every input device separately. Options: A both true; B both false; C only S1 true; D only S2 true.

Approach

Distinguish ISR dispatch from hardware priority resolution.

Step-by-step solution

1. A vectored interrupt supplies a vector that identifies the appropriate service routine, often by indexing an interrupt-vector table. This enables direct dispatch to the required ISR.
2. A non-vectored mechanism typically enters a common location and needs extra identification or dispatch work before the device-specific ISR starts. Thus S1 is true in the usual organization; it is a typical comparison, not a universal timing theorem about all CPUs.
3. In a daisy chain, an interrupt-acknowledge signal propagates through devices in priority order. A requesting device captures the acknowledgement and identifies itself; devices earlier in the chain have priority.
4. The CPU need not poll each device individually in that mechanism. That description belongs to software polling, so S2 is false and C is correct.

Original paper, page 15 · Answer key

1 mark · MCQ
Report issue

Ordering interrupt service entry

Input/Output, DMA & Interrupts

Question 11, GATE 2025: A non-pipelined single processor receives an asynchronous device interrupt while running a program. Order these steps: (i) save the program counter, (ii) load the ISR start address into the program counter, (iii) finish the current instruction. A iii,i,ii; B i,iii,ii; C i,ii,iii; D iii,ii,i. Options C and D continue on source page 11.
Question 11, GATE 2025: A non-pipelined single processor receives an asynchronous device interrupt while running a program. Order these steps: (i) save the program counter, (ii) load the ISR start address into the program counter, (iii) finish the current instruction. A iii,i,ii; B i,iii,ii; C i,ii,iii; D iii,ii,i. Options C and D continue on source page 11.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Approach: Preserve a consistent return point before redirecting instruction execution.
First finish the instruction already in progress: step iii. In the usual instruction-boundary interrupt model, this leaves the program’s architectural state consistent and determines the address at which it must resume. Interrupts are asynchronous arrivals, but service is begun at an instruction boundary.
Next save the program counter containing that resume address: step i. Finally load the ISR entry address into the program counter: step ii. Fetching now begins in the interrupt routine, and the saved address remains available for return.
The sequence is iii,i,ii, option A. B and C save before the current instruction has completed; D overwrites the return address with the ISR address before saving it. This ordering describes the stipulated simple processor, not an attempt to interrupt halfway through a partially completed instruction.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

Distinguish polling, interrupts and DMA

Input/Output, DMA & Interrupts

Question 15, GATE 2024: Which statement is false? A Cycle-stealing DMA transfers one word between an I/O device and memory in a stolen cycle. B Burst DMA offers higher bulk-transfer throughput than cycle stealing. C Programmed I/O uses the CPU better than interrupt-driven I/O. D Vectored interrupts can start their service routine faster than non-vectored interrupts.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Approach: Compare what the CPU must do while an I/O device is not ready, then check the other hardware statements.
1. In programmed I/O the CPU repeatedly polls device status and performs the transfer itself. Time spent waiting or polling is unavailable for useful work on other tasks.
2. With interrupt-driven I/O, the CPU can execute other work until the device signals that attention is required. In the standard comparison used here, this improves CPU utilization. Thus C reverses the expected relationship and is false.
3. Cycle stealing grants DMA a bus cycle for a word transfer, supporting A. Burst DMA keeps the bus for a block, reducing repeated arbitration overhead and supporting B for bulk traffic.
4. A vectored interrupt identifies the appropriate handler through a vector, whereas a non-vectored mechanism needs additional identification or dispatch. This supports D.
Answer: C. These are textbook comparisons under comparable conditions, not a claim that interrupt overhead is zero for every workload.

Original paper, page 10 · Answer key

1 mark · MCQ
Report issue

Convert DMA stolen cycles to bit rate

Input/Output, DMA & Interrupts

Question 11, GATE 2024: A 4 MHz processor gives 1% of its cycles to a cycle-stealing DMA controller. Each stolen cycle transfers 8 bytes to memory. Find the rate in bits/s. A 256000; B 3200; C 2560000; D 32000.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Approach: Keep the units in each multiplication: cycles/second × stolen fraction × bytes/cycle × bits/byte.

1. Derivation. DMA receives 0.01×4×10⁶=40000 processor cycles per second. Each transfers 8 bytes=64 bits, so the rate is 40000×64=2560000 bits/s, option C. The percentage applies to cycles, and the requested unit is bits rather than bytes.

2. Explanation and checks. One MHz means one million cycles per second, so the available total is 4000000 cycles/s. One percent is 0.01, not 0.1. The DMA transfers 320000 bytes/s; multiplying this intermediate result by eight gives the requested 2560000 bits/s. No additional device or memory bottleneck is specified, so the stipulated eight-byte-per-cycle transfer is used directly rather than introducing an extra latency.

Original paper, page 9 · Answer key

1 mark · NAT
Report issue

Input/Output, DMA & Interrupts

Question 34, GATE 2023: A keyboard produces one keystroke per second. Polling every 10 ms costs 100 μs per poll plus 200 μs per detected keystroke; its CPU-time fraction is T1. Interrupt handling and processing together cost 1 ms per keystroke; its fraction is T2. Find T1/T2 to one decimal place.
Tap to enlarge
Answer & solution

Official answer: 10.2

Polling every 10 ms means 100 polls per second, consuming 100×100μs=10000μs. Processing one keystroke adds 200μs, giving T1=10200μs/second. Interrupt-based processing consumes 1ms=1000μs per second, so T1/T2=10200/1000=10.2.

Teaching detail. Keep all quantities in the same unit before taking the ratio. Each second contains 1000/10=100 polling intervals, even though only one of those intervals typically detects a keystroke. Poll overhead is therefore paid 100 times, whereas keystroke processing is paid once. The fractions are T1=0.0102 and T2=0.001, and division gives 10.2. The interrupt approach's larger cost per event can still be much cheaper overall because it avoids 99 unproductive polling checks.

Original paper, page 32 · Answer key

1 mark · MCQ
Report issue

Input/Output, DMA & Interrupts

Question 17, GATE 2022: Which method gives the highest bulk hard-disk-to-main-memory throughput among A DMA; B interrupt-driven I/O; C polling; D programmed I/O?
Tap to enlarge
Your answer
Answer & solution

Official answer: A

DMA transfers a block directly between the device and memory after CPU setup, avoiding a CPU instruction sequence or interrupt per transferred word. For a large transfer it therefore provides the highest throughput among the offered programmed/interrupt-driven methods, A, under the ordinary comparable-hardware model.

With programmed or polling transfer, the CPU repeatedly tests status and moves data. Interrupt-driven transfer avoids continuous polling but still involves servicing the device. DMA amortizes CPU setup over a block and lets its controller perform the memory transfers, which is the relevant advantage for bulk throughput.

Original paper, page 14 · Answer key

1 mark · NAT
Report issue

Input/Output, DMA & Interrupts

Question 20, GATE 2021: DMA cycle stealing moves one 8-bit character per stolen CPU cycle. CPU is 2MHz and 0.5% of cycles are stolen at regular intervals. Find device data rate in bits/s.
Tap to enlarge
Answer & solution

Official answer: 80000

DMA uses 0.005·2, 000, 000=10, 000 CPU cycles per second. Each transfers 8 bits, giving 80, 000 bits per second.

Convert percentage before multiplication: 0.5%=0.005. A 2MHz clock supplies two million cycles each second, so stolen cycles transfer 10000 characters/s. Multiplying by 8 converts to bits/s; 10000 is the byte rate, not the requested bit rate.

Original paper, page 65 · Answer key

1 mark · MCQ
Report issue

Input/Output, DMA & Interrupts

Question 3, GATE 2020: Which statements are true? I Daisy chaining assigns interrupt priority. II For a vectored interrupt CPU polls to identify the source. III Polling periodically checks device status bits. IV During DMA the CPU and DMA controller can simultaneously be masters of the bus. Options: A I,II; B I,IV; C I,III; D III only.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Worked explanation

In a daisy chain an interrupt acknowledge passes through devices in order; the first requesting device captures it, establishing priority. In vectored handling, vector information selects the service routine, avoiding the source-identification poll claimed in II. Polling explicitly means testing device status, establishing III. DMA can overlap CPU computation that does not require the shared bus, but that is different from two simultaneous masters driving one shared bus. The conventional bus arbitration model permits one current owner, making IV false.

Derivation and answer

Daisy chaining imposes interrupt priority, and polling periodically examines device status, so I and III are true. A vectored interrupt supplies identification/vector information rather than requiring source polling. A single shared bus has one current master, so CPU and DMA controller cannot simultaneously master that bus. Thus C in the depicted conventional bus model.

Original paper, page 4 · Answer key

1 mark · MCQ
Report issue

Interrupt servicing order

Input/Output, DMA & Interrupts

Question 9, GATE 2018: After an interrupt during process L: P saves L status on control stack; Q finishes current instruction; R executes ISR; S restores L status; T loads ISR PC. Choose A QPTRS; B PTRSQ; C TRPQS; D QTPRS.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Method

At an instruction boundary the processor has a consistent state to save. Save that state before replacing the program counter, otherwise the return address and other status could be lost. Loading the interrupt-vector target transfers control to the handler; restoring saved state is meaningful only after the handler finishes. The model describes an ordinary precise interrupt, not an exception that aborts and restarts the current instruction.

Solution

Complete the current instruction(Q), save the interrupted process state(P), load the ISR entry PC(T), run the ISR(R), and restore the saved state(S). The order is QPTRS, A.

Original paper, page 6 · Answer key

2 marks · NAT
Report issue

Input/Output, DMA & Interrupts

Question 31, GATE 2016: A DMA controller has a 16-bit data-count register. It must transfer 29154 kilobytes from disk into byte-addressable main memory. What is the minimum number of bus acquisitions needed to transfer the file? Use the paper's binary kilobyte and block-transfer convention.
Tap to enlarge
Answer & solution

Official answer: 456.0 : 456.0

Our answer: 456

Under binary kilobytes and burst transfer, a 16-bit count supports at most 2¹⁶ bytes per programmed transfer (or 65535 under a literal maximum-count convention, which gives the same ceiling here). The file has 29154·1024 bytes. Ceiling(29154/64)=456 bus acquisitions. This assumes a DMA burst retains the bus for its programmed block; cycle stealing would count differently. Decimal kilobytes would yield 445, so the binary-unit convention matters.

The file contains 29853696 bytes. A count register bounds bytes per programmed block in byte-addressable memory, so use a ceiling:455 full 64 KiB blocks carry 29818880 bytes, leaving 34816 bytes for one more block. Rounding down would leave data untransferred. If the usable maximum count is 65535 rather than 65536,455 such blocks still fall short and 456 suffice. The answer concerns block ownership episodes, not one bus acquisition per individual byte.

Original paper, page 13 · Answer key

2 marks · MCQ
Report issue

Interrupt-entry micro-operations

Input/Output, DMA & Interrupts

Question 28, GATE 2013: Micro-operations are MBR←PC; MAR←X; PC←Y; Memory←MBR (write at MAR). Which operation can this implement? A instruction fetch; B operand fetch; C conditional branch; D interrupt-service initiation.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

MBR receives the current PC, MAR selects location X, PC is changed to Y, and the saved PC is written at X. This saves a return address and transfers control to another routine, consistent with interrupt-service initiation, D.

Track the values rather than just the register names. The old PC is copied into MBR before PC is overwritten, so it is preserved. MAR directs the final write to X, saving that old PC in memory. Loading Y into PC redirects execution. Together these actions save a return location and jump to a service routine, consistent with D. An instruction fetch would read memory into an instruction register/buffer rather than store the old PC to memory.

Original paper, page 6 · Answer key

1 mark · MCQ
Report issue

Priority of an overheating interrupt

Input/Output, DMA & Interrupts

Question 11, GATE 2011: A computer receives interrupts on excessive CPU temperature, mouse movement/button events, keyboard key press/release, and completed disk reads. Which should have the highest priority?

(A) Hard disk
(B) Mouse
(C) Keyboard
(D) CPU temperature sensor
Tap to enlarge
Your answer
Answer & solution

Official answer: D

An excessive CPU temperature can imminently damage hardware or invalidate operation, so the intended protective interrupt priority places it above routine disk, mouse and keyboard events. Thus D under the stated safety-oriented priority policy.

Priority is about the urgency and consequences of delaying service, not how frequently an event occurs. A mouse or keyboard event can ordinarily wait briefly without permanent harm; a completed disk read is also routine. An overtemperature condition needs immediate protective handling, such as throttling or shutting down, to prevent damage. Hence the temperature sensor is the intended highest-priority source, rather than whichever input device generates the most interrupts.

Original paper, page 3 · Answer key

2 marks · MCQ
Report issue

DMA versus programmed interrupt transfer

Input/Output, DMA & Interrupts

Question 28, GATE 2011: On a non-pipelined sequential processor, transferring 500 bytes uses this interrupt-service program: initialize address register; initialize count=500; LOOP: load one byte from device; store it to the address register's memory location; increment address register; decrement count; if count != 0 go to LOOP. Each load/store takes 2 cycles and every other statement takes 1 cycle. DMA instead needs 20 cycles for initialization/overheads and 2 cycles per byte. What is the approximate DMA speedup over the program?

(A) 3.4
(B) 4.4
(C) 5.1
(D) 6.7
Tap to enlarge
Your answer
Answer & solution

Official answer: A

The two initializations take 2 cycles. Each of 500 loop iterations uses 2 cycles for load, 2 for store and 1 each for increment, decrement and branch, totaling 7. Programmed transfer costs 3502 cycles. DMA costs 20+500×2=1020 cycles. Speedup3502/1020≈3.433, closest to 3.4, A.

Count the conditional branch even on its last, untaken execution: testing the condition is still an instruction. The loop therefore executes 500 loads, 500 stores and 1500 one-cycle bookkeeping instructions, in addition to the two initializations. DMA removes per-byte CPU loop bookkeeping but still pays its transfer cycles and setup. Speedup is old elapsed cycles divided by new elapsed cycles, not the reverse and not the difference between the two counts.

Original paper, page 8 · Answer key

1 mark · MCQ
Report issue

Interrupt recognition point

Input/Output, DMA & Interrupts

Question 8, GATE 2009: When does a CPU normally begin interrupt service? A immediately when raised; B after checking at the end of fetch; C after checking when the current instruction finishes; D at fixed time intervals.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

In the conventional instruction-cycle model, an enabled pending interrupt is checked after the current instruction completes, then control transfers to its service routine. This preserves an instruction boundary rather than interrupting immediately at an arbitrary internal step. Thus C.

The usual instruction-cycle model completes an instruction before recognizing a pending interrupt and saving a consistent next-instruction state. This gives C. An asynchronous request can arrive earlier, but arrival is not the same as immediate transfer of control. Fetch completion is too early in that simple model, and periodic checking is not the general interrupt mechanism. Architecture-specific restartable instructions and precise-exception implementations are finer details outside this convention.

Original paper, page 2

2 marks · MCQ
Report issue

Return address after interrupting INC

Input/Output, DMA & Interrupts

Question 73, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Now assume byte-addressable memory and 32-bit words. If an ordinary interrupt occurs while INC R3 executes, what return address is pushed onto the stack?
Options:
(A) 1005
(B) 1020
(C) 1024
(D) 1040
Question 73, GATE 2007: R1,R2,R3 are general-purpose registers. The program, operation, and size in words are:
MOV R1,(3000): R1←M[3000], 2 words
LOOP: MOV R2,(R3): R2←M[R3], 1 word
ADD R2,R1: R2←R1+R2, 1 word
MOV (R3),R2: M[R3]←R2, 1 word
INC R3: R3←R3+1, 1 word
DEC R1: R1←R1−1, 1 word
BNZ LOOP: branch if the result is nonzero, 2 words
HALT: stop, 1 word.
Initially M[3000]=10, R3=2000 and each location 2000–2010 contains 100. The program begins at location 1000; all these numbers are decimal.
Now assume byte-addressable memory and 32-bit words. If an ordinary interrupt occurs while INC R3 executes, what return address is pushed onto the stack?
Options:
(A) 1005
(B) 1020
(C) 1024
(D) 1040
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. Approach. Sum instruction lengths through the completed INC, multiply by four bytes per word, and add the program base. An ordinary interrupt resumes at the next instruction, not at the interrupted instruction’s starting address.

2. Derivation and interpretation. Instructions up through INC occupy 2+1+1+1+1=6 words. At 4 bytes per word, the next instruction DEC R1 is at byte address 1000+6*4=1024. An ordinary interrupt is serviced after the current instruction completes and saves the next instruction address, so C. The INC itself starts at 1020.

Original paper, page 18

1 mark · MCQ
Report issue

Shared interrupt request and grant lines

Input/Output, DMA & Interrupts

Question 19, GATE 2005: A CPU has one interrupt-request and one interrupt-grant line. What is possible? A neither vectored interrupts nor multiple devices; B multiple devices but no vectors; C both; D vectors but only one device.
Question 19, GATE 2005: A CPU has one interrupt-request and one interrupt-grant line. What is possible? A neither vectored interrupts nor multiple devices; B multiple devices but no vectors; C both; D vectors but only one device.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Multiple devices can share an interrupt-request line and arbitrate using a daisy-chained grant or an interrupt controller. The selected device can then place its vector on the data bus. Therefore both multiple devices and vectored interrupts are possible, C; one request wire does not require a single interrupt source.

A request wire signals that some device needs service; it need not encode which one. Arbitration through a controller or daisy-chain grant selects one requester, which can then supply an interrupt vector over another bus. Thus one shared request/grant pair does not limit the system to one device or one fixed service routine. C is possible; actual priority/fairness depends on the arbitration design.

Original paper, page 2

2 marks · MCQ
Report issue

Interrupt overhead versus polling

Input/Output, DMA & Interrupts

Question 69, GATE 2005: A10 KB/s device transfers bytes individually. Interrupt overhead 4 microseconds; byte-transfer time to CPU/memory negligible. Minimum intended performance gain using interrupts rather than program-controlled polling? A15; B25; C35; D45. Interpret as CPU occupation ratio and state unit convention.
Question 69, GATE 2005: A10 KB/s device transfers bytes individually. Interrupt overhead 4 microseconds; byte-transfer time to CPU/memory negligible. Minimum intended performance gain using interrupts rather than program-controlled polling? A15; B25; C35; D45. Interpret as CPU occupation ratio and state unit convention.
Tap to enlarge
Your answer
Answer & solution

Answer: B, approximately 25 (no official key was published)

Polling occupies the CPU throughout the interval between consecutive bytes. Using the decimal convention 10 KB/s=10000 bytes/s, this interval is 100 microseconds, whereas interrupt servicing costs 4 microseconds. CPU-time cost ratio is 100/4=25, option B. This compares CPU occupation, not device throughput, which is unchanged. With binary KB the exact ratio is 1/(10240×4×10−6)=24.4140625; 25 is the intended rounded/conventional option.

At 10000 bytes/s a byte arrives every 100 microseconds. Polling continually tests readiness and occupies the CPU for that whole interval. Interrupt service instead occupies only 4 microseconds per byte; the rest can run unrelated work. Their CPU cost ratio is 100/4=25. This is not a 25-fold faster physical device. Binary KB changes the exact ratio, hence the declared convention matters.

Original paper, page 9

2 marks · MCQ
Report issue

Cycle-stealing DMA blocking fraction

Input/Output, DMA & Interrupts

Question 70, GATE 2005: Disk:16 surfaces, 512 tracks/surface, 512 sectors/track, 1 KB/sector, 3000 rpm. DMA steals a 40 ns memory cycle for each four-byte word. Maximum CPU-blocked percentage: A10; B25; C40; D50. Check exact units rather than assuming one option is exact.
Tap to enlarge
Your answer
Answer & solution

Answer: B, approximate only (no official key was published)

One track passes the head per revolution; surfaces and tracks determine capacity, not a multiplier of simultaneous transfer rate. Rotation rate is 3000/60=50 revolutions/s. With binary KiB, the transfer rate is 512×1024×50 bytes/s. At four bytes per stolen cycle, memory is occupied for (512×1024×50/4)×40×10−9=0.262144 of the time, or 26.2144%. The nearest option is B (25%), but no option equals the exact result. Decimal KB gives 25.6%, still not exactly 25%; B requires approximate arithmetic.

Compute the streaming rate for the track under one active head:50 revolutions/s times 512 sectors/revolution times 1024 bytes/sector. Divide by 4 to obtain stolen cycles/s, then multiply by 40 ns/cycle. This dimensional chain yields 0.262144 seconds blocked per second. Multiplying by surfaces or total tracks would incorrectly assume simultaneous transfer from all disk positions. B is nearest, but 26.2144% is not exactly 25%.

Original paper, page 9

2 marks · MCQ
Report issue

Interrupt return address after halt

Input/Output, DMA & Interrupts

Question 63, GATE 2004: A CPU has user registers R1,R2,R3. Program in order (operation; instruction size in words): MOV R1,5000 (R1←Memory[5000];2); MOV R2,(R1) (R2←Memory[R1];1); ADD R2,R3 (R2←R2+R3;1); MOV 6000,R2 (Memory[6000]←R2;2); HALT (machine halts;1). Memory is byte-addressable with 32-bit words and the program starts at decimal 1000. If an interrupt occurs after HALT has executed, what decimal return address is saved on the stack?
Options:
(A) 1007
(B) 1020
(C) 1024
(D) 1028
Question 63, GATE 2004: A CPU has user registers R1,R2,R3. Program in order (operation; instruction size in words): MOV R1,5000 (R1←Memory[5000];2); MOV R2,(R1) (R2←Memory[R1];1); ADD R2,R3 (R2←R2+R3;1); MOV 6000,R2 (Memory[6000]←R2;2); HALT (machine halts;1). Memory is byte-addressable with 32-bit words and the program starts at decimal 1000. If an interrupt occurs after HALT has executed, what decimal return address is saved on the stack?
Options:
(A) 1007
(B) 1020
(C) 1024
(D) 1028
Question 63, GATE 2004: A CPU has user registers R1,R2,R3. Program in order (operation; instruction size in words): MOV R1,5000 (R1←Memory[5000];2); MOV R2,(R1) (R2←Memory[R1];1); ADD R2,R3 (R2←R2+R3;1); MOV 6000,R2 (Memory[6000]←R2;2); HALT (machine halts;1). Memory is byte-addressable with 32-bit words and the program starts at decimal 1000. If an interrupt occurs after HALT has executed, what decimal return address is saved on the stack?
Options:
(A) 1007
(B) 1020
(C) 1024
(D) 1028
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The five instructions occupy 2+1+1+2+1=7 words. Each word is 32 bits=4 bytes, so the program occupies 28 bytes starting at 1000.

2. Under the ordinary next-instruction-PC convention, after fetching/executing HALT the saved return address is 1000+28=1028. HALT itself begins at 1024;1007 would confuse word and byte addressing.

3. Teaching check: Instruction start addresses are 1000,1008,1012,1016,1024. HALT occupies one four-byte word, so the next sequential address is 1028. Saving 1024 would resume at HALT itself; saving 1007 wrongly treats byte-addressed memory as word-addressed.

Original paper, page 9

2 marks · MCQ
Report issue

Processor overhead for DMA blocks

Input/Output, DMA & Interrupts

Question 68, GATE 2004: A disk continuously transfers at 10 Mbytes/s using DMA. A 600-MHz CPU uses 300 cycles to initiate and 900 cycles to complete each 20-Kbyte DMA block transfer. What percentage of CPU time is consumed by transfer overhead?
Options:
(A) 5.0%
(B) 1.0%
(C) 0.5%
(D) 0.1%
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The CPU spends 300+900=1200 cycles per block, or 1200/(600×106)=2 microseconds. At 10 MB/s a 20 KB block takes approximately 2 milliseconds, so CPU overhead is 2 microseconds / 2 milliseconds ×100%=0.1%, D.

2. Consistent binary KB/MB units give about 0.1024%, still the stated approximation. This counts setup/completion CPU time, not the disk-transfer duration as busy CPU time.

3. Teaching check: DMA frees the CPU during the bulk data movement. Charge only 1200 CPU cycles per transfer, not the full disk-transfer interval. Using consistent seconds and clock cycles gives a dimensionless ratio before multiplying by 100 to express a percentage.

Original paper, page 10

1 mark · MCQ
Report issue

Interrupt acknowledge and an injected call

Input/Output, DMA & Interrupts

Question 1.9, GATE 2002: A device requests an interrupt through INTR. While which signal is active does it place a CALL instruction on the data bus?
(A) INTA (active-low interrupt acknowledge); (B) HOLD; (C) READY; (D) None of these.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: Distinguish request from acknowledgment.

Step 2: INTR requests CPU service. Once accepted, INTA tells the external device when it may drive the instruction information onto the data bus. HOLD instead requests bus-master control, and READY indicates whether a transfer can finish without wait states. Their roles do not provide the interrupt-instruction handshake.

Conclusion: For an 8085 INTR request, the external device supplies the instruction during the interrupt-acknowledge sequence, when active-low INTA is asserted. Thus A. HOLD concerns bus ownership and READY controls wait states.

Original paper, page 1

1 mark · MCQ
Report issue

Interfacing slow memory to the 8085

Input/Output, DMA & Interrupts

Question 1.9, GATE 2001: Which 8085 signal supports connecting slow memory: INTR, RESET IN, HOLD, or READY?
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: Slow memory may not complete a read or write within the processor’s ordinary bus cycle. The processor needs a way to extend that transfer without treating it as a new operation.

Step 2: Deasserting READY inserts wait states until the device is ready, so D. INTR requests interrupt service, RESET IN resets execution, and HOLD requests bus ownership; none is the normal memory-cycle wait-state handshake.

Original paper, page 2

Descriptive
Report issue

CPU occupation for byte interrupts

Input/Output, DMA & Interrupts

Question 8(c), GATE 2001: Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Task: Find the percentage of CPU time required for byte-wise interrupt-driven transfer.
Question 8(c), GATE 2001: Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Task: Find the percentage of CPU time required for byte-wise interrupt-driven transfer.
Tap to enlarge
Shared context

Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Answer & solution

Answer: 40.96% of CPU time during sustained disk transfer. (no official key was published)

1. The sustained disk rate is 50×16×1024=819,200 bytes/s. Each byte causes its own interrupt, so there are 819,200 interrupts per second of streaming transfer.

2. For each byte the CPU pays both 0.4 μs interrupt overhead and 0.1 μs memory read/write time. Total CPU service is 0.5 μs/byte.

3. CPU busy time per elapsed second is 819,200×0.5 μs=409,600 μs=0.4096 seconds. Therefore utilization is 0.4096×100=40.96%.

4. Counting only the interrupt overhead would give 32.768% and omit the specified data transfer cost. The remaining time can be used for unrelated computation under the stated model.

Original paper, page 8

Descriptive
Report issue

Cycle-stealing DMA occupation

Input/Output, DMA & Interrupts

Question 8(d), GATE 2001: Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Task: Find the maximum percentage of CPU time held up by cycle-stealing DMA.
Question 8(d), GATE 2001: Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Task: Find the maximum percentage of CPU time held up by cycle-stealing DMA.
Tap to enlarge
Shared context

Disk: 20 surfaces, 1000 tracks/surface, 16 sectors/track, 1 KB/sector, 3000 rpm; transfer one byte at a time. For CPU calculations memory transfer costs 0.1 μs/byte, interrupt overhead 0.4 μs/byte, DMA setup negligible and requests always granted. Use 1 KB=1024 bytes.

Answer & solution

Answer: Maximum CPU hold-up is 8.192% during sustained transfer. (no official key was published)

1. Cycle-stealing DMA transfers each byte directly between the device and memory. It does not invoke the CPU once per byte, so the 0.4 μs interrupt overhead does not apply.

2. The memory bus is taken for the specified 0.1 μs per byte. At 819,200 bytes/s, DMA occupies memory for 819,200×0.1 μs=81,920 μs per second.

3. If every stolen cycle would otherwise have been useful to the CPU, the CPU is held up for the full 0.08192 seconds per second: 8.192%. This is the requested maximum.

4. Actual processor slowdown can be lower if some stolen bus cycles overlap times when the CPU needs no memory service. Initialization and termination costs are excluded because the question explicitly makes them negligible.

Original paper, page 8

1 mark · MCQ
Report issue

Entering an 8085 wait state

Input/Output, DMA & Interrupts

Question 1.7, GATE 2000: Choose the signal action that inserts an 8085 wait state: lower HOLD, lower READY, raise HOLD, or raise READY.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step 1: READY tells the processor whether the current memory or I/O transfer can finish. When READY is low at its sampling point, the processor inserts wait states.

Step 2: Raising READY permits the transfer to proceed. HOLD is for requesting bus control, not the ordinary slow-transfer extension.

Therefore lower READY, B.

Original paper, page 1

1 mark · MCQ
Report issue

When an 8085 services an interrupt

Input/Output, DMA & Interrupts

Question 1.9, GATE 2000: When does the 8085 respond to an eligible TRAP request: immediately upon a high level, at the end of fetch, at instruction completion, or at unspecified regular intervals?
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Step 1: The processor normally completes the current instruction before transferring to an interrupt service routine, preserving a well-defined instruction boundary.

Step 2: Thus the textbook choice is C, at the end of execution rather than merely at opcode fetch or immediately on signal assertion.

Qualification: TRAP has edge-and-level triggering requirements; an arbitrary static high level alone is not a complete description of a valid new request. The answer concerns service timing after an eligible request.

Original paper, page 1

Descriptive
Report issue

8085 input timing boxes

Input/Output, DMA & Interrupts

Question 10(a), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: Give A,B,C,D in hexadecimal.
Question 10(a), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: Give A,B,C,D in hexadecimal.
Tap to enlarge
Shared context

The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Answer & solution

Answer: Intended IN: A=DBH, B=09H, C=09H, D=51H. Copying the printed table gives A=DAH but is inconsistent with IN. (no official key was published)

1. Opcode fetch addresses 3050H, placing 30H on the high address bus and 50H on the multiplexed low bus during its address phase. During its data phase, box A is the opcode byte.

2. The next memory cycle addresses 3051H. High address stays 30H; low address box D is 51H. Memory then returns the immediate port number, so box B is 09H.

3. For the I/O-read cycle, the 8085 places the eight-bit port address on both halves of the address bus. Thus high-address box C is 09H; the low address is also 09H during that cycle’s address phase.

4. The reproductions print DAH at 3050H. A literal transcription therefore fills A=DAH, B=09H, C=09H, D=51H in the intended diagram. Architecturally, however, IN has opcode DBH; DAH is JC addr16 and would require another address byte rather than this I/O cycle. No single execution satisfies both the table and the stated instruction.

5. For a corrected executable IN 09H use DBH at 3050H and keep B,C,D as above. For the literal DAH program, the missing byte at 3052H and initial carry are needed to determine the jump; there is no intended peripheral read.

Original paper, page 7

Descriptive
Report issue

ALE and read control during fetch

Input/Output, DMA & Interrupts

Question 10(b), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: State ALE and active-low RD at T1,T2,T3,T4.
Question 10(b), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: State ALE and active-low RD at T1,T2,T3,T4.
Tap to enlarge
Shared context

The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Answer & solution

Answer: ALE: pulse high in T1, low in T2–T4. RD̅: high, low, low, high. (no official key was published)

1. T1 is the opcode-fetch address phase. ALE pulses high so an external latch can retain the low address before AD₇…AD₀ is reused as a data bus. RD̅ remains inactive high.

2. In T2 and T3 the memory read is active: RD̅ is low and the addressed memory drives the opcode. ALE is low because the low address has already been latched.

3. T4 is internal decoding, not an additional memory read, so RD̅ is high and ALE is low. State-level summary (T1,T2,T3,T4): ALE=(pulse,0,0,0); RD̅=(1,0,0,1). A pulse is not a claim that ALE is high for the entire T1 interval.

4. These first four states are an opcode fetch for either DAH or DBH; thus the opcode discrepancy does not alter this control-signal answer. Subsequent cycles do differ, as explained in part (a).

Original paper, page 7

Descriptive
Report issue

Generating the peripheral read strobe

Input/Output, DMA & Interrupts

Question 10(c), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: Which signals are combined to tell the peripheral to put data on the bus?
Question 10(c), GATE 2000: The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Task: Which signals are combined to tell the peripheral to put data on the bus?
Tap to enlarge
Shared context

The printed 8085 instruction is IN 09H at memory 3050H, with table [3050H]=DAH, [3051H]=09H. In the intended ten-T-state IN trace, opcode fetch uses T1–T4, operand memory read T5–T7, and I/O read T8–TA. Box A is opcode data on AD₇…AD₀, box D is low address for operand fetch, box B is operand data, and box C is high address A₁₅…A₈ during I/O read. The figure initially shows high address 30H and low address 50H.

Answer & solution

Answer: Combine IO/M and RD̅; active-low IOR̅=¬(IO/M)∨RD̅, gated with the decoded port select. (no official key was published)

1. IO/M=1 identifies an I/O cycle, while RD̅=0 requests a read. A peripheral may drive the bus only when both conditions hold.

2. The active-high read condition is (IO/M) AND NOT(RD̅). Complementing gives the usual active-low I/O-read strobe IOR̅=NOT(IO/M) OR RD̅.

3. Truth table in order (IO/M,RD̅)=(0,0),(0,1),(1,0),(1,1) gives IOR̅=1,1,0,1. Thus a memory read does not activate the peripheral.

4. The individual device must also be selected by decoding port 09H; for active-high select S, its active-low enable is NOT S OR IOR̅. The requested common bus-control signals are IO/M and RD̅, with address decoding selecting which peripheral responds.

Original paper, page 7

1 mark · MCQ
Report issue

Entering the operating system

Input/Output, DMA & Interrupts

Question 1.11, GATE 1999: System calls are usually invoked by software interrupt, polling, indirect jump, or privileged instruction.
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

A user program must request a controlled transition to kernel code. A software trap or software interrupt supplies that entry point, saves the required return state and switches privilege as the architecture specifies. Thus A is the traditional description. An ordinary indirect jump does not itself authorize a privilege change, and polling is a waiting strategy rather than a syscall entry mechanism. Modern processors may use dedicated syscall instructions; the user-callable trap must not be confused with an instruction executable only after privilege has already been obtained.

Original paper, page 2

1 mark · MCQ
Report issue

Interrupt-priority policy

Input/Output, DMA & Interrupts

Question 1.18, GATE 1998: Which should receive higher interrupt priority: hard disk, printer, keyboard, floppy disk?
Tap to enlarge
Your answer
Answer & solution

Answer: Policy-dependent; A in a conventional overrun-sensitive transfer model (no official key was published)

Interrupt priority normally reflects urgency and the cost of delayed service, not merely a device name. A fast unbuffered hard-disk transfer may lose data if not serviced promptly, motivating A in an older transfer-driven design. A buffered DMA disk may need little immediate CPU attention, while another device could have a stricter deadline. Keyboard responsiveness can matter in interactive systems but does not universally outrank data-loss deadlines. The source gives no controller buffering or timing assumptions, so a hardware-independent unique ordering cannot be proved.

Original paper, page 2

1 mark · MCQ
Report issue

Instruction-boundary interrupt checks

Input/Output, DMA & Interrupts

Question 1.20, GATE 1998: Choose a true claim: all interrupts need enabling, loops cannot be interrupted, processor checks interrupts before a new instruction, only level-triggered interrupts exist.
Tap to enlarge
Your answer
Answer & solution

Answer: C under the ordinary instruction-boundary model (no official key was published)

An eligible interrupt is normally recognized at an architectural instruction boundary, before starting the next instruction, so C expresses the conventional model. Nonmaskable interrupts refute a blanket requirement that every interrupt first be enabled. A software loop comprises instructions and can be interrupted between them. Both edge- and level-triggered interrupt mechanisms exist. Some complex/restartable instructions have additional interrupt points, but these do not rescue the false universal claims in A, B, D.

Original paper, page 2

Descriptive
Report issue

Pulse-width measurement hardware

Input/Output, DMA & Interrupts

Question 15(a), GATE 1998: Draw an 8085-based system to measure the width of a TTL-compatible pulse. State necessary assumptions.
Question 15(a), GATE 1998: Draw an 8085-based system to measure the width of a TTL-compatible pulse. State necessary assumptions.
Tap to enlarge
Answer & solution

Answer: Use a gated hardware timer and read its frozen count. (no official key was published)

One valid design uses an 8253 programmable interval timer rather than relying on uncertain software polling time. Configure counter 0 in binary mode 0, initially load N0=65535, and feed it a known clock f. Connect the measured pulse to GATE0. While GATE0 is high the counter decrements; when it falls, counting stops and the retained value N is read. Width is approximately (N0−N)/f, with one-clock quantization and gate synchronization uncertainty.

8085 AD0–AD7 ↔ shared data bus ↔ 8253 D0–D7
            └─ ALE latch → low address bus
latched address, upper address, IO/M → port decoder → /CS
8085 /RD,/WR → 8253 /RD,/WR
latched A0,A1 → timer A0,A1
known oscillator f → CLK0
TTL pulse → GATE0 and a separate readable input-port bit 0

Map counter ports to 80h–82h and control to 83h; map the pulse input latch/buffer to 90h. The input buffer must be enabled only for reads of its port. Supply the usual clock, reset, power and bus support circuitry. Gate and clock levels must meet the timer's electrical/timing specifications; synchronize an asynchronous input if required, accounting for the resulting edge uncertainty.

Require the timer to be armed while the pulse is low. The 8253 count load is not complete merely when the second byte is written: allow a complete CLK rising-and-falling sequence after that write before the measured pulse may rise. After the pulse falls, allow the gate synchronization and counter propagation to settle before latching the result. Use a suitable guard interval or ready handshake based on the chosen timer clock and device timing. Require one isolated pulse, and fewer than 65535 counted clocks. Polling must detect the high interval before its falling edge; a separate edge latch can remove that minimum-width limitation. The hardware gate, not the polling latency, determines the count. No unique numerical width follows without the input waveform and f. Other valid designs include calibrated software loops, but their instruction timing and missed-edge error must be stated.

Original paper, page 7

Descriptive
Report issue

8085 timer readout program

Input/Output, DMA & Interrupts

Question 15(b), GATE 1998: Write an 8085 assembly program to measure a TTL pulse width, stating hardware and timing assumptions. Use the counter/port design of original Q15(a).
Question 15(b), GATE 1998: Write an 8085 assembly program to measure a TTL pulse width, stating hardware and timing assumptions. Use the counter/port design of original Q15(a).
Question 15(b), GATE 1998: Write an 8085 assembly program to measure a TTL pulse width, stating hardware and timing assumptions. Use the counter/port design of original Q15(a).
Tap to enlarge
Answer & solution

Answer: HL = number of gated clocks; width ≈ HL/f. (no official key was published)

Use the 8253 design in part (a), with pulse bit 0 readable at port 90h. Control byte 30h selects counter 0, low-byte then high-byte access, mode 0 and binary counting. Load FFFFh. After the falling edge, control byte 00h latches counter 0 without changing its mode; read low byte first.

WAITLOW: IN 90H
         ANI 01H
         JNZ WAITLOW
         MVI A,30H
         OUT 83H
         MVI A,0FFH
         OUT 80H
         OUT 80H
WAITHIGH:IN 90H
         ANI 01H
         JZ WAITHIGH
WAITEND: IN 90H
         ANI 01H
         JNZ WAITEND
         MVI A,00H
         OUT 83H
         IN 80H
         MOV E,A
         IN 80H
         MOV D,A
         MVI A,0FFH
         SUB E
         MOV L,A
         MVI A,0FFH
         SBB D
         MOV H,A
         HLT

DE receives the frozen count N. SUB/SBB perform the 16-bit subtraction FFFFh−DE, leaving the elapsed clock count in HL. The SUB's borrow is retained across MOV and MVI, so SBB correctly handles the high byte. Divide this integer by the known clock frequency to obtain seconds; for f=1 MHz each count represents roughly 1 μs.

This is not an unrestricted pulse-capture instrument: the pulse must start only after both count bytes are written and the subsequent complete CLK rising-and-falling loading sequence has occurred. A source-side guard/ready handshake enforces this requirement; the software does not issue a timer-ready signal. Also allow at least one clock period plus the specified propagation margin after the falling edge before the latch command. Choose the external clock relative to the 8085 clock so the displayed polling/readout path already provides that settling interval, or insert a calibrated delay before OUT 83H. The pulse must last long enough to be seen by WAITHIGH, remain low during readout, and not exhaust the initial counter value. Otherwise missed pulses or wrap/terminal-count behavior invalidate the result. A ready handshake, external trigger latch and overflow indication are appropriate extensions. The answer explicitly uses a timer peripheral, whose gate capture avoids treating variable software latency as measured time.

Original paper, page 7

1 mark · MCQ
Report issue

RST7.5 vector address

Input/Output, DMA & Interrupts

Question 2.2, GATE 1997: At which 8085 vector address does RST 7.5 start:0000H, 0075H, 003CH, 0034H?
Tap to enlarge
Your answer
Answer & solution

Answer: C: 003CH (no official key was published)

The 8085 vectored restart spacing is eight bytes. The RST 7.5 interrupt vector corresponds to 7.5·8=60 decimal, which is 3C hexadecimal. Thus the routine begins at 003CH, C. Writing 0075H would confuse the interrupt’s label with a hexadecimal address. The related RST 6.5 vector is 0034H, explaining another distractor.

Original paper, page 2

1 mark · MCQ
Report issue

Matching I/O and hardware roles

Input/Output, DMA & Interrupts

Question 2.4, GATE 1997: Match DMA I/O, cache, interrupt I/O, condition-code register with disk, high-speed RAM, printer, ALU.
Question 2.4, GATE 1997: Match DMA I/O, cache, interrupt I/O, condition-code register with disk, high-speed RAM, printer, ALU.
Tap to enlarge
Your answer
Answer & solution

Answer: B: 2, 1, 3, 4 (no official key was published)

DMA transfers blocks between a device such as a disk and memory without a CPU instruction for every word. Cache uses fast RAM to serve frequently accessed data. A printer is a conventional example of interrupt-driven I/O, while the ALU sets condition flags such as zero, carry or overflow. Thus the mapping is 2, 1, 3, 4, B. Device interfaces may support several transfer methods; these are representative associations rather than exclusive physical capabilities.

Original paper, page 2

3 marks · Descriptive
Report issue

Interface a one-bit 8085 port

Input/Output, DMA & Interrupts

Question 7(a), GATE 1997: An 8085 must drive a one-bit output port at I/O address FF hexadecimal through a D flip-flop. The transferred bit is D3, and the output must clear at power-on. Using exactly one ten-input NAND gate, one inverter and one D flip-flop, give the interface circuit. State clock/reset polarities explicitly.
Question 7(a), GATE 1997: An 8085 must drive a one-bit output port at I/O address FF hexadecimal through a D flip-flop. The transferred bit is D3, and the output must clear at power-on. Using exactly one ten-input NAND gate, one inverter and one D flip-flop, give the interface circuit. State clock/reset polarities explicitly.
Tap to enlarge
Answer & solution

Answer: D←D3; CLK←NAND(A15,…,A8,IO/M,NOT(/WR)); asynchronous clear from reset; Q is the port output. (no official key was published)

The eight-bit I/O address FFH is all ones. In an 8085 I/O cycle, that address is duplicated on the high address bus A15…A8, so these eight nonmultiplexed lines can be decoded without adding an address latch. Do not use AD7…AD0 directly throughout the write: those pins carry the data during the data phase.

Let /WR denote the active-low write strobe and IO/M=1 denote an I/O cycle. Use the one inverter to form W=NOT(/WR). The ten-input NAND receives A15,A14,…,A8,IO/M,W. Its output is
CLK = NOT(A15·A14·…·A8·IO/M·W).

A complete connection list is:
8085 D3 → D input of the flip-flop.
A15…A8, IO/M, NOT(/WR) → the ten NAND inputs.
NAND output → positive-edge-triggered CLK.
RESET OUT → active-high asynchronous CLEAR.
Q → the one-bit output.
Any asynchronous preset input is tied inactive.

For FFH on an I/O write, CLK goes low while /WR is asserted and rises when that write ends. The positive edge captures D3 while the data is valid. For another port, a memory cycle, or a nonwrite cycle, at least one NAND input is zero and the clock remains high. Asynchronous clearing makes Q=0 during the power-on reset independently of clock activity.

The flip-flop's clear polarity matters. The above netlist chooses an active-high CLEAR so the 8085's active-high RESET OUT connects directly. With an active-low /CLR device instead, connect the same active-low power-on /RESET IN net that resets the CPU to /CLR. Do not connect RESET OUT directly to /CLR and do not silently use a second inverter. The edge and reset assumptions are explicit because the question does not specify a particular flip-flop part. This is an ideal bus-timing design, assuming normal setup/hold timing and no wait-state or reset anomaly.

Original paper, page 6

2 marks · Descriptive
Report issue

Generate a seven-cycle square wave

Input/Output, DMA & Interrupts

Question 7(b), GATE 1997: An 8085 must drive a one-bit output port at I/O address FF hexadecimal through a D flip-flop. The transferred bit is D3, and the output must clear at power-on. Write an 8085 program producing equal ON and OFF intervals of seven bus/machine cycles each.
Question 7(b), GATE 1997: An 8085 must drive a one-bit output port at I/O address FF hexadecimal through a D flip-flop. The transferred bit is D3, and the output must clear at power-on. Write an 8085 program producing equal ON and OFF intervals of seven bus/machine cycles each.
Tap to enlarge
Answer & solution

Answer: MVI A,00H; LOOP: CMA; OUT FFH; JMP LOOP. Each steady-state half-period is 1+3+3=7 machine cycles. (no official key was published)

Only accumulator bit 3 affects this one-bit port. Complementing the entire accumulator is therefore enough to toggle the output: bit 3 alternates between 0 and 1. One program is

        MVI A,00H
LOOP:   CMA
        OUT FFH
        JMP LOOP

CMA takes one machine cycle, OUT takes three, and an unconditional JMP takes three. Between the end of one OUT and the end of the next OUT, the processor executes JMP, CMA and OUT. The total is 3+1+3=7 machine cycles. The same instruction path is used whether D3 is changing from 0 to 1 or from 1 to 0, so both steady-state half-periods are equal. At the FFH output port, values FFH and 00H alternate, but only their D3 bits are stored.

The initialization MVI is outside the loop and does not contribute to repeated periods. Power-on clearing ensures the initial output is low; the interval from reset release to the very first transition need not equal a later half-period. Interrupts and inserted wait states must be absent if exact timing is required.

Here “bus cycles” is interpreted as the 8085 machine-cycle count, not seven clock T-states. The instructions take 4+10+10=24 T-states in a normal execution, so a complete square-wave period is 14 machine cycles, or 48 T-states. Counting instruction bytes or taking “7” as seven T-states would give the wrong timing model.

Original paper, page 6

1 mark · MCQ
Report issue

Daisy-chain interrupt priorities

Input/Output, DMA & Interrupts

Question 1.24, GATE 1996: Does a daisy chain provide uniform priorities, nonuniform priorities, only support slow devices, or require a separate processor interrupt pin for every device?
Tap to enlarge
Your answer
Answer & solution

Answer: A: nonuniform priority (no official key was published)

An interrupt acknowledgment or grant propagates down the chain. The first requesting device encountered captures it and prevents later devices from using that grant. Priority therefore depends on physical position in the chain, so devices have nonuniform priority. This scheme is attractive partly because it can share processor interrupt infrastructure; it does not require one processor pin for every device. Nothing in the chaining principle restricts it exclusively to slow devices.

Original paper, page 3

Descriptive
Report issue

Draw the counter output bits

Input/Output, DMA & Interrupts

Question 6(b), GATE 1996: For the output-port program ORG 0100H; MVI A,00H; LXI H,0105H; OUT 00H; INR A; PCHL; HLT., show the three least significant output-bit waveforms. Account for the differing GateForum program without OUT and INR.
Question 6(b), GATE 1996: For the output-port program ORG 0100H; MVI A,00H; LXI H,0105H; OUT 00H; INR A; PCHL; HLT., show the three least significant output-bit waveforms. Account for the differing GateForum program without OUT and INR.
Tap to enlarge
Answer & solution

Answer: D0=01010101…, D1=00110011…, D2=00001111… (no official key was published)

Sample immediately after successive OUT instructions. The low-three-bit output words are 000,001,010,011,100,101,110,111,000,… . Reading each column gives D0: 0 1 0 1 0 1 0 1; D1: 0 0 1 1 0 0 1 1; D2: 0 0 0 0 1 1 1 1. These eight samples repeat. Between output writes the port latch holds its previous value, so each column is a rectangular waveform, not a series of impulses.

If Δ is the interval between writes, D0 has period 2Δ, D1 period 4Δ and D2 period 8Δ, all with 50% steady-state duty cycle. In normal 8085 timing OUT takes 10 T-states, INR A takes 4 and PCHL takes 6, so Δ=20 T-states without interrupts or wait states. Their periods are therefore 40,80,160 T-states. If only qualitative waveforms are required, the relative periods suffice.

Initialization precedes the first write, so the output before that write is not specified. This result belongs to the instruction stream interpreted as 8085.

Original paper, page 7

5 marks · Descriptive
Report issue

CPU overhead of continuous DMA transfers

Input/Output, DMA & Interrupts

Question 25, GATE 1996: A 50 MHz processor uses DMA for a disk transferring 2000 Kbytes/s continuously. The average DMA block is 4 Kbytes. Each transfer needs 1000 processor cycles for setup and 500 processor cycles for its completion interrupt. What fraction of CPU time is consumed by disk handling?
Tap to enlarge
Answer & solution

Answer: 0.015 of processor time, i.e. 1.5%. (no official key was published)

First count transfers rather than bytes: 2000 Kbytes/s divided by 4 Kbytes/transfer is 500 transfers/s. The same meaning of K occurs in both quantities and cancels, so decimal versus binary K does not change this rate.

The processor performs 1000+500=1500 cycles of administrative work for every transfer. At 500 transfers/s this costs 750,000 CPU cycles/s. A 50 MHz processor supplies 50,000,000 cycles/s, so the fraction used is 750,000/50,000,000=0.015, or 1.5 percent.

An equivalent time calculation checks the units. Each processor cycle lasts 1/(50×106) s=20 ns. Setup takes 20 microseconds and the completion handler takes 10 microseconds, totaling 30 microseconds per transfer. Transferring 4K bytes at 2000K bytes/s takes 0.002 s=2 milliseconds; 30 microseconds/2 milliseconds again equals 0.015. The transfer uses DMA, so the CPU is not charged for executing an instruction per byte. The calculation counts only the specified setup and completion overhead; additional bus-contention stalls, queuing effects, or other driver costs are not given and should not be invented. The statement that the disk transfers continuously fixes the block rate at its full throughput.

Original paper, page 10

1 mark · MCQ
Report issue

Vectored interrupt information

Input/Output, DMA & Interrupts

Question 1.3, GATE 1995: In a vectored interrupt, is the branch address fixed, supplied via an interrupt vector by the source, obtained from a processor register, or none?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

A vectored interrupt provides an identifying vector that selects the appropriate service routine, avoiding software polling of all sources. In the model described by B, the interrupting device or controller supplies this vector and the CPU uses it to obtain the branch target. Some architectures instead assign fixed vectors internally, such as fixed-priority vectored inputs, so source-supplied information is not a universal definition. A fixed-vector interpretation can also fit A. Thus B is the intended external-vector model, with that architectural assumption made explicit.

Original paper, page 1

Report issue

Multiplexed pins and execution time

Input/Output, DMA & Interrupts

Question 3.1, GATE 1994: True or false: multiplexing address/data lines in the 8085 reduces instruction execution time.
Tap to enlarge
Answer & solution

Answer: False (no official key was published)

The same AD0–AD7 pins carry low address bits during the address phase and data during later transfer phases. This saves package pins and wiring, not instruction time. An external latch controlled by ALE preserves the address while the pins are reused for data. Sharing lines can require additional timing constraints rather than making access intrinsically faster. Therefore the asserted speed benefit is false; the principal design tradeoff is interface cost and pin count.

Original paper, page 4

2 marks · Other
Report issue

CPU time retained by the main program

Input/Output, DMA & Interrupts

Question 6.8, GATE 1993: Interrupts arrive every 1 ms. The diagram shows 10 μs response delay while main code still runs, then 10 μs save,80 μs service,10 μs restore. What fraction remains for main execution?
Tap to enlarge
Answer & solution

Answer: 90% (no official key was published)

Only saving, servicing and restoring displace main-program execution: 10+80+10=100 μs per interrupt. Each arrival period is 1000 μs, leaving 900 μs for the main program, or 90%. The initial 10 μs response delay is drawn while main execution continues, so it must not be subtracted again. Doing so would give 89% and double-count time not actually lost. This assumes the depicted nonoverlapping periodic service and no extra overhead beyond the labeled intervals.

Original paper, page 5

Descriptive
Report issue

Masked interrupt priority logic

Input/Output, DMA & Interrupts

Question 5(b), GATE 1992: Three devices A,B,C use interrupt request lines INTR1>INTR2>INTR3. Draw priority logic with an interrupt mask register so A>B>C.
Tap to enlarge
Answer & solution

Answer: Gate each request with its mask enable and assign A to INTR1, B to INTR2, C to INTR3; optional explicit priority gating suppresses lower requests. (no official key was published)

Define mask-register bits MA,MB,MC with 1 meaning masked (disabled). Let RA,RB,RC be pending request signals. Form eligible requests a=RA∧¬MA, b=RB∧¬MB, c=RC∧¬MC.

Schematic using the processor’s specified priority mechanism:
RA ──AND(¬MA)──> INTR1 [highest]
RB ──AND(¬MB)──> INTR2
RC ──AND(¬MC)──> INTR3 [lowest]
       ↑ three-bit interrupt mask register

Because the processor already prioritizes the three lines, this wiring suffices. If an explicit one-hot external priority network is desired, use instead:

INTR1=a
INTR2=b∧¬a
INTR3=c∧¬a∧¬b.

These equations are also a gate-level schematic: invert a and b as needed and AND the shown eligible inputs. They ensure that only the highest-priority eligible device is presented at a time.

Priority must depend on eligible requests, not raw requests: a masked A must not suppress an unmasked B or C. With all requests asserted and masks 000, A wins; with MA=1 and others 0, B wins; with MA=MB=1, C wins. With every mask bit set, no interrupt is raised.

Assume a device holds its request until acknowledged, or use pending-request latches before these gates, so a lower request survives service of a higher one. Service clears only the acknowledged source’s pending request. Mask-register writes are controlled by the processor. If the hardware convention defines 1 as enabled, replace each ¬M by M; the priority relation itself is unchanged.

Original paper, page 5

2 marks · Other
Report issue

8086 mode with an 8087

Input/Output, DMA & Interrupts

Question 1(iv), GATE 1991: Which operating mode is required when the 8086 CPU works with an 8087 arithmetic coprocessor? Forum misprints the CPU as 8087.
Question 1(iv), GATE 1991: Which operating mode is required when the 8086 CPU works with an 8087 arithmetic coprocessor? Forum misprints the CPU as 8087.
Tap to enlarge
Answer & solution

Answer: Maximum mode (no official key was published)

The 8086 supports minimum mode for a simpler single-processor system and maximum mode for systems requiring multiprocessor/coprocessor bus coordination. The 8087 participates in the latter environment using the relevant status and request/grant signals. Therefore the 8086 must be configured for maximum mode, with MN/MX driven low.

Original paper, page 1

2 marks · Other
Report issue

Matching interface standards

Input/Output, DMA & Interrupts

Question 2(i), GATE 1991: Match IEEE488, IEEE796, IEEE696, RS232C to: P single-device connection; Q computer-device interconnection; R instrumentation bus; S Multibus.
Question 2(i), GATE 1991: Match IEEE488, IEEE796, IEEE696, RS232C to: P single-device connection; Q computer-device interconnection; R instrumentation bus; S Multibus.
Tap to enlarge
Answer & solution

Answer: IEEE488–R; IEEE796–S; IEEE696–Q; RS232C–P (no official key was published)

IEEE488 is the general-purpose instrumentation bus used to connect and control measurement equipment. IEEE796 standardizes the Multibus system bus. IEEE696 is the S-100 bus standard, giving the remaining computer-device interconnection association Q. RS232C defines a serial interface conventionally used for a point-to-point connection to one device, giving P. These are historical standard names rather than claims that each phrase is a unique exhaustive definition. Matching the two specific named buses first removes the otherwise broad wording of Q and P.

Original paper, page 2

2 marks · Other
Report issue

Matching 8086 control signals

Input/Output, DMA & Interrupts

Question 2(ii), GATE 1991: Match RQ/GT, LOCK, HOLD, READY with: P retain bus ownership during a critical sequence; Q insert wait states; R maximum-mode bus request/grant; S minimum-mode bus request.
Question 2(ii), GATE 1991: Match RQ/GT, LOCK, HOLD, READY with: P retain bus ownership during a critical sequence; Q insert wait states; R maximum-mode bus request/grant; S minimum-mode bus request.
Question 2(ii), GATE 1991: Match RQ/GT, LOCK, HOLD, READY with: P retain bus ownership during a critical sequence; Q insert wait states; R maximum-mode bus request/grant; S minimum-mode bus request.
Tap to enlarge
Answer & solution

Answer: RQ/GT–R; LOCK–P; HOLD–S; READY–Q (no official key was published)

RQ/GT pins perform the maximum-mode request/grant handshake with another bus master. LOCK indicates that a protected sequence must not be interrupted by granting the bus away. In minimum mode, HOLD requests the bus and the CPU responds with its hold-acknowledge signal. READY lets slower memory or peripherals extend a bus cycle through wait states until data can be transferred safely. Thus ownership negotiation and transfer timing are distinct: READY delays a transaction but does not itself request control of the bus.

Original paper, page 2

2 marks · MSQ
Report issue

8085 TRAP behavior with differing options

Input/Output, DMA & Interrupts

Question 3(iv), GATE 1991: GFG choices: A hardware RST; B external instruction via INTA; C execute from 20H; D NOP; E none. Forum omits A and relabels the rest. What does TRAP do?
Question 3(iv), GATE 1991: GFG choices: A hardware RST; B external instruction via INTA; C execute from 20H; D NOP; E none. Forum omits A and relabels the rest. What does TRAP do?
Tap to enlarge
Select all that apply
Answer & solution

Answer: A (hardware-vectored restart) (no official key was published)

TRAP is a nonmaskable vectored interrupt. The processor saves the return address and transfers control to its fixed vector 0024H, rather than fetching an instruction supplied by an external device via INTA. Thus 20H and NOP are wrong. The the phrase “executes an RST by hardware” describes that automatic restart-like transfer; it should not be confused with an external RST opcode or the normal software RST vector 20H.

Original paper, page 3

2 marks · MSQ
Report issue

8085 ALE purpose

Input/Output, DMA & Interrupts

Question 3(v), GATE 1991: What does ALE do: latch I/O output, disable chip select, latch address bits AD7–AD0, report TRAP enable status, none?
Question 3(v), GATE 1991: What does ALE do: latch I/O output, disable chip select, latch address bits AD7–AD0, report TRAP enable status, none?
Question 3(v), GATE 1991: What does ALE do: latch I/O output, disable chip select, latch address bits AD7–AD0, report TRAP enable status, none?
Tap to enlarge
Select all that apply
Answer & solution

Answer: C: enable latching of the low-order address (no official key was published)

The 8085 multiplexes the low eight address bits and data on AD7–AD0. Early in a bus cycle those pins carry address bits; afterward they carry data. ALE signals an external latch to capture the address during the address phase so that it remains available while the shared pins change function. It is therefore an address-demultiplexing control, not a general instruction-output latch or interrupt-status signal. The upper address bits have separate pins and do not require this same demultiplexing step.

Original paper, page 3

6 marks · Descriptive
Report issue

8085 output handshake and block transfer

Input/Output, DMA & Interrupts

Question 8(b), GATE 1991: Design an SSI/MSI interface for an 8085 with demultiplexed addresses. OUT 40H writes an output byte; IN 40H reads INTERRUPT in bit 7 and BUFFULL in bit 0. In the supplied timing diagram active-low write assertion clears INTERRUPT; write completion latches new data and sets BUFFULL. Device active-low STROBE assertion clears BUFFULL; STROBE completion sets INTERRUPT. Supply a block schematic and program transferring 200H bytes starting at memory 3400H.
Question 8(b), GATE 1991: Design an SSI/MSI interface for an 8085 with demultiplexed addresses. OUT 40H writes an output byte; IN 40H reads INTERRUPT in bit 7 and BUFFULL in bit 0. In the supplied timing diagram active-low write assertion clears INTERRUPT; write completion latches new data and sets BUFFULL. Device active-low STROBE assertion clears BUFFULL; STROBE completion sets INTERRUPT. Supply a block schematic and program transferring 200H bytes starting at memory 3400H.
Tap to enlarge
Answer & solution

Answer: Decode I/O address 40H, use an output latch, handshake flags and status tri-state buffer; poll bit 7 before each of 512 OUT operations. (no official key was published)

Use an 8-bit equality decoder for address 40H gated by IO/M=1. Let SEL denote that I/O decode. Form /W=NOT(SEL AND NOT /WR) and /R=NOT(SEL AND NOT /RD). Thus memory access at 0040H cannot accidentally activate the port. The shared address is safe because read and write select different circuitry.

Schematic

A[7:0],IO/M → address decoder → SEL → /W, /R gating.
CPU D[7:0] → 8-bit latch (transparent while /W=0) → DEVICE DATA.
/W falling → clear INTERRUPT; /W rising → close data latch, set BUFFULL.
/STROBE falling → clear BUFFULL; /STROBE rising → set INTERRUPT.
{INTERRUPT,0,0,0,0,0,0,BUFFULL} → tri-state buffer, enabled only by /R=0 → CPU data bus.

One implementation uses a BUFFULL D flip-flop with D=1 clocked by rising /W and asynchronously cleared while /STROBE=0. INTERRUPT uses D=1 clocked by rising /STROBE and asynchronously cleared while /W=0. Initialize BUFFULL=0 and INTERRUPT=1 when the device is ready. The external handshake must avoid overlapping write/acknowledge pulses that violate the flip-flops’ recovery times. Device data is stable after write completion and held until a later write. The timing diagram’s arrows refer to these separate leading/trailing edges, not merely inverse full/empty flags.

8085 program (hexadecimal literals):
    LXI H,3400H
    LXI B,0200H
WAIT_READY:
    IN 40H
    ANI 80H
    JZ WAIT_READY
    MOV A,M
    OUT 40H
    INX H
    DCX B
    MOV A,B
    ORA C
    JNZ WAIT_READY
WAIT_LAST:
    IN 40H
    ANI 80H
    JZ WAIT_LAST

BC counts 512 bytes; HL visits 3400H through 35FFH. The source RAM region for this subproblem must exist; it is independent of the smaller RAM map specified in part (a). Testing bit 7 waits for completion of the device strobe, whereas bit 0 can clear earlier at strobe assertion. The final loop waits for the last acknowledgement rather than returning with the final byte merely buffered. There is no timeout in this minimal program, so a nonresponsive device blocks indefinitely. Reading the status port does not clear either flag.

Original paper, page 6