Skip to main content

Timing diagram of STA, program time

Short answer

The program consists of MVI A,05H (7T), ADI 20H (7T), OUT 80H (10T), and HLT (5T), totaling 29 T-states. With T=1 µs, execution time is 29 µs.

Draw the timing diagram of STA instruction. Calculate the time taken to execute the following program if T = 1 micro second. MVI A,05H ADI 20H OUT 80H HLT

Timing diagram of STA

STA addr (opcode 32H) stores A at the 16-bit address given in the instruction. It has four machine cycles: opcode fetch (4T), memory read for the low address byte (3T), memory read for the high address byte (3T), memory write (3T) = 13T. Assume STA 8050H stored from 2000H.

M-cycleTA15-A8AD7-AD0ALEControlIO/M S1 S0
M1 (opcode fetch, 4T)T120H00H (PCL)1-0 1 1
T220HHi-Z (bus floats)0RD low0 1 1
T320H32H (opcode in)0RD low, rises at end0 1 1
T4--0none (decode)0 1 1
M2 (memory read, 3T)T120H01H1-0 1 0
T220HHi-Z (bus floats)0RD low0 1 0
T320H50H (data in)0RD low, rises at end0 1 0
M3 (memory read, 3T)T120H02H1-0 1 0
T220HHi-Z (bus floats)0RD low0 1 0
T320H80H (data in)0RD low, rises at end0 1 0
M4 (memory write, 3T)T180H50H1-0 0 1
T280HA (data out)0WR low0 0 1
T380HA0WR low, rises at end0 0 1
      |  M1 (OF)  | M2 (MR) | M3 (MR) | M4 (MW) |
      |T1 T2 T3 T4|T1 T2 T3 |T1 T2 T3 |T1 T2 T3 |
 ALE  |HI lo lo lo|HI lo lo |HI lo lo |HI lo lo |
 RD   |hi LO LO hi|hi LO LO |hi LO LO |hi hi hi |
 WR   |hi hi hi hi|hi hi hi |hi hi hi |hi LO LO |

Execution time of the program

T = 1 microsecond.

InstructionMachine cyclesT-states
MVI A,05HOF (4) + MR (3)7
ADI 20HOF (4) + MR (3)7
OUT 80HOF (4) + MR (3) + IOW (3)10
HLTOF (5)5
Total29

Time = 29 x 1 microsecond = 29 microseconds.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Microprocessor chapter 2 questions →