SlideShare a Scribd company logo
5
Most read
10
Most read
11
Most read
Lecture 03 
Fetch and Execute Cycle and 
Timing Diagrams 
Microcomputers and Microprocessors 
By: John Uffenbeck 
ECE @Saint Louis University, Baguio City 
1 
Prepared by: Engr. Jeffrey Des B. Binwag
Fetch and Execute Cycle 
• A fundamental process that a microprocessor 
repeatedly performs each time it runs a 
program. The microprocessor: 
1. Fetches the instruction byte from the address 
pointed to by the program counter (PC) and 
places it in the instruction register (IR) 
2. Increments the PC by 1 
3. Interprets the instruction byte in the IR and 
executes it accordingly 
4. Repeats the process until it is instructed to stop 
ECE @Saint Louis University, Baguio City 2 (END)
Fetch and Execute Cycle 
INSTRUCTION n 
PROGRAM 
INSTRUCTION 1 INSTRUCTION 2 
FETCH EXECUTE 
OP-CODE OPERAND 
ECE @Saint Louis University, Baguio City 3 (END)
Example 
• Determine the contents of register A, Address 1800, 
and the data bus after the execution of the following 
program. Determine the number of operand fetches, 
op-code fetches, and execute cycles. 
Address Mnemonics Machine Codes 
8000 LD A, (1800) 3A 00 18 
8003 LD B,A 48 
8004 IN A, (06) DB 06 
8006 ADD A, B 80 
8007 RST 38 FF 
ECE @Saint Louis University, Baguio City 4 (END)
Z-80 MEMORY I/O 
Data Bus 
ECE @Saint Louis University, Baguio City 5 (END) 
PC = 8000 
IR = CC 
A = DD 
B = FF 
Address Bus 
Control Bus 
8007 = FF 
8006 = 80 
8005 = 06 
8004 = DB 
8003 = 48 
8002 = 18 
8001 = 00 
8000 = 3A 
1800 = CF 
0001 = XX 
0000 = XX 
FF = XX 
FE = XX 
06 = 11 
05 = XX 
04 = XX 
03 = XX 
02 = XX 
01 = XX 
00 = XX
Machine Cycle Timing Diagram 
• A graphical representation of a program 
that breaks down a program as it is 
executed per machine cycle, while 
monitoring significant conditions and 
contents of registers, memory locations, 
I/O ports, and buses. 
ECE @Saint Louis University, Baguio City 6 (END)
Machine Cycles 
• A machine cycle is any operation in a microcomputer 
system that involves the activation of a control signal. 
Each instruction in a program can be broken down 
into several machine cycles. 
INSTRUCTION n 
PROGRAM 
INSTRUCTION 1 INSTRUCTION 2 
ECE @Saint Louis University, Baguio City 7 (END) 
Machine 
Cycle 1 
Machine 
Cycle n 
Machine 
Cycle 2
Example 
• Draw the machine cycle timing diagram for the following 
program while monitoring the control signals buses, 
registers, memory locations, and ports involved. 
Address Mnemonics Machine 
Codes 
Machine 
Cycles 
8000 LD A, (1800) 3A 00 18 
LD B,A 48 
IN A, (06) DB 06 
ADD A, B 80 
OUT (06), A D3 06 
LD (1800), A 32 00 18 
RST 38 FF 
ECE @Saint Louis University, Baguio City 8 (END)
Clock Cycles 
• Clock cycles define the amount of time it takes for an 
instruction to be executed. Clock Cycles are also 
called timing states or T-states. 
INSTRUCTION n 
PROGRAM 
INSTRUCTION 1 INSTRUCTION 2 
Clock Cycle 1 Clock Cycle 2 Clock Cycle n 
ECE @Saint Louis University, Baguio City 9 (END)
Clock Cycles for Z-80 Instructions 
• The Z-80 CPU User 
Manual provides 
detailed descriptions 
of each instruction 
including the number 
of T-states. 
ECE @Saint Louis University, Baguio City 10 (END)
Memory Timing 
ECE @Saint Louis University, Baguio City 11
Input/Output Timing 
ECE @Saint Louis University, Baguio City 12
Program Execution Time 
• Ideally, the program execution time of a 
microprocessor depends primarily on the total 
number of clock cycles for all the instructions in the 
program without considering other parameters like 
propagation and buffer delays. 
• Program execution time, TPE 
TPE = Total number of clock cycles/ fclock 
Where: fclock = microprocessor clock speed 
ECE @Saint Louis University, Baguio City 13 (END)
• Example: Compute the program execution time for 
the given program. How long does it take to execute 
the longest instruction? 
Address Mnemonics Machine 
Codes 
Clock Cycles 
8000 LD A, (1800) 3A 00 18 
LD B,A 48 
IN A, (06) DB 06 
ADD A, B 80 
OUT (06), A D3 06 
LD (1800), A 32 00 18 
RST 38 FF 
ECE @Saint Louis University, Baguio City 14 (END)
Thank You 
ECE @Saint Louis University, Baguio City 15

