SlideShare uma empresa Scribd logo
1 de 41
Microprocessor Basics
05/09/15 Presentation By Sania Gul 2
Microprocessor & Microcomputer
• The complete processor built on a single
chip is called microprocessor (µP) or
micro processing unit (MPU).
• The computer built from microprocessor is
called microcomputer
05/09/15 Presentation By Sania Gul 3
Architecture of Microcomputer
Bus Architecture
05/09/15 Presentation By Sania Gul 4
MEMORY (Primary & Secondary)
• Primary storage memory is made of RAM & ROM.
• Secondary storage memory is Hard disk, Floppy disk,
USB, CDs, DVDs etc. These devices store data so they
are memory devices but for the microprocessor all
secondary memory devices are I/O devices. For µP,
memory is only the primary memory.
05/09/15 Presentation By Sania Gul 5
Peripherals
• All I/O devices are called peripherals.
• The µP, primary memory & the peripherals
are connected to system bus and all the
data exchange among them takes place
over the system bus.
05/09/15 Presentation By Sania Gul 6
Primary Memory
• The primary memory is a collection of lot of
registers. One register of memory can hold any
number of bits, but usually it is designed to hold
1 byte (8 bits).
• The complete chip consists of lot of such
register, each having different address by which
µP calls it (or identifies it).
• Remember, the number of registers in a memory
chip are always in the power of 2. For example u
have heard about kilo byte (KB), Mega Byte
(MB), Giga Byte (GB) etc.
05/09/15 Presentation By Sania Gul 7
Primary Memory always in power of
2
1 KB 210
Bytes =1024 Bytes
1 MB 220
Bytes =1024 K Bytes
1GB 230
Bytes =1024 Mbytes
1 TB 240
Bytes =1024 GBytes
05/09/15 Presentation By Sania Gul 8
I/O peripherals
• Well known I/O devices are printer, scanner, key
board, mouse, joy stick etc.
• The I/O devices are connected to system bus
through peripheral interface IC called I/O
controllers. (u can see these ICs on the mother
board).
• This IC or I/O controller consists of many
registers & like memory each register inside the
IC has a unique address & µP calls them by
their address to exchange data with them.
05/09/15 Presentation By Sania Gul 9
Peripheral controller
Hard disk,
floppy disk,
CD-R, DVD
Modem, LAN Card Monitor, LCD,
Multimedia
05/09/15 Presentation By Sania Gul 10
System bus
• Bus is a group of wires that transmit a
binary word. The system bus is
composed of 3 buses.
1. Address bus
2. Data Bus
3. Control Bus
05/09/15 Presentation By Sania Gul 11
System bus
1. Address bus:
The address bus is used to carry the address from
micro-processor to peripheral or memory. The
address generated by the µP is in the form of bits &
each bus line carries one bit of address. It is a
unidirectional bus.
Each line is represented by “A”
2. Data Bus:
The data from memory or peripheral to µP & vice
versa is exchanged on data bus. It is a bidirectional
bus.
Each line is represented by “D”
05/09/15 Presentation By Sania Gul 12
System Bus
3. Control bus:
This bus is used to carry control signals from µP to
memory or peripherals & vice versa. It is not a
bus in the true sense as it is not a common
transmission medium to carry control signal.
Every device is connected to microprocessor
control pins individually.
Multiplexed Bus: In order to reduce external pins, one pin can
be shared to carry both address & data. But both are not carried at
the same time. This kind of bus is called multiplexed bus,
Each line is represented by “AD”. (address data)
05/09/15 Presentation By Sania Gul 13
Address decoding of 4 bit address
This register is
selected with
address of 0 H
and its contents
are CD H
05/09/15 Presentation By Sania Gul 14
Memory with on chip address
decoding
05/09/15 Presentation By Sania Gul 15
Memory Interfacing
05/09/15 Presentation By Sania Gul 16
Address space
• The complete set of addresses which can
be created from fix number of bits. e.g.
with 4 bits only 24
(16) address can be
created. The address range will be
– 0000 = 0H (first address) note: addresses are always given in Hex format
– 0001 =1H (Second address)
– 1111 = FH (last address)
05/09/15 Presentation By Sania Gul 17
Address mapping
• On maps of houses, we give particular
location of a room, washrooms & kitchen.
• Like wise allocating a unique address to
any register or device on the address
space is called address mapping.
Memory
address
space
05/09/15 Presentation By Sania Gul 18
Memory Matrix
05/09/15 Presentation By Sania Gul 19
Inside Microprocessor
• There are also registers inside the µP. Some special
purpose registers & few data registers. The purpose of
data registers is to store data & results. These results
can afterwards be displayed on output devices or stored
in memory for later use.
• As there are very few registers inside processor so
instead of address, they got names like register A, B, C
etc.
• The size of processor register defines how much
maximum data, the processor can process at one time.
For example the size of 8085 µP’s registers is 8 bit, so it
is 8 bit processor & that of 8088/8086 is 16 bits, so it is
16 bit processor.
05/09/15 Presentation By Sania Gul 20
Inside Microprocessor
05/09/15 Presentation By Sania Gul 21
Performance Comparison of µPs
• Performance of microprocessor is
measured in units of MIPS how many
million of instructions they can execute per
second.
05/09/15 Presentation By Sania Gul 22
Primary memory Segmentation
• Imagine u visit a library & there are no sections. All
books are randomly placed. Can u find your required
book easily? NO
• Similarly the program (code) & data must be organized
in different sections of memory to help the processor to
find them easily, because it will reduce the processing
time.
05/09/15 Presentation By Sania Gul 23
Types of Segments
4 types of segments exists in memory
1. Code Segment  for storing program
2. Data Segment  for storing Data
3. Stack Segment for storing Temporary Data
4. Extra Segment  for storing extra Data in addition to
data in DS
05/09/15 Presentation By Sania Gul 24
Code Segment (CS)
• It is that portion of memory which contains
the program (Code).
• The program is set of instructions. The µP
fetches (picks) one instruction from the
memory, decodes it to find what to do, &
process the data according to the
instruction.
• So for each instruction 3 steps are performed
• Fetch  Decode  Execute
05/09/15 Presentation By Sania Gul 25
Program Counter (PC) or
Instruction pointer (IP)
• Pointer means address. IP is a register inside
microprocessor which holds the address of next
instruction to be executed.
• When the processor fetches one instruction
from the memory, it automatically points to the
next instruction in the memory which is to be
executed after the current instruction.
• It is like an office secretary who always points to
his officer what to do next in his schedule. Its job
is to send to the memory the address of the next
instruction to be fetched & executed.
05/09/15 Presentation By Sania Gul 26
Stored program
• The instructions are already stored by
programmer in the memory. When the
processor is turned on, it automatically
takes first instruction from the memory
because initially its IP or PC is 0H.
• The instructions are stored in binary
format in memory & one instruction may
take one byte or many bytes of memory.
05/09/15 Presentation By Sania Gul 27
Sequential execution
• Computer is a sequential machine i.e. it fetches
instructions from memory and executes them in proper
order. unless there is any instruction or external event
(interrupt) which breaks the sequence.
Main Program
1st
instruction
2nd
instruction
3rd
instruction
4th
instruction
last instruction
CPU
memory
Data bus
Main Program
1st
instruction
2nd
instruction
3rd
instruction
4th
instruction
last instruction
05/09/15 Presentation By Sania Gul 28
Instruction Cycle
Instruction
decoder &
control unit
Adder Inverter AND
logic
PC
A
B
C
0H
Add
res
s
Contents
0H 80 H
1H 12 H
2H 40 H
3H 05 H
4H 75 H
AH 06 H
BH 01H
MOV A,3H
ADD A, 5H
HLT
80 H12H
2H
3H
ADD A,5H
4H
Sum=8H
Memory
=16
Bytes
Data
Segment
Code
Segment
4 bit Address
Bus
8 bit data bus
RD control signal
Note: if the instruction is of 2 bytes, it takes 2 Bus
cycles to Fetch the instruction if the data Bus is 8
bit wide.
05/09/15 Presentation By Sania Gul 29
Instruction Cycle
• Cycle means duration. The µP takes certain
amount of time to execute the instruction. The
time required varies from one processor to other
& also depends on System Clock frequency f.
• For example, the instruction ADD A, 5H takes 4
T states.
• If the system clock frequency f=2 Hz, the
• T=1/f = ½ =0.5 s
• So ADD A, 5H  4 T = 4* 0.5= 2 s
05/09/15 Presentation By Sania Gul 30
Sub routines/ procedure or
functions
These are small programs written separately from the main
program. These program are written separately
because of many reasons like.
1. It makes programming modular, easy to debug, &
allowing many programmers to work on small units of
their interests.
2. The subroutine developed by one programmer can be
used by other programmers in their own programs.
3. The subroutine can be called by main program many
times without writing the sub routine code again &
again so less memory is required.
The program control is passed to subroutine when the main
program calls it, & returned back to main program
once the subroutine is finished.
05/09/15 Presentation By Sania Gul 31
Stack Segment (SS)
• It is the portion of the RAM used for temporary storage of Data.
• It is the data structure which works on LIFO (last in first out
principle) like a stack of books. The last data pushed on the stack is
the one which is popped first.
• In Intel µPs, the stack storage starts from the highest address &
continue towards the lower addresses.
• In normal data structures the data is stored starting from the lowest
address (the bottom) and continue towards the higher addresses
even in Intel micro controller’s stack.
Higher address
Lower address
Stack grows
05/09/15 Presentation By Sania Gul 32
Need of Stack Segment
• When the main program calls sub routine, the program control
shifts to sub routine & the Program counter PC is loaded with the
address of the first instruction of sub routine. However at the end
of subroutine, the control has to shifted back to the main program.
• So before shifting the control to sub routine, the contents of PC
are stored automatically on stack with the CALL instruction. And
when the sub routine is over, the old contents of PC are
automatically retrieved from the stack when the last instruction of
sub-routine RET is executed & execution starts from the next
instruction of the main program. which has called the sub-routine.
05/09/15 Presentation By Sania Gul 33
05/09/15 Presentation By Sania Gul 34
Need of Stack Segment
• As there are very few registers inside µP, so it may be
possible that the main program & sub-routine both
require them. This is not possible if there was no stack.
• So the programmer ensures that before the sub-routine
uses the µP registers, the data inside these registers
related to main program are stored on stack with the
help of PUSH instructions & then POPPED from the
stack at the end of sub-routine with the help of POP
instruction.
• The number of POPs instruction must be equal to
number of PUSHES.
• POPPING must be in reverse order of PUSHiNG to
restore original contents due to LIFO principle.
05/09/15 Presentation By Sania Gul 35
Pushing means adding
Popping means removing
05/09/15 Presentation By Sania Gul 36
Stack pointer
• This register stores the address of the Top
Of Stack (TOS), the top most valid filled
location of SS.
• As in Intel µPs, the stack grows from the
higher address towards the lower one, so
when the data is pushed on stack SP
decrements & when it is popped from
stack, SP increments.
05/09/15 Presentation By Sania Gul 37
05/09/15 Presentation By Sania Gul 38
05/09/15 Presentation By Sania Gul 39
05/09/15 Presentation By Sania Gul 40
Instruction pipelining
• In old processors, one instruction is fetched, decoded &
executed. After that the same process occurs for the
second instruction & so on.
• Fetching of the next instruction, while the current
instruction executes is called pipelining.
• This saves the time & increase processing speed.
05/09/15 Presentation By Sania Gul 41
BCD & Signed Numbers
Unpacked BCD
Packed BCD

