SlideShare ist ein Scribd-Unternehmen logo
1 von 32
1
Microprocessor Operation and
Execution of Instructions
Prof. Yusuf Leblebici
Microelectronic Systems Laboratory (LSM)
yusuf.leblebici@epfl.ch
2
8085 Functional Block Diagram
3
Basic Processor Operation
 All instructions (program steps) are stored in memory.
 To run a program, the individual instructions must
be read from the memory in sequence, and executed.
 Detailed sequence:
 Instruction fetch (read from memory)
 Decode instruction
 Get operands
 Execute operation
 Save result
get
next
instruction
4
Basic Processor Operation
 We will first demonstrate the main steps of execution
using a very simple processor “model” :
 Few instructions (commands)
 Simple memory access
 Easy to understand
 Then, we will start examining the actual 8085
processor instruction set and operations.
The OTC (Our Tiny Computer)
• Only 4 Instructions
– Add
• sets condition of result: negative, zero, positive
– Load, Store
• Absolute Reference
– Branch
• PC Relative branch
• 4 Registers (r0, r1, r2, r3)
• 16 Storage (Memory) Locations
Example OTC Instructions
load r1,12 // r1 = M[12]
add r1,r2,r2 // r1 = r2 + r2
br pos,-3 // if (result > 0) PC = PC – 3
st r0,3 // M[3] = r0
Illegal instructions
load r4,17 // no register 4, no location 17
add r1,19 // add requires register references
OTC
Operation
Load
Store
Branch
Add
Register
File
Memory
Program Counter
Inst Reg
Load r0,b
Load r1,c
Add r2,r1,r0
Store r2,a
7
6 B
C
A
0
Load r0,b
0
6
Load r0,b
0
6
Load r0,b
1
6
Load r1,c
1
6
Load r1,c
1
7
6
Load r1,c
2
7
6
Add r2,r1,r0
2
7
13
6
Add r2,r1,r0
2
7
+
13
6
Add r2,r1,r0
3
7
+
13
6
Store r2,a
3
7
+
13
6
Add r2,r1,r0
3
7
+
13
r0
r1
r2
r3
0
1
2
3
OTC Instruction Encoding
0 1 2 3 4 7
op reg loc
op reg reg reg
0 1 2 3 4 5 6 7
op cond target
0 1 2 4 5 7
Load/Store
Add
Branch
Opcodes
Load
Store
Branch
Add
00
01
10
11
Load
Store
Branch
Add
Register
File
Memory
Program Counter
Inst Reg
0 0 0 0 1 0 0 1
0 0 0 1 1 0 1 0
1 1 1 0 0 1 0 0
0 1 1 0 1 0 0 0
1 10 0 0 0 0 0
1 10 0 0 0 0 1
00
0 0 0 0 1 0 0 1
1 10 0 0 0 0 0
0
0 0 0 0 1 0 0 1
1 10 0 0 0 0 0
1
0 0 0 0 1 0 0 1
1 10 0 0 0 0 0
1
0 0 0 1 1 0 1 0
1 10 0 0 0 0 1
1 10 0 0 0 0 0
1
0 0 0 1 1 0 1 0
1 10 0 0 0 0 1
1 10 0 0 0 0 0
2
0 0 0 1 1 0 1 0
1 10 0 0 0 0 1
1 10 0 0 0 0 0
2
1 1 1 0 0 1 0 0
1 00 0 0 0 1 1
1 10 0 0 0 0 1
1 10 0 0 0 0 0
2
1 1 1 0 0 1 0 0
+
1 00 0 0 0 1 1
1 10 0 0 0 0 1
1 10 0 0 0 0 0
3
1 1 1 0 0 1 0 0
+
0 1 1 0 1 0 0 0
1 00 0 0 0 1 1
1 10 0 0 0 0 1
1 10 0 0 0 0 0
3
+
0 1 1 0 1 0 0 0
1 00 0 0 0 1 1
0 1 1 0 1 0 0 0
1 00 0 0 0 1 1
1 10 0 0 0 0 1
1 10 0 0 0 0 0
3
+
OTC
Operation
Another Simple Program
Acc = 1
Count = -n
Loop
Acc += Acc
Count += 1
Until (Count = 0)
L Ra,1
L Rc,-n
L Ri,1
Loop
Add Ra,Ra,Ra
Add Rc,Rc,Ri
Br Neg,Loop
Load
Store
Branch
Add
Register
File
Memory
Program Counter
Inst Reg
Load R0,14
Load R1,14
Load R2,15
Add R0,R0,R0
Add R2,R2,R1
BR Neg,3
1
-5
00
Load R0,14
0
Load R0,14
1
1
Load R0,14
1
1
Load R1,14
1
1
Load R1,14
1
1
2
Load R2,15
1
1
2
Load R2,15
1
1
-5
3
Load R2,15
1
1
-5
3
Add R0,R0,R0
1
1
-5
3
Add R0,R0,R0
2
1
-5
4
Add R0,R0,R0
2
1
-5
+
4
Add R2,R2,R1
2
1
-5
+
4
Add R2,R2,R1
2
1
-4
-
5
Add R2,R2,R1
2
1
-4
-
5
BR Neg,3
2
1
-4
-
3
BR Neg,3
2
1
-4
-
3
Add R0,R0,R0
2
1
-4
-
3
Add R0,R0,R0
2
1
-4
-
3
Add R0,R0,R0
4
1
-4
+
OTC
Operation
0
1
2
3
4
5
14
15
r0
r1
r2
r3
12
Now:
Back to the 8085 Microprocessor
13
The 8085 Microprocessor
14
The 8085 Microprocessor
address
(8 bits)
15
The 8085 Microprocessor
address
and data
(8 bits)
dual - use
pins !!
16
The 8085 Microprocessor
Demultiplexing the
address / data bus
16
8
17
Example: Instruction Fetch Operation
18
Example: Instruction Fetch Operation
Instruction
(opcode)
reaches the
instruction
decoder now !
It takes four
clock cycles
to get one
instruction
into the CPU.
19
Execution of an Instruction
Now consider the execution of a simple instruction:
 Instruction 3E (hex) means: Load a data byte into