More Related Content

PPTX
ECESLU Microprocessors lecture 2
PPTX
ECESLU Microprocessors lecture
PPSX
PDF
Introduction to embedded computing and arm processors
PPT
Topic 6 Digital Technique Data buses
PDF
SOC Interconnects: AMBA & CoreConnect
PDF
SOC Design Challenges and Practices
PDF
self-test
ECESLU Microprocessors lecture 2
ECESLU Microprocessors lecture
Introduction to embedded computing and arm processors
Topic 6 Digital Technique Data buses
SOC Interconnects: AMBA & CoreConnect
SOC Design Challenges and Practices
self-test

What's hot (20)

PDF
System On Chip
PDF
SOC Application Studies: Image Compression
PPTX
An introduction to digital signal processors 1
PPTX
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
PPTX
Soc lect1
PPTX
System on Chip (SoC)
PPT
Jeremy
PDF
Micro Processor And Micro controller
PPSX
System on chip buses
PPSX
CISC & RISC ARCHITECTURES
PPT
Unit 4-PROGRAMMABLE LOGIC INTERFACE-ME6702– MECHATRONICS
PPTX
ARM Cortex-M3 Training
DOC
Chandan Kumar_3+_Years _EXP
PPT
MPLAB Starter Kit for PIC18F MCUs
PPTX
System-on-Chip Programmable Retina
PDF
SOC System Design Approach
PPSX
System on chip architectures
PDF
Lecture 1 microcontroller overview
PPTX
2.instrumentation ii
PPT
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
System On Chip
SOC Application Studies: Image Compression
An introduction to digital signal processors 1
UNIT II –8085 MICROPROCESSOR AND 8051 MICROCONTROLLER---ME6702– MECHATRONICS
Soc lect1
System on Chip (SoC)
Jeremy
Micro Processor And Micro controller
System on chip buses
CISC & RISC ARCHITECTURES
Unit 4-PROGRAMMABLE LOGIC INTERFACE-ME6702– MECHATRONICS
ARM Cortex-M3 Training
Chandan Kumar_3+_Years _EXP
MPLAB Starter Kit for PIC18F MCUs
System-on-Chip Programmable Retina
SOC System Design Approach
System on chip architectures
Lecture 1 microcontroller overview
2.instrumentation ii
Unit 3-PROGRAMMABLE PERIPHERAL INTERFACE-ME6702– MECHATRONICS
Ad

Viewers also liked (20)

