GATE / CS ARCHIVE

GATE CSE 1996 / QUESTION 6(b)

Draw the counter output bits

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

GATE 1996, Q6(b) Descriptive
Report issue

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