the accumulator
 The instruction is followed by the data byte 32 (hex)
 Two-byte instruction !
20
Execution of an Instruction
21
Execution of an Instruction
Put the first
memory
location on
the address
bus (2000 h)
22
Execution of an Instruction
Get the
instruction
(opcode)
byte from
memory
23
Execution of an Instruction
Interpret the
instruction:
Wait for the
data byte !
24
Execution of an Instruction
Put the next
memory
location on
the address
bus (2001 h)
25
Execution of an Instruction
Get the data
byte from the
memory
Put into
accumulator
26
Execution of an Instruction
How long does it take to execute this two-byte
instruction (op-code) ?
It is quite possible to accurately predict the time
that is required to run each instruction, and to
run the entire program !
27
8085 Instruction Set
The 8085 instructions can be classified as follows:
 Data transfer operations
 Arithmetic operations (ADD, SUB, INR, DCR)
 Logic operations
 Branching operations (JMP, CALL, RET)
• Between registers
• Between memory location and a register
• Direct write to a register / memory
• Between I/O device and accumulator
28
8085 Instruction Types
29
8085 Instruction Types
30
8085 Instruction Types
31
A VERY Simple Program
Add two hexadecimal numbers:
 Load register A (accumulator) with 32 (hex)
 Load register B with 48 (hex)
 Add the two numbers and save the sum in A
 Display accumulator (A) contents at port (01)
 End
32
A VERY Simple Program

Weitere ähnliche Inhalte

Ähnlich wie Microcontrollers and RT programming 3

apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays
 
nullcon 2011 - Memory analysis – Looking into the eye of the bits
nullcon 2011 - Memory analysis – Looking into the eye of the bitsnullcon 2011 - Memory analysis – Looking into the eye of the bits
nullcon 2011 - Memory analysis – Looking into the eye of the bitsn|u - The Open Security Community
 
Heat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12cHeat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12cDigicomp Academy Suisse Romande SA
 
Deep Learning con CNTK by Pablo Doval
Deep Learning con CNTK by Pablo DovalDeep Learning con CNTK by Pablo Doval
Deep Learning con CNTK by Pablo DovalPlain Concepts
 
Looking in the eye of the bits
Looking in the eye of the bitsLooking in the eye of the bits
Looking in the eye of the bitsIftach Ian Amit
 