PPTX
Data link control protocol(4)
PPTX
SLU ECE 528T1: Design of Communication Systems Module 1
PPTX
ECE 528T1: Design of Communication Systems Module 3
PPTX
Datacom module 2: Data Communication Architecture, Protocols, and Standards
PPTX
Data link control protocol(3)
PPTX
Datacom module 3: Data Communications Circuits, Arrangements, and Networks
PPTX
Datacom module 1: Introduction to Data Communications
PPTX
Psdn and ccitt x series
PPTX
Data link control protocol(2)
PPTX
Data link control protocol(1)
PPTX
ECE 528T1: Design of Communication Systems Module 2
PPTX
Datacom module 5 (UART, USRT, Serial Interface, Modem)
PPTX
Datacom module 4: Fundamentals of Data Communication
PPTX
Process & Control Hardware plus fetch-execute cycle
PPT
Fetch-execute Cycle
PPT
Fetch Execute Cycle
PPTX
Microprocessor Week 10: Applications
PDF
LeverX - A Comprehensive Guide to SAP PLM 7.01
PPSX
Microsoft Dynamics NAV 2009 R2
Data link control protocol(4)
SLU ECE 528T1: Design of Communication Systems Module 1
ECE 528T1: Design of Communication Systems Module 3
Datacom module 2: Data Communication Architecture, Protocols, and Standards
Data link control protocol(3)
Datacom module 3: Data Communications Circuits, Arrangements, and Networks
Datacom module 1: Introduction to Data Communications
Psdn and ccitt x series
Data link control protocol(2)
Data link control protocol(1)
ECE 528T1: Design of Communication Systems Module 2
Datacom module 5 (UART, USRT, Serial Interface, Modem)
Datacom module 4: Fundamentals of Data Communication
Process & Control Hardware plus fetch-execute cycle
Fetch-execute Cycle
Fetch Execute Cycle
Microprocessor Week 10: Applications
LeverX - A Comprehensive Guide to SAP PLM 7.01
Microsoft Dynamics NAV 2009 R2
Ad

Similar to ECESLU Microprocessors Lecture 3 (20)

PPT
Computer Performance Evaluation(CPI).ppt
PPTX
20IT204-COA- Lecture 17.pptx
PPT
Basic MIPS implementation
PPT
Basic MIPS implementation
PDF
IRJET- A Testbed for Real Time Water Level Control System
PPT
Pipelining _
PPTX
BCSE205L-Module 3 _Datapath Computer Architecture Org.pptx
PDF
Teach-In : Ladder Logic for PIC Micro
PDF
Compuer organizaion processing unit
PPTX
concept of computer organisation and architechture
PPT
Machine cycles
PPT
Pipelining and co processor.
PPTX
MIPS IMPLEMENTATION.pptx
PDF
List of Experiments perfomed in DSM-Lab.pdf
PDF
CP Handout#1
PPTX
Computer Organization
PDF
bec306c Computer Architecture and Organization
PPTX
Control unit
PPTX
Pipelining of Processors Computer Architecture
Computer Performance Evaluation(CPI).ppt
20IT204-COA- Lecture 17.pptx
Basic MIPS implementation
Basic MIPS implementation
IRJET- A Testbed for Real Time Water Level Control System
Pipelining _
BCSE205L-Module 3 _Datapath Computer Architecture Org.pptx
Teach-In : Ladder Logic for PIC Micro
Compuer organizaion processing unit
concept of computer organisation and architechture
Machine cycles
Pipelining and co processor.
MIPS IMPLEMENTATION.pptx
List of Experiments perfomed in DSM-Lab.pdf
CP Handout#1
Computer Organization
bec306c Computer Architecture and Organization
Control unit
Pipelining of Processors Computer Architecture

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
composite construction of structures.pdf
PDF
Digital Logic Computer Design lecture notes
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPT
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Geodesy 1.pptx...............................................
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
DOCX
573137875-Attendance-Management-System-original
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Construction Project Organization Group 2.pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
OOP with Java - Java Introduction (Basics)
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
composite construction of structures.pdf
Digital Logic Computer Design lecture notes
Operating System & Kernel Study Guide-1 - converted.pdf
CRASH COURSE IN ALTERNATIVE PLUMBING CLASS
Internet of Things (IOT) - A guide to understanding
Geodesy 1.pptx...............................................
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
573137875-Attendance-Management-System-original
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
CYBER-CRIMES AND SECURITY A guide to understanding
Construction Project Organization Group 2.pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
CH1 Production IntroductoryConcepts.pptx
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026

