CSC167 ยท 2079 ยท 10 marks
What is instruction cycle? Draw timing diagram of MOV A, B. Make necessary assumptions.
What is instruction cycle? Draw timing diagram of MOV A, B. Make necessary assumptions.[10]
Quick answer
Instruction Cycle is defined as the total time required to fetch and execute an entire instruction.
Instruction Cycle and Timing Diagram of MOV A, B
1. Instruction Cycle (Definition and Structure)
From the notes:
"The time required to execute and fetch an entire instruction is called instruction cycle."
The instruction cycle is given by:
$$IC = FC + EC$$
Where:
- FC = Fetch Cycle time
- EC = Execute (Execution) Cycle time
Components of Instruction Cycle
| Component | Description |
|---|---|
| Fetch Cycle | CPU fetches the opcode from memory using the address stored in the Program Counter (PC) and stores it in the Instruction Register (IR). Takes 4 T-states. |
| Execute Cycle | CPU decodes the instruction and performs the specific operation (data transfer, arithmetic, etc.). Takes 3 T-states (varies by instruction). |
Key Terms
- Machine Cycle: The time required by the microprocessor to complete one operation of accessing memory or I/O device. Consists of 3 to 6 T-states.
- T-State: One time period (clock period) of the microprocessor frequency. It is measured from the falling edge of one clock pulse to the falling edge of the next clock pulse.
- The 8085 microprocessor consists of 1 to 6 machine cycles per instruction.
2. Timing Diagram of MOV A, B
Assumptions
- Microprocessor used: Intel 8085
- Clock frequency: f (each T-state = 1 clock period = 1/f seconds)
- The instruction MOV A, B copies the content of register B into register A.
- Opcode of MOV A, B = 78H (1 byte instruction)
- The instruction is stored at memory address 2050H (assumption)
- Since MOV A, B is a register-to-register operation, it requires:
- 1 Machine Cycle (Opcode Fetch / M1) = 4 T-states
- No memory read/write is needed in execution (register operation is internal)
- Total T-states = 4
Machine Cycle Details
| Machine Cycle | Type | T-States | Operation |
|---|---|---|---|
| M1 | Opcode Fetch | T1, T2, T3, T4 | Fetch opcode 78H from memory address 2050H; decode and execute internally |
Note: For MOV A, B, the execution (moving data from B to A) happens internally during T4 of the opcode fetch cycle itself. No separate execution machine cycle is needed.
Timing Diagram
Clock:
___ ___ ___ ___
| | | | | | | |
______| |___| |___| |___| |______
T1 T2 T3 T4
|<---------- M1 (Opcode Fetch) ---------->|
ALE:
___
| |
_____| |_________________________________________
T1
(Address Latch Enable -- high during T1)
Address Bus (A15-A8) / AD7-AD0:
|--2050H--|
<valid> |
T1 |
(address lines go high-Z / data phase)
AD7-AD0 (Data Bus -- lower 8 bits multiplexed):
|--- 78H (Opcode) ---|
T2 T3
(Data valid on bus)
RD (Memory Read) -- Active LOW:
____________________
_____________| |_______________
T1 T2 T3 T4
(RD goes LOW -- memory read active)
(RD goes HIGH after T3)
IO/M (LOW = Memory operation):
_____________________________________________
(stays LOW throughout M1 -- memory operation)
S1, S0 (Status signals for Opcode Fetch = 1,0):
<S1=1, S0=0 during M1>
Internal Operation (T4):
Content of Register B is transferred to Register A
(No external bus activity)
Detailed Description of Each T-State
| T-State | Activity |
|---|---|
| T1 | PC content (2050H) is placed on the address bus. ALE goes HIGH to latch the lower 8-bit address. IO/M is set LOW (memory operation). |
| T2 | ALE goes LOW. RD signal goes LOW (active). The lower 8 address lines (AD0-AD7) switch to data bus mode. CPU waits for memory to respond. |
| T3 | Opcode 78H is read from memory and placed on the data bus. CPU reads the data into the Instruction Register (IR). RD goes HIGH. |
| T4 | CPU decodes the instruction internally. Content of register B is copied to register A. No external bus activity occurs. |
Summary
Instruction : MOV A, B
Opcode : 78H (1 byte)
Machine Cycles : 1 (Opcode Fetch)
T-States : 4
Operation : (A) <-- (B)
The timing diagram shows that MOV A, B completes in 4 T-states within a single machine cycle (M1). Since both source (B) and destination (A) are internal CPU registers, no additional memory access machine cycle is required, making it one of the fastest instructions in the 8085 instruction set.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.