20190521 pwn 101_by_roy
20190521 pwn 101_by_roy20190521 pwn 101_by_roy
20190521 pwn 101_by_royRoy
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorialFutura infotech
 
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaAWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaSerhiy Batyuk
 
Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Eric Ahn
 
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018Amazon Web Services
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051MahiboobAliMulla
 
Section 1 8051 microcontroller instruction set
Section 1 8051 microcontroller instruction setSection 1 8051 microcontroller instruction set
Section 1 8051 microcontroller instruction setnueng-kk
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskConnor McDonald
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cConnor McDonald
 
Hacklu11 Writeup
Hacklu11 WriteupHacklu11 Writeup
Hacklu11 Writeupnkslides
 

Ähnlich wie Microcontrollers and RT programming 3 (20)

PLC Training Intro
PLC Training IntroPLC Training Intro
PLC Training Intro
 
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
apidays Australia 2023 - Building On-Premise Hybrid API Platforms, David Free...
 
nullcon 2011 - Memory analysis – Looking into the eye of the bits
nullcon 2011 - Memory analysis – Looking into the eye of the bitsnullcon 2011 - Memory analysis – Looking into the eye of the bits
nullcon 2011 - Memory analysis – Looking into the eye of the bits
 
Heat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12cHeat Map and Automatic Data Optimization with Oracle Database 12c
Heat Map and Automatic Data Optimization with Oracle Database 12c
 
MCUnit 4and 5_New.pptx
MCUnit 4and 5_New.pptxMCUnit 4and 5_New.pptx
MCUnit 4and 5_New.pptx
 
Deep Learning con CNTK by Pablo Doval
Deep Learning con CNTK by Pablo DovalDeep Learning con CNTK by Pablo Doval
Deep Learning con CNTK by Pablo Doval
 
Looking in the eye of the bits
Looking in the eye of the bitsLooking in the eye of the bits
Looking in the eye of the bits
 
20190521 pwn 101_by_roy
20190521 pwn 101_by_roy20190521 pwn 101_by_roy
20190521 pwn 101_by_roy
 
8051 training an interactive tutorial
8051 training an interactive tutorial8051 training an interactive tutorial
8051 training an interactive tutorial
 
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@LohikaAWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
AWS Simple Workflow: Distributed Out of the Box! - Morning@Lohika
 
Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017
 
W10: Laboratory
W10: LaboratoryW10: Laboratory
W10: Laboratory
 
spanning tree
spanning treespanning tree
spanning tree
 
W9: Laboratory 2
W9: Laboratory 2W9: Laboratory 2
W9: Laboratory 2
 
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018
IoT Analytics Workshop (IOT314-R1) - AWS re:Invent 2018
 
B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051B sc e5.2 mp unit 4 mc-8051
B sc e5.2 mp unit 4 mc-8051
 
Section 1 8051 microcontroller instruction set
Section 1 8051 microcontroller instruction setSection 1 8051 microcontroller instruction set
Section 1 8051 microcontroller instruction set
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without risk
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
 
Hacklu11 Writeup
Hacklu11 WriteupHacklu11 Writeup
Hacklu11 Writeup
 

Mehr von SSGMCE SHEGAON

Unit-1 intro to communication networks
Unit-1 intro to communication networksUnit-1 intro to communication networks
Unit-1 intro to communication networksSSGMCE SHEGAON
 
Insulating materials- electrial
Insulating materials- electrialInsulating materials- electrial
Insulating materials- electrialSSGMCE SHEGAON
 
Digital communication (DSSS)
Digital communication  (DSSS)Digital communication  (DSSS)
Digital communication (DSSS)SSGMCE SHEGAON
 
Lect 2 loudspeakers (instrumentation)
Lect 2 loudspeakers (instrumentation)Lect 2 loudspeakers (instrumentation)
Lect 2 loudspeakers (instrumentation)SSGMCE SHEGAON
 
Microcontrollers and intro to real time programming 1
Microcontrollers and intro to real time programming 1Microcontrollers and intro to real time programming 1
Microcontrollers and intro to real time programming 1SSGMCE SHEGAON
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation toolsSSGMCE SHEGAON
 
Android mobile cotrolled robot (wi fi)
Android mobile cotrolled robot (wi fi)Android mobile cotrolled robot (wi fi)
Android mobile cotrolled robot (wi fi)SSGMCE SHEGAON
 