ECESLU Microprocessors Lecture 3

  • 1. Lecture 03 Fetch and Execute Cycle and Timing Diagrams Microcomputers and Microprocessors By: John Uffenbeck ECE @Saint Louis University, Baguio City 1 Prepared by: Engr. Jeffrey Des B. Binwag
  • 2. Fetch and Execute Cycle • A fundamental process that a microprocessor repeatedly performs each time it runs a program. The microprocessor: 1. Fetches the instruction byte from the address pointed to by the program counter (PC) and places it in the instruction register (IR) 2. Increments the PC by 1 3. Interprets the instruction byte in the IR and executes it accordingly 4. Repeats the process until it is instructed to stop ECE @Saint Louis University, Baguio City 2 (END)
  • 3. Fetch and Execute Cycle INSTRUCTION n PROGRAM INSTRUCTION 1 INSTRUCTION 2 FETCH EXECUTE OP-CODE OPERAND ECE @Saint Louis University, Baguio City 3 (END)
  • 4. Example • Determine the contents of register A, Address 1800, and the data bus after the execution of the following program. Determine the number of operand fetches, op-code fetches, and execute cycles. Address Mnemonics Machine Codes 8000 LD A, (1800) 3A 00 18 8003 LD B,A 48 8004 IN A, (06) DB 06 8006 ADD A, B 80 8007 RST 38 FF ECE @Saint Louis University, Baguio City 4 (END)
  • 5. Z-80 MEMORY I/O Data Bus ECE @Saint Louis University, Baguio City 5 (END) PC = 8000 IR = CC A = DD B = FF Address Bus Control Bus 8007 = FF 8006 = 80 8005 = 06 8004 = DB 8003 = 48 8002 = 18 8001 = 00 8000 = 3A 1800 = CF 0001 = XX 0000 = XX FF = XX FE = XX 06 = 11 05 = XX 04 = XX 03 = XX 02 = XX 01 = XX 00 = XX
  • 6. Machine Cycle Timing Diagram • A graphical representation of a program that breaks down a program as it is executed per machine cycle, while monitoring significant conditions and contents of registers, memory locations, I/O ports, and buses. ECE @Saint Louis University, Baguio City 6 (END)
  • 7. Machine Cycles • A machine cycle is any operation in a microcomputer system that involves the activation of a control signal. Each instruction in a program can be broken down into several machine cycles. INSTRUCTION n PROGRAM INSTRUCTION 1 INSTRUCTION 2 ECE @Saint Louis University, Baguio City 7 (END) Machine Cycle 1 Machine Cycle n Machine Cycle 2
  • 8. Example • Draw the machine cycle timing diagram for the following program while monitoring the control signals buses, registers, memory locations, and ports involved. Address Mnemonics Machine Codes Machine Cycles 8000 LD A, (1800) 3A 00 18 LD B,A 48 IN A, (06) DB 06 ADD A, B 80 OUT (06), A D3 06 LD (1800), A 32 00 18 RST 38 FF ECE @Saint Louis University, Baguio City 8 (END)
  • 9. Clock Cycles • Clock cycles define the amount of time it takes for an instruction to be executed. Clock Cycles are also called timing states or T-states. INSTRUCTION n PROGRAM INSTRUCTION 1 INSTRUCTION 2 Clock Cycle 1 Clock Cycle 2 Clock Cycle n ECE @Saint Louis University, Baguio City 9 (END)
  • 10. Clock Cycles for Z-80 Instructions • The Z-80 CPU User Manual provides detailed descriptions of each instruction including the number of T-states. ECE @Saint Louis University, Baguio City 10 (END)
  • 11. Memory Timing ECE @Saint Louis University, Baguio City 11
  • 12. Input/Output Timing ECE @Saint Louis University, Baguio City 12
  • 13. Program Execution Time • Ideally, the program execution time of a microprocessor depends primarily on the total number of clock cycles for all the instructions in the program without considering other parameters like propagation and buffer delays. • Program execution time, TPE TPE = Total number of clock cycles/ fclock Where: fclock = microprocessor clock speed ECE @Saint Louis University, Baguio City 13 (END)
  • 14. • Example: Compute the program execution time for the given program. How long does it take to execute the longest instruction? Address Mnemonics Machine Codes Clock Cycles 8000 LD A, (1800) 3A 00 18 LD B,A 48 IN A, (06) DB 06 ADD A, B 80 OUT (06), A D3 06 LD (1800), A 32 00 18 RST 38 FF ECE @Saint Louis University, Baguio City 14 (END)
  • 15. Thank You ECE @Saint Louis University, Baguio City 15