Mais conteúdo relacionado

Mais procurados

B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...Rai University
 
Microprocessor Presentation
Microprocessor PresentationMicroprocessor Presentation
Microprocessor Presentationalaminmasum1
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systemscmkandemir
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Mrunal Deshkar
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controllerOm Bheda
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesFellowBuddy.com
 
Microprocessor Basics 8085 Ch-1
Microprocessor Basics 8085 Ch-1Microprocessor Basics 8085 Ch-1
Microprocessor Basics 8085 Ch-1Neelam Kapoor
 
Microprocessor
MicroprocessorMicroprocessor
MicroprocessorAshok Raj
 
Computer organization
Computer organizationComputer organization
Computer organizationishapadhy
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5Umang Gupta
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessorSudhir Reddy
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor IntroductionNaveen Dubey
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessorkunj desai
 
Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)Ismail Mukiibi
 

Mais procurados (20)

B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
B.sc cs-ii-u-2.2-overview of register transfer, micro operations and basic co...
 
Microprocessor Presentation
Microprocessor PresentationMicroprocessor Presentation
Microprocessor Presentation
 
Chapter1a
Chapter1aChapter1a
Chapter1a
 
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer SystemsChapter 2-8085 Microprocessor Architecture and Microcomputer Systems
Chapter 2-8085 Microprocessor Architecture and Microcomputer Systems
 
Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor Overview of microcontroller and microprocessor
Overview of microcontroller and microprocessor
 