Khushwant singh's joke book 5
Khushwant singh's joke book 5Khushwant singh's joke book 5
Khushwant singh's joke book 5SSGMCE SHEGAON
 

Mehr von SSGMCE SHEGAON (10)

Unit-1 intro to communication networks
Unit-1 intro to communication networksUnit-1 intro to communication networks
Unit-1 intro to communication networks
 
Insulating materials- electrial
Insulating materials- electrialInsulating materials- electrial
Insulating materials- electrial
 
Digital communication (DSSS)
Digital communication  (DSSS)Digital communication  (DSSS)
Digital communication (DSSS)
 
C-programs
C-programsC-programs
C-programs
 
Lect 2 loudspeakers (instrumentation)
Lect 2 loudspeakers (instrumentation)Lect 2 loudspeakers (instrumentation)
Lect 2 loudspeakers (instrumentation)
 
Microcontrollers and intro to real time programming 1
Microcontrollers and intro to real time programming 1Microcontrollers and intro to real time programming 1
Microcontrollers and intro to real time programming 1
 
Android automation tools
Android automation toolsAndroid automation tools
Android automation tools
 
Android mobile cotrolled robot (wi fi)
Android mobile cotrolled robot (wi fi)Android mobile cotrolled robot (wi fi)
Android mobile cotrolled robot (wi fi)
 
Khushwant singh's joke book 5
Khushwant singh's joke book 5Khushwant singh's joke book 5
Khushwant singh's joke book 5
 
7th sem syllabus
7th sem syllabus 7th sem syllabus
7th sem syllabus
 

Kürzlich hochgeladen

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Kürzlich hochgeladen (20)

Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

