- 2072 Magh · 5+3 marks
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-cycle | T | A15-A8 | AD7-AD0 | ALE | Control | IO/M S1 S0 |
|---|---|---|---|---|---|---|
| M1 (opcode fetch, 4T) | T1 | 20H | 00H (PCL) | 1 | - | 0 1 1 |
| T2 | 20H | Hi-Z (bus floats) | 0 | RD low | 0 1 1 | |
| T3 | 20H | 32H (opcode in) | 0 | RD low, rises at end | 0 1 1 | |
| T4 | - | - | 0 | none (decode) | 0 1 1 | |
| M2 (memory read, 3T) | T1 | 20H | 01H | 1 | - | 0 1 0 |
| T2 | 20H | Hi-Z (bus floats) | 0 | RD low | 0 1 0 | |
| T3 | 20H | 50H (data in) | 0 | RD low, rises at end | 0 1 0 | |
| M3 (memory read, 3T) | T1 | 20H | 02H | 1 | - | 0 1 0 |
| T2 | 20H | Hi-Z (bus floats) | 0 | RD low | 0 1 0 | |
| T3 | 20H | 80H (data in) | 0 | RD low, rises at end | 0 1 0 | |
| M4 (memory write, 3T) | T1 | 80H | 50H | 1 | - | 0 0 1 |
| T2 | 80H | A (data out) | 0 | WR low | 0 0 1 | |
| T3 | 80H | A | 0 | WR low, rises at end | 0 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.
| Instruction | Machine cycles | T-states |
|---|---|---|
| MVI A,05H | OF (4) + MR (3) | 7 |
| ADI 20H | OF (4) + MR (3) | 7 |
| OUT 80H | OF (4) + MR (3) + IOW (3) | 10 |
| HLT | OF (5) | 5 |
| Total | 29 |
Time = 29 x 1 microsecond = 29 microseconds.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Timing diagram of STA 8050H · Microprocessor, chapter 2
- Timing diagram of LDA 2080H · Microprocessor, chapter 2 · asked 2×
- Timing diagram of LXI D, 2465H · Microprocessor, chapter 2 · asked 2×
- Bus timing of OUT 42H · Microprocessor, chapter 2
- Machine cycle, T-states, ANI 55H timing · Microprocessor, chapter 2
- Execution of LDA 8B7FH with timing · Microprocessor, chapter 2
- Four-segment instruction pipeline and space-time diagram · Computer Organization and Architecture, chapter 4 · asked 5×
- SISO shift register with timing diagram · Digital Logic, chapter 7 · asked 9×
- SIPO register with timing diagram · Digital Logic, chapter 7 · asked 2×
- Program for RK-4 second order IVP · Numerical Method, chapter 6