Microprocessor & Micro-controller
Microprocessor & Micro-controllerMicroprocessor & Micro-controller
Microprocessor & Micro-controller
 
Microprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture NotesMicroprocessors & Microcomputers Lecture Notes
Microprocessors & Microcomputers Lecture Notes
 
Memory interfacing
Memory interfacingMemory interfacing
Memory interfacing
 
8085 full discription
8085 full discription8085 full discription
8085 full discription
 
Processor Basics
Processor BasicsProcessor Basics
Processor Basics
 
Microprocessor Basics 8085 Ch-1
Microprocessor Basics 8085 Ch-1Microprocessor Basics 8085 Ch-1
Microprocessor Basics 8085 Ch-1
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Computer organiztion5
Computer organiztion5Computer organiztion5
Computer organiztion5
 
Introduction to microprocessor
Introduction to microprocessorIntroduction to microprocessor
Introduction to microprocessor
 
Microprocessor Introduction
Microprocessor IntroductionMicroprocessor Introduction
Microprocessor Introduction
 
Design a processor
Design a processorDesign a processor
Design a processor
 
Introduction to 8085 microprocessor
Introduction to 8085 microprocessorIntroduction to 8085 microprocessor
Introduction to 8085 microprocessor
 
Microprocessor application (Introduction)
Microprocessor application (Introduction)Microprocessor application (Introduction)
Microprocessor application (Introduction)
 