Microcontrollers and RT programming 3

  • 1. 1 Microprocessor Operation and Execution of Instructions Prof. Yusuf Leblebici Microelectronic Systems Laboratory (LSM) yusuf.leblebici@epfl.ch
  • 3. 3 Basic Processor Operation  All instructions (program steps) are stored in memory.  To run a program, the individual instructions must be read from the memory in sequence, and executed.  Detailed sequence:  Instruction fetch (read from memory)  Decode instruction  Get operands  Execute operation  Save result get next instruction
  • 4. 4 Basic Processor Operation  We will first demonstrate the main steps of execution using a very simple processor “model” :  Few instructions (commands)  Simple memory access  Easy to understand  Then, we will start examining the actual 8085 processor instruction set and operations.
  • 5. The OTC (Our Tiny Computer) • Only 4 Instructions – Add • sets condition of result: negative, zero, positive – Load, Store • Absolute Reference – Branch • PC Relative branch • 4 Registers (r0, r1, r2, r3) • 16 Storage (Memory) Locations
  • 6. Example OTC Instructions load r1,12 // r1 = M[12] add r1,r2,r2 // r1 = r2 + r2 br pos,-3 // if (result > 0) PC = PC – 3 st r0,3 // M[3] = r0 Illegal instructions load r4,17 // no register 4, no location 17 add r1,19 // add requires register references
  • 7. OTC Operation Load Store Branch Add Register File Memory Program Counter Inst Reg Load r0,b Load r1,c Add r2,r1,r0 Store r2,a 7 6 B C A 0 Load r0,b 0 6 Load r0,b 0 6 Load r0,b 1 6 Load r1,c 1 6 Load r1,c 1 7 6 Load r1,c 2 7 6 Add r2,r1,r0 2 7 13 6 Add r2,r1,r0 2 7 + 13 6 Add r2,r1,r0 3 7 + 13 6 Store r2,a 3 7 + 13 6 Add r2,r1,r0 3 7 + 13 r0 r1 r2 r3 0 1 2 3
  • 8. OTC Instruction Encoding 0 1 2 3 4 7 op reg loc op reg reg reg 0 1 2 3 4 5 6 7 op cond target 0 1 2 4 5 7 Load/Store Add Branch Opcodes Load Store Branch Add 00 01 10 11
  • 9. Load Store Branch Add Register File Memory Program Counter Inst Reg 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 10 0 0 0 0 0 1 10 0 0 0 0 1 00 0 0 0 0 1 0 0 1 1 10 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 10 0 0 0 0 0 1 0 0 0 0 1 0 0 1 1 10 0 0 0 0 0 1 0 0 0 1 1 0 1 0 1 10 0 0 0 0 1 1 10 0 0 0 0 0 1 0 0 0 1 1 0 1 0 1 10 0 0 0 0 1 1 10 0 0 0 0 0 2 0 0 0 1 1 0 1 0 1 10 0 0 0 0 1 1 10 0 0 0 0 0 2 1 1 1 0 0 1 0 0 1 00 0 0 0 1 1 1 10 0 0 0 0 1 1 10 0 0 0 0 0 2 1 1 1 0 0 1 0 0 + 1 00 0 0 0 1 1 1 10 0 0 0 0 1 1 10 0 0 0 0 0 3 1 1 1 0 0 1 0 0 + 0 1 1 0 1 0 0 0 1 00 0 0 0 1 1 1 10 0 0 0 0 1 1 10 0 0 0 0 0 3 + 0 1 1 0 1 0 0 0 1 00 0 0 0 1 1 0 1 1 0 1 0 0 0 1 00 0 0 0 1 1 1 10 0 0 0 0 1 1 10 0 0 0 0 0 3 + OTC Operation
  • 10. Another Simple Program Acc = 1 Count = -n Loop Acc += Acc Count += 1 Until (Count = 0) L Ra,1 L Rc,-n L Ri,1 Loop Add Ra,Ra,Ra Add Rc,Rc,Ri Br Neg,Loop
  • 11. Load Store Branch Add Register File Memory Program Counter Inst Reg Load R0,14 Load R1,14 Load R2,15 Add R0,R0,R0 Add R2,R2,R1 BR Neg,3 1 -5 00 Load R0,14 0 Load R0,14 1 1 Load R0,14 1 1 Load R1,14 1 1 Load R1,14 1 1 2 Load R2,15 1 1 2 Load R2,15 1 1 -5 3 Load R2,15 1 1 -5 3 Add R0,R0,R0 1 1 -5 3 Add R0,R0,R0 2 1 -5 4 Add R0,R0,R0 2 1 -5 + 4 Add R2,R2,R1 2 1 -5 + 4 Add R2,R2,R1 2 1 -4 - 5 Add R2,R2,R1 2 1 -4 - 5 BR Neg,3 2 1 -4 - 3 BR Neg,3 2 1 -4 - 3 Add R0,R0,R0 2 1 -4 - 3 Add R0,R0,R0 2 1 -4 - 3 Add R0,R0,R0 4 1 -4 + OTC Operation 0 1 2 3 4 5 14 15 r0 r1 r2 r3
  • 12. 12 Now: Back to the 8085 Microprocessor
  • 15. 15 The 8085 Microprocessor address and data (8 bits) dual - use pins !!
  • 16. 16 The 8085 Microprocessor Demultiplexing the address / data bus 16 8
  • 18. 18 Example: Instruction Fetch Operation Instruction (opcode) reaches the instruction decoder now ! It takes four clock cycles to get one instruction into the CPU.
  • 19. 19 Execution of an Instruction Now consider the execution of a simple instruction:  Instruction 3E (hex) means: Load a data byte into the accumulator  The instruction is followed by the data byte 32 (hex)  Two-byte instruction !
  • 20. 20 Execution of an Instruction
  • 21. 21 Execution of an Instruction Put the first memory location on the address bus (2000 h)
  • 22. 22 Execution of an Instruction Get the instruction (opcode) byte from memory
  • 23. 23 Execution of an Instruction Interpret the instruction: Wait for the data byte !
  • 24. 24 Execution of an Instruction Put the next memory location on the address bus (2001 h)
  • 25. 25 Execution of an Instruction Get the data byte from the memory Put into accumulator
  • 26. 26 Execution of an Instruction How long does it take to execute this two-byte instruction (op-code) ? It is quite possible to accurately predict the time that is required to run each instruction, and to run the entire program !
  • 27. 27 8085 Instruction Set The 8085 instructions can be classified as follows:  Data transfer operations  Arithmetic operations (ADD, SUB, INR, DCR)  Logic operations  Branching operations (JMP, CALL, RET) • Between registers • Between memory location and a register • Direct write to a register / memory • Between I/O device and accumulator
  • 31. 31 A VERY Simple Program Add two hexadecimal numbers:  Load register A (accumulator) with 32 (hex)  Load register B with 48 (hex)  Add the two numbers and save the sum in A  Display accumulator (A) contents at port (01)  End
  • 32. 32 A VERY Simple Program