GATE / CS ARCHIVE

GATE CSE 1998 / QUESTION 15(a)

Pulse-width measurement hardware

Computer Organization & Architecture · Input/Output, DMA & Interrupts · Full GATE CSE 1998 paper

GATE 1998, Q15(a) Descriptive
Report issue

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