Destaque

Microprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingMicroprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingSamiul Ehsan
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Safin Biswas
 
Practicing oil analysis it's all about size
Practicing oil analysis   it's all about sizePracticing oil analysis   it's all about size
Practicing oil analysis it's all about sizefiltermag
 
Little book of leadership ppt
Little book of leadership pptLittle book of leadership ppt
Little book of leadership pptPINAKI ROY
 
Why you should quit smoking
Why you should quit smokingWhy you should quit smoking
Why you should quit smokingDanial Sohail
 
Two to four wheeler transformable bike
Two to four wheeler transformable bikeTwo to four wheeler transformable bike
Two to four wheeler transformable bikeDanial Sohail
 
Sae paper 881825
Sae paper 881825Sae paper 881825
Sae paper 881825filtermag
 
Les metamorphose1
Les metamorphose1Les metamorphose1
Les metamorphose1PINAKI ROY
 
BP risk factors
BP risk factorsBP risk factors
BP risk factorsPINAKI ROY
 
Fm industrial data summary 2012
Fm industrial data summary 2012Fm industrial data summary 2012
Fm industrial data summary 2012filtermag
 
Blood Pressure - The risk factors
Blood Pressure - The risk factorsBlood Pressure - The risk factors
Blood Pressure - The risk factorsPINAKI ROY
 
Survey of NED Auditorium Ground
Survey of NED Auditorium GroundSurvey of NED Auditorium Ground
Survey of NED Auditorium GroundDanial Sohail
 
hybrid vehicles
 hybrid vehicles hybrid vehicles
hybrid vehiclesWaqas Ahmed
 
Programming lab 1 lecture
Programming lab 1 lectureProgramming lab 1 lecture
Programming lab 1 lectureiqbal ahmad
 
Tribology - The WDA Factor
Tribology - The WDA FactorTribology - The WDA Factor
Tribology - The WDA FactorPINAKI ROY
 

Destaque (18)

Microprocessor:stack,shifting,looping
Microprocessor:stack,shifting,loopingMicroprocessor:stack,shifting,looping
Microprocessor:stack,shifting,looping
 
Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)Stack in microprocessor 8085(presantation)
Stack in microprocessor 8085(presantation)
 
Practicing oil analysis it's all about size
Practicing oil analysis   it's all about sizePracticing oil analysis   it's all about size
Practicing oil analysis it's all about size
 
Little book of leadership ppt
Little book of leadership pptLittle book of leadership ppt
Little book of leadership ppt
 
Why you should quit smoking
Why you should quit smokingWhy you should quit smoking
Why you should quit smoking
 
Two to four wheeler transformable bike
Two to four wheeler transformable bikeTwo to four wheeler transformable bike
Two to four wheeler transformable bike
 
Sae paper 881825
Sae paper 881825Sae paper 881825
Sae paper 881825
 
Les metamorphose1
Les metamorphose1Les metamorphose1
Les metamorphose1
 
BP risk factors
BP risk factorsBP risk factors
BP risk factors
 
Fm industrial data summary 2012
Fm industrial data summary 2012Fm industrial data summary 2012
Fm industrial data summary 2012
 
boiler
boilerboiler
boiler
 
Blood Pressure - The risk factors
Blood Pressure - The risk factorsBlood Pressure - The risk factors
Blood Pressure - The risk factors
 
Numbers
NumbersNumbers
Numbers
 
Survey of NED Auditorium Ground
Survey of NED Auditorium GroundSurvey of NED Auditorium Ground
Survey of NED Auditorium Ground
 
hybrid vehicles
 hybrid vehicles hybrid vehicles
hybrid vehicles
 
Programming lab 1 lecture
Programming lab 1 lectureProgramming lab 1 lecture
Programming lab 1 lecture
 
Nmlc ef3 module 1
Nmlc ef3 module 1Nmlc ef3 module 1
Nmlc ef3 module 1
 
Tribology - The WDA Factor
Tribology - The WDA FactorTribology - The WDA Factor
Tribology - The WDA Factor
 

Semelhante a microprocessor Lec 01 mic

Computer Arithmetic and Processor Basics
Computer Arithmetic and Processor BasicsComputer Arithmetic and Processor Basics
Computer Arithmetic and Processor BasicsShinuMMAEI
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxDrVaibhavMeshram
 
