Past exam question: 2082 Chaitra (Regular), Q3(a)
Open in the Padhaiko appDraw and explain the timing diagram of MVI M.
Solution
Instruction Structure & Machine Cycle Breakdown: MVI M, data (Opcode: 36H) is a 2-byte instruction that transfers an immediate 8-bit data byte into the memory location addressed by the HL register pair.
Execution requires 3 machine cycles and a total of 10 T-states:
- M1 (Opcode Fetch - OF): 4 T-states (T1–T4) — fetches the opcode 36H from memory address in PC.
- M2 (Memory Read - MR): 3 T-states (T5–T7) — reads the immediate 8-bit operand byte from memory address PC+1 into internal temporary register.
- M3 (Memory Write - MW): 3 T-states (T8–T10) — writes the immediate data byte into the memory location pointed to by HL.
Signal Activities Across Machine Cycles:
- M1 Cycle (T1–T4, Opcode Fetch):
- T1: PC higher byte placed on A15–A8; PC lower byte placed on AD7–AD0. ALE goes HIGH to latch lower address. Status: IO/M\_bar = 0, S1 = 1, S0 = 1.
- T2: AD7–AD0 enters high-impedance. RD\_bar goes LOW to enable memory output. PC is incremented.
- T3: Memory puts opcode 36H on data bus AD7–AD0. CPU latches opcode into Instruction Register. RD\_bar returns HIGH.
- T4: CPU decodes the opcode 36H and determines that an immediate byte and an external memory write are required.
- M2 Cycle (T5–T7, Memory Read):
- T5: PC higher byte on A15–A8; PC lower byte on AD7–AD0. ALE pulses HIGH. Status: IO/M\_bar = 0, S1 = 1, S0 = 0.
- T6: RD\_bar goes LOW. PC is incremented.
- T7: Memory places immediate data byte on AD7–AD0; CPU reads it into temporary register Z. RD\_bar goes HIGH.
- M3 Cycle (T8–T10, Memory Write):
- T8: H register contents placed on A15–A8; L register contents placed on AD7–AD0. ALE pulses HIGH. Status: IO/M\_bar = 0, S1 = 0, S0 = 1.
- T9: CPU places data from temporary register onto AD7–AD0. WR\_bar goes LOW.
- T10: Memory writes the data into location (HL). WR\_bar returns HIGH, terminating the write operation.
Timing Diagram Visualization:
The diagram visualizes the three consecutive machine cycles showing clock oscillations, address demultiplexing via ALE, status lines (IO/M\_bar, S1, S0), active-low RD\_bar during OF/MR, and active-low WR\_bar during MW.
The timing diagram of MVI M comprises 3 machine cycles: Opcode Fetch (4 T-states), Memory Read (3 T-states), and Memory Write (3 T-states), totaling 10 T-states to fetch opcode 36H, read the immediate data byte, and write it to location (HL).