Ch2 embedded processors-i
Ch2 embedded processors-iCh2 embedded processors-i
Ch2 embedded processors-iAnkit Shah
 
Microprocessor Fundamentals
Microprocessor FundamentalsMicroprocessor Fundamentals
Microprocessor FundamentalsDiwaker Pant
 
Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformSURYAPRAKASH S
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentalsJLoknathDora
 
Embedded system book very helpful needed and use by everyone
Embedded system book very helpful needed and use by everyoneEmbedded system book very helpful needed and use by everyone
Embedded system book very helpful needed and use by everyoneManojGupta666004
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture amrutachintawar239
 
VTU University Micro Controllers-06ES42 lecturer Notes
VTU University Micro Controllers-06ES42 lecturer NotesVTU University Micro Controllers-06ES42 lecturer Notes
VTU University Micro Controllers-06ES42 lecturer Notes24x7house
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...Asst.prof M.Gokilavani
 
introduction to Computer system
introduction to Computer systemintroduction to Computer system
introduction to Computer systemumardanjumamaiwada
 
Principle of Computer Operation.ppt
Principle of Computer Operation.pptPrinciple of Computer Operation.ppt
Principle of Computer Operation.pptAbdulRehman703897
 
20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notesRavali Sunki
 
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptxsruti009988
 
C programming for problem solving
C programming for problem solving  C programming for problem solving
C programming for problem solving Anuradha Moti T
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxMeghdeepSingh
 

Semelhante a microprocessor Lec 01 mic (20)

Computer Arithmetic and Processor Basics
Computer Arithmetic and Processor BasicsComputer Arithmetic and Processor Basics
Computer Arithmetic and Processor Basics
 
Module -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptxModule -4_microprocessor (1).pptx
Module -4_microprocessor (1).pptx
 
Ch2 embedded processors-i
Ch2 embedded processors-iCh2 embedded processors-i
Ch2 embedded processors-i
 
Microprocessor Fundamentals
Microprocessor FundamentalsMicroprocessor Fundamentals
Microprocessor Fundamentals
 
Class 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platformClass 5 an 8 bit embedded platform
Class 5 an 8 bit embedded platform
 
Microprocessor fundamentals
Microprocessor fundamentalsMicroprocessor fundamentals
Microprocessor fundamentals
 
Embedded system book very helpful needed and use by everyone
Embedded system book very helpful needed and use by everyoneEmbedded system book very helpful needed and use by everyone
Embedded system book very helpful needed and use by everyone
 
Introduction to 8085svv
Introduction to 8085svvIntroduction to 8085svv
Introduction to 8085svv
 
Introduction to Embedded Architecture
Introduction to Embedded Architecture Introduction to Embedded Architecture
Introduction to Embedded Architecture
 
1 introduction-to-computer
1 introduction-to-computer1 introduction-to-computer
1 introduction-to-computer
 
VTU University Micro Controllers-06ES42 lecturer Notes
VTU University Micro Controllers-06ES42 lecturer NotesVTU University Micro Controllers-06ES42 lecturer Notes
VTU University Micro Controllers-06ES42 lecturer Notes
 
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...CS304PC:Computer Organization and Architecture  Session 5 Basic Computer Orga...
CS304PC:Computer Organization and Architecture Session 5 Basic Computer Orga...
 
0 lecture 3
0 lecture 30 lecture 3
0 lecture 3
 
introduction to Computer system
introduction to Computer systemintroduction to Computer system
introduction to Computer system
 
lecture 3
 lecture 3 lecture 3
lecture 3
 
Principle of Computer Operation.ppt
Principle of Computer Operation.pptPrinciple of Computer Operation.ppt
Principle of Computer Operation.ppt
 
20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes20838382 microprocessor-8085-notes
20838382 microprocessor-8085-notes
 
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
8085 Microprocessor - Ramesh Gaonkar.pdf-27 (1).pptx
 
C programming for problem solving
C programming for problem solving  C programming for problem solving
C programming for problem solving
 
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptxINDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
INDUSTRIAL TRAINING REPORT EMBEDDED SYSTEM.pptx
 

Mais de iqbal ahmad

Probability, random variables and random signal principles 2nd ed. p. peebles
Probability, random variables and random signal principles 2nd ed.   p. peeblesProbability, random variables and random signal principles 2nd ed.   p. peebles
Probability, random variables and random signal principles 2nd ed. p. peeblesiqbal ahmad
 
signal and system Lecture 3
signal and system Lecture 3signal and system Lecture 3
signal and system Lecture 3iqbal ahmad
 
signal and system Lecture 2
signal and system Lecture 2signal and system Lecture 2
signal and system Lecture 2iqbal ahmad
 
signal and system Lecture 1
signal and system Lecture 1signal and system Lecture 1
signal and system Lecture 1iqbal ahmad
 
signal and system Dirac delta functions (1)
signal and system Dirac delta functions (1)signal and system Dirac delta functions (1)
signal and system Dirac delta functions (1)iqbal ahmad
 
signal and system solution Quiz2
signal and system solution Quiz2signal and system solution Quiz2
signal and system solution Quiz2iqbal ahmad
 
signal and system Hw2 solution
signal and system Hw2 solutionsignal and system Hw2 solution
signal and system Hw2 solutioniqbal ahmad
 
Capacitors and inductors
Capacitors and inductorsCapacitors and inductors
Capacitors and inductorsiqbal ahmad
 
Second order ena notes
Second order ena notesSecond order ena notes
Second order ena notesiqbal ahmad
 
First order ena notes
First order ena notesFirst order ena notes
First order ena notesiqbal ahmad
 

Mais de iqbal ahmad (11)

Probability, random variables and random signal principles 2nd ed. p. peebles
Probability, random variables and random signal principles 2nd ed.   p. peeblesProbability, random variables and random signal principles 2nd ed.   p. peebles
Probability, random variables and random signal principles 2nd ed. p. peebles
 
signal and system Lecture 3
signal and system Lecture 3signal and system Lecture 3
signal and system Lecture 3
 
signal and system Lecture 2
signal and system Lecture 2signal and system Lecture 2
signal and system Lecture 2
 
signal and system Lecture 1
signal and system Lecture 1signal and system Lecture 1
signal and system Lecture 1
 
signal and system Dirac delta functions (1)
signal and system Dirac delta functions (1)signal and system Dirac delta functions (1)
signal and system Dirac delta functions (1)
 
signal and system solution Quiz2
signal and system solution Quiz2signal and system solution Quiz2
signal and system solution Quiz2
 
Hw1 solution
Hw1 solutionHw1 solution
Hw1 solution
 
signal and system Hw2 solution
signal and system Hw2 solutionsignal and system Hw2 solution
signal and system Hw2 solution
 
Capacitors and inductors
Capacitors and inductorsCapacitors and inductors
Capacitors and inductors
 
Second order ena notes
Second order ena notesSecond order ena notes
Second order ena notes
 
First order ena notes
First order ena notesFirst order ena notes
First order ena notes
 

Último

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 

Último (20)

High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 

microprocessor Lec 01 mic

  • 2. 05/09/15 Presentation By Sania Gul 2 Microprocessor & Microcomputer • The complete processor built on a single chip is called microprocessor (µP) or micro processing unit (MPU). • The computer built from microprocessor is called microcomputer
  • 3. 05/09/15 Presentation By Sania Gul 3 Architecture of Microcomputer Bus Architecture
  • 4. 05/09/15 Presentation By Sania Gul 4 MEMORY (Primary & Secondary) • Primary storage memory is made of RAM & ROM. • Secondary storage memory is Hard disk, Floppy disk, USB, CDs, DVDs etc. These devices store data so they are memory devices but for the microprocessor all secondary memory devices are I/O devices. For µP, memory is only the primary memory.
  • 5. 05/09/15 Presentation By Sania Gul 5 Peripherals • All I/O devices are called peripherals. • The µP, primary memory & the peripherals are connected to system bus and all the data exchange among them takes place over the system bus.
  • 6. 05/09/15 Presentation By Sania Gul 6 Primary Memory • The primary memory is a collection of lot of registers. One register of memory can hold any number of bits, but usually it is designed to hold 1 byte (8 bits). • The complete chip consists of lot of such register, each having different address by which µP calls it (or identifies it). • Remember, the number of registers in a memory chip are always in the power of 2. For example u have heard about kilo byte (KB), Mega Byte (MB), Giga Byte (GB) etc.
  • 7. 05/09/15 Presentation By Sania Gul 7 Primary Memory always in power of 2 1 KB 210 Bytes =1024 Bytes 1 MB 220 Bytes =1024 K Bytes 1GB 230 Bytes =1024 Mbytes 1 TB 240 Bytes =1024 GBytes
  • 8. 05/09/15 Presentation By Sania Gul 8 I/O peripherals • Well known I/O devices are printer, scanner, key board, mouse, joy stick etc. • The I/O devices are connected to system bus through peripheral interface IC called I/O controllers. (u can see these ICs on the mother board). • This IC or I/O controller consists of many registers & like memory each register inside the IC has a unique address & µP calls them by their address to exchange data with them.
  • 9. 05/09/15 Presentation By Sania Gul 9 Peripheral controller Hard disk, floppy disk, CD-R, DVD Modem, LAN Card Monitor, LCD, Multimedia
  • 10. 05/09/15 Presentation By Sania Gul 10 System bus • Bus is a group of wires that transmit a binary word. The system bus is composed of 3 buses. 1. Address bus 2. Data Bus 3. Control Bus
  • 11. 05/09/15 Presentation By Sania Gul 11 System bus 1. Address bus: The address bus is used to carry the address from micro-processor to peripheral or memory. The address generated by the µP is in the form of bits & each bus line carries one bit of address. It is a unidirectional bus. Each line is represented by “A” 2. Data Bus: The data from memory or peripheral to µP & vice versa is exchanged on data bus. It is a bidirectional bus. Each line is represented by “D”
  • 12. 05/09/15 Presentation By Sania Gul 12 System Bus 3. Control bus: This bus is used to carry control signals from µP to memory or peripherals & vice versa. It is not a bus in the true sense as it is not a common transmission medium to carry control signal. Every device is connected to microprocessor control pins individually. Multiplexed Bus: In order to reduce external pins, one pin can be shared to carry both address & data. But both are not carried at the same time. This kind of bus is called multiplexed bus, Each line is represented by “AD”. (address data)
  • 13. 05/09/15 Presentation By Sania Gul 13 Address decoding of 4 bit address This register is selected with address of 0 H and its contents are CD H
  • 14. 05/09/15 Presentation By Sania Gul 14 Memory with on chip address decoding
  • 15. 05/09/15 Presentation By Sania Gul 15 Memory Interfacing
  • 16. 05/09/15 Presentation By Sania Gul 16 Address space • The complete set of addresses which can be created from fix number of bits. e.g. with 4 bits only 24 (16) address can be created. The address range will be – 0000 = 0H (first address) note: addresses are always given in Hex format – 0001 =1H (Second address) – 1111 = FH (last address)
  • 17. 05/09/15 Presentation By Sania Gul 17 Address mapping • On maps of houses, we give particular location of a room, washrooms & kitchen. • Like wise allocating a unique address to any register or device on the address space is called address mapping. Memory address space
  • 18. 05/09/15 Presentation By Sania Gul 18 Memory Matrix
  • 19. 05/09/15 Presentation By Sania Gul 19 Inside Microprocessor • There are also registers inside the µP. Some special purpose registers & few data registers. The purpose of data registers is to store data & results. These results can afterwards be displayed on output devices or stored in memory for later use. • As there are very few registers inside processor so instead of address, they got names like register A, B, C etc. • The size of processor register defines how much maximum data, the processor can process at one time. For example the size of 8085 µP’s registers is 8 bit, so it is 8 bit processor & that of 8088/8086 is 16 bits, so it is 16 bit processor.
  • 20. 05/09/15 Presentation By Sania Gul 20 Inside Microprocessor
  • 21. 05/09/15 Presentation By Sania Gul 21 Performance Comparison of µPs • Performance of microprocessor is measured in units of MIPS how many million of instructions they can execute per second.
  • 22. 05/09/15 Presentation By Sania Gul 22 Primary memory Segmentation • Imagine u visit a library & there are no sections. All books are randomly placed. Can u find your required book easily? NO • Similarly the program (code) & data must be organized in different sections of memory to help the processor to find them easily, because it will reduce the processing time.
  • 23. 05/09/15 Presentation By Sania Gul 23 Types of Segments 4 types of segments exists in memory 1. Code Segment  for storing program 2. Data Segment  for storing Data 3. Stack Segment for storing Temporary Data 4. Extra Segment  for storing extra Data in addition to data in DS
  • 24. 05/09/15 Presentation By Sania Gul 24 Code Segment (CS) • It is that portion of memory which contains the program (Code). • The program is set of instructions. The µP fetches (picks) one instruction from the memory, decodes it to find what to do, & process the data according to the instruction. • So for each instruction 3 steps are performed • Fetch  Decode  Execute
  • 25. 05/09/15 Presentation By Sania Gul 25 Program Counter (PC) or Instruction pointer (IP) • Pointer means address. IP is a register inside microprocessor which holds the address of next instruction to be executed. • When the processor fetches one instruction from the memory, it automatically points to the next instruction in the memory which is to be executed after the current instruction. • It is like an office secretary who always points to his officer what to do next in his schedule. Its job is to send to the memory the address of the next instruction to be fetched & executed.
  • 26. 05/09/15 Presentation By Sania Gul 26 Stored program • The instructions are already stored by programmer in the memory. When the processor is turned on, it automatically takes first instruction from the memory because initially its IP or PC is 0H. • The instructions are stored in binary format in memory & one instruction may take one byte or many bytes of memory.
  • 27. 05/09/15 Presentation By Sania Gul 27 Sequential execution • Computer is a sequential machine i.e. it fetches instructions from memory and executes them in proper order. unless there is any instruction or external event (interrupt) which breaks the sequence. Main Program 1st instruction 2nd instruction 3rd instruction 4th instruction last instruction CPU memory Data bus Main Program 1st instruction 2nd instruction 3rd instruction 4th instruction last instruction
  • 28. 05/09/15 Presentation By Sania Gul 28 Instruction Cycle Instruction decoder & control unit Adder Inverter AND logic PC A B C 0H Add res s Contents 0H 80 H 1H 12 H 2H 40 H 3H 05 H 4H 75 H AH 06 H BH 01H MOV A,3H ADD A, 5H HLT 80 H12H 2H 3H ADD A,5H 4H Sum=8H Memory =16 Bytes Data Segment Code Segment 4 bit Address Bus 8 bit data bus RD control signal Note: if the instruction is of 2 bytes, it takes 2 Bus cycles to Fetch the instruction if the data Bus is 8 bit wide.
  • 29. 05/09/15 Presentation By Sania Gul 29 Instruction Cycle • Cycle means duration. The µP takes certain amount of time to execute the instruction. The time required varies from one processor to other & also depends on System Clock frequency f. • For example, the instruction ADD A, 5H takes 4 T states. • If the system clock frequency f=2 Hz, the • T=1/f = ½ =0.5 s • So ADD A, 5H  4 T = 4* 0.5= 2 s
  • 30. 05/09/15 Presentation By Sania Gul 30 Sub routines/ procedure or functions These are small programs written separately from the main program. These program are written separately because of many reasons like. 1. It makes programming modular, easy to debug, & allowing many programmers to work on small units of their interests. 2. The subroutine developed by one programmer can be used by other programmers in their own programs. 3. The subroutine can be called by main program many times without writing the sub routine code again & again so less memory is required. The program control is passed to subroutine when the main program calls it, & returned back to main program once the subroutine is finished.
  • 31. 05/09/15 Presentation By Sania Gul 31 Stack Segment (SS) • It is the portion of the RAM used for temporary storage of Data. • It is the data structure which works on LIFO (last in first out principle) like a stack of books. The last data pushed on the stack is the one which is popped first. • In Intel µPs, the stack storage starts from the highest address & continue towards the lower addresses. • In normal data structures the data is stored starting from the lowest address (the bottom) and continue towards the higher addresses even in Intel micro controller’s stack. Higher address Lower address Stack grows
  • 32. 05/09/15 Presentation By Sania Gul 32 Need of Stack Segment • When the main program calls sub routine, the program control shifts to sub routine & the Program counter PC is loaded with the address of the first instruction of sub routine. However at the end of subroutine, the control has to shifted back to the main program. • So before shifting the control to sub routine, the contents of PC are stored automatically on stack with the CALL instruction. And when the sub routine is over, the old contents of PC are automatically retrieved from the stack when the last instruction of sub-routine RET is executed & execution starts from the next instruction of the main program. which has called the sub-routine.
  • 33. 05/09/15 Presentation By Sania Gul 33
  • 34. 05/09/15 Presentation By Sania Gul 34 Need of Stack Segment • As there are very few registers inside µP, so it may be possible that the main program & sub-routine both require them. This is not possible if there was no stack. • So the programmer ensures that before the sub-routine uses the µP registers, the data inside these registers related to main program are stored on stack with the help of PUSH instructions & then POPPED from the stack at the end of sub-routine with the help of POP instruction. • The number of POPs instruction must be equal to number of PUSHES. • POPPING must be in reverse order of PUSHiNG to restore original contents due to LIFO principle.
  • 35. 05/09/15 Presentation By Sania Gul 35 Pushing means adding Popping means removing
  • 36. 05/09/15 Presentation By Sania Gul 36 Stack pointer • This register stores the address of the Top Of Stack (TOS), the top most valid filled location of SS. • As in Intel µPs, the stack grows from the higher address towards the lower one, so when the data is pushed on stack SP decrements & when it is popped from stack, SP increments.
  • 37. 05/09/15 Presentation By Sania Gul 37
  • 38. 05/09/15 Presentation By Sania Gul 38
  • 39. 05/09/15 Presentation By Sania Gul 39
  • 40. 05/09/15 Presentation By Sania Gul 40 Instruction pipelining • In old processors, one instruction is fetched, decoded & executed. After that the same process occurs for the second instruction & so on. • Fetching of the next instruction, while the current instruction executes is called pipelining. • This saves the time & increase processing speed.
  • 41. 05/09/15 Presentation By Sania Gul 41 BCD & Signed Numbers Unpacked BCD Packed BCD