Lecture Notes - Microprocessor - Unit 1 - Microprocessor Architecture and its operation

1,989 views 33 slides Jan 20, 2025
Slide 1
Slide 1 of 33
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33

About This Presentation

Description:
Welcome to the comprehensive guide on Microprocessor and micro controller tailored for First year (Second Semester) B.Sc. Computer Science students affiliated with Alagappa University. This document covers fundamental concepts of microprocessor and micro controller. PDF content is prep...


Slide Content

Microprocessor and Micro Controller
Unit I
Microprocessor Architecture and its Operation
Prepared By
Dr.S.Murugan, Associate Professor
Department of Computer Science,
AlagappaGovernmentArts College, Karaikudi.
(Affiliated by AlagappaUniversity)
Mailid: [email protected]
Reference Book:
Microprocessor Architecture –Programming and Applications with 8085 –R. S. Gaonkar

Introduction -Microprocessor Architecture and
its Operation

Microprocessor
➢Themicroprocessorisaprogrammabledigitaldevice,
designedwithregisters,flip-flopsandtimingelement.
➢Itisacentralprocessingunit(CPU)onasingle
integratedcircuit(IC)chipthatperformsarithmetic
andlogicoperations,datatransfer,andcontrol
operations.
➢Itactsasthebrainofacomputerorembeddedsystem.

Microprocessor architecture
➢Microprocessorarchitecturereferstotheinternal
structureandorganizationofcomponentsina
microprocessor,includingitsregisters,buses,
instructionset,andcontrolunit,whichcollectively
determinehowitprocessesdata.
➢Thefunctionofmicroprocessorcanbeclassifiedinto
threegeneralcategories;
(i)Microprocessor-initiatedoperations
(ii)internaloperations
(iii)peripheraloperations.

Microprocessor architecture
➢Toperformtheabovefunctions,themicroprocessor
requiresagroupoflogiccircuitsandasetofsignals
calledcontrolsignal.
➢Acontrolsignalisanelectricalsignalgeneratedby
thecontrolunitofamicroprocessororcomputer
systemtocoordinateandcontroltheoperationofother
components,suchasmemory,input/outputdevices,
andtheprocessoritself.

Microprocessor architecture
➢ TheCentralProcessingUnit(CPU)andtheMicro
ProcessorUnit(MPU)isrelatedbutnotsame.ACPU
canbeimplementedasacombinationofmorethan
onechip.
➢Whereas,theMPUrefersasinglechipprocessor.The
microprocessorandMicroProcessorUnitoftenare
usedsynonymously.

Microprocessor initiated operations and Bus
Organization

Microprocessor initiated operations
➢ Microprocessor-initiatedoperationsaretasksperformed
bythemicroprocessortocommunicatewithmemoryand
peripherals,suchasmemoryread,memorywrite,I/Oread,
andI/Owriteoperations.
➢The MPU performs primarily four operations :
1.Memory Read : Reads data or instructions from memory.
2.Memory Write : Write data or instructions into memory.
3.I/O Read : Accepts data from input devices.
4.I/O Write : Sends data to output devices.

Microprocessor initiated operations
➢Tocommunicatewithaperipheraloramemory
location,theMPUneedstoperformthefollowing
steps:
1.Identify the peripheral or the memory location (with
its address)
2.Transfer binary information (data and instruction)
3.Provide timing or synchronization signals.
The8085MPUperformsthesefunctionsusingthree
setsofcommunicationlinescalledbuses:theaddress
bus,thedatabus,andthecontrolbus.

8085 Bus Organization
➢The8085busorganizationreferstothesystemof
busesusedbythe8085microprocessorto
communicatewithmemory,input/outputdevices,
andothercomponentsasshowninFigure1.1.
➢The8085microprocessorhasthreeprimarybuses:
AddressBus,DataBus,andControlBus,each
servingaspecificpurposeinthemicroprocessor's
operation.

8085 Bus Organization
Fig. 1.1 The 8085 Bus Structure

AddressBus
➢Theaddressbusisagroupof16linesgenerally
identifiedasA0toA15.
➢Itisunidirectional(bitsflowinonedirection)fromthe
microprocessortothememoryorperipheraldevices.
➢TheMPUusestheaddressbustospecifythememory
locationorI/Odevicetobeaccessed.
➢Inthe8085microprocessors,theaddressis16bits,
allowingaccessto2
16
=65,536(64KB)memory
locations.

AddressBus

DataBus
➢Thedatabusisagroupof8linesgenerallyidentified
asD0toD7.
➢Itisbi-directional(bitsflowinbothdirection)
betweenthemicroprocessorandthememoryor
peripheraldevices.
➢Thedatabusisusedtotransferdatabetweenthe
processor,memory,andI/Odevices.
➢TheeightdatalinesenabletheMPUtomanipulate8-
bitdatarangingfrom00toFF(2
8
=256).

DataBus
➢Thesmallestnumberthatcanappearonthedatabus
00000000(00).
➢Thelargestnumberthatcanappearonthedatabus
11111111(FF).
➢sothatthe8085isknownasan8-bitmicroprocessor

Difference between Data Bus and Address Bus
S. No.Feature Data Bus Address Bus
1.DirectionBidirectional Unidirectional
2.
Purpose
Transfers data or
instructions
Carries memory/I/O
addresses
3.Size
(8085)
8 bits 16 bits
4Functional
ity
Exchanges data
between components
Identifies memory or
I/O locations

Control Bus
➢Thecontrolbusiscomprisedofvarioussinglelines
thatcarrysynchronizationsignals.
➢Itisusedtoprovidethetimingorsynchronization
signals.
➢Thecontrolbuslinesarenotagroupoflineslike
addressbusordatabus,theindividuallinesthat
provideapulsetoindicateanMPUoperation.
➢TheMPUgeneratescontrolsignalsforevery
operation(suchasmemoryreadormemorywrite
operations).

Control Bus
➢Thecontrolbuscarriescontrolsignalstocoordinate
andmanagecommunicationbetweentheprocessor,
memory,andperipherals.Importantcontrolsignals
include:
oRD (Read):Indicates data is being read.
oWR (Write):Indicates data is being written.
oALE (Address Latch Enable):Distinguishes
address and data on the same lines.
oIO/M:Differentiates memory and I/O operations.
The control bus ensures proper synchronization
during data transfer.

Control Bus -Example
➢ForExamplethefollowinginstruction,thedata78is
transferredintoRegisterB.
200006MVIB,78H
➢Here2000isamemorylocation,06isahexcodefor
immediatedatatransfertoRegisterB.
Fig. 1.2 Memory Read Operation

Control Bus -Example
➢Thefollowingsequenceofstepstobefollowedtoread
aninstructionfromamemorylocationasshowninFig
1.2.
1.16-bitaddress(2000)placedontheaddressbus.
2.Theaddressisdecodedbyexternallogiccircuitand
thememorylocationisidentified.
3.MPUsendsthememoryreadcontrolsignal(pulse).
4.Thepulseactivatesthememorychip.
5.Thecontentsofthememorylocation(8-bitdata–06)
placedonthedatabusandbroughtinsidetheMPU.

Internal Data Operations and the 8085 Registers

Internal Data Operations
➢Internaldataoperationinthe8085microprocessor
referstooperationsthatmanipulatedatawithinthe
microprocessor,usingitsinternalregistersandthe
accumulator.
➢Theseoperationsincludearithmetic,logical,anddata
transferinstructionsthatinvolvetemporarystorage
andprocessingwithoutexternalmemoryaccess.For
example,addingtwonumbers,performingalogical
ANDoperation,ormovingdatabetweenregisters.
Theaccumulatorandgeneral-purposeregistersare
primarilyinvolvedintheseoperations.

Internal Data Operations
➢Theinternalarchitectureofthe8085microprocessor
determineshowandwhatoperationscanbeperformed
withthedata.Theseoperationsare
➢Store8-bitdata
➢Performarithmeticandlogicaloperations.
➢Testforconditions(CarryFlag).
➢Sequencetheexecutionofinstructions
(ProgramCounter)
➢Storedatatemporarilyduringexecutioninthe
definedR/Wmemorylocationscalledthestack.

8085 Registers
➢Toperformtheaboveoperations,themicroprocessor
requiresregisters,anarithmetic/logicunit(ALU),
controllogicandinternalbuses.
➢Theprogrammingmodelofthe8085displayingthe
internalregistersandaccumulatorasshowninthe
figure1.3.
Fig. 1.3 The 8085 Programmable Registers

8085 Registers
➢The8085microprocessorhasseveralprogrammable
registersthatperformspecificfunctionsindata
handlingandprocessing.
➢Here'saconciseexplanationofeachcomponent:
➢Accumulator (A): Stores results of arithmetic,
logical operations, and intermediate data.
➢General Purpose Registers (B, C, D, E, H, L):
Used for temporary storage of data during
operations.
➢Flag Register: Contains status flags (Z, S, P, CY,
AC) indicating conditions after operations.

8085 Registers
➢Program Counter (PC): Holds the address of the
next instruction to be executed.
➢Stack Pointer (SP): Points to the top of the stack,
used for subroutine calls and returns.
➢Instruction Register (IR): Holds the current
instruction being decoded and executed.
➢Temporary Register: Holds intermediate data
during execution, typically used for internal
operations.

Microprocessor function -Example program
➢Thefollowingexampleprogram(additionoftwo
numbers)demonstratesthefunctionofthe
microprocessor.
➢Thehexcodesoftheprogramarestoredinmemory
locationsfrom2000to2005asshowninFig.1.2.

Microprocessor function with Example program
Memory
Location
Hex
Code
MnemonicsComments
2000 06MVIB,78H;Transferthevalue78intoRegisterB.
2001 78
2002 3EMVIA,F2H;TransferthevalueF2toAccumulator.
2003 F2
2004 80ADDB ;ThecontentofRegisterBisaddedwith
Accumulatorandtheresultsarestoredin
Accumulator.
2005 76HLT ;TerminatetheProgram

Microprocessor function with Example program
➢Whenexecutestheaboveinstructions,the
microprocessorplacestheaddress2000intoaddress
busandincrementstheaddressinthePC(Program
Counter)to2001forthenextoperation.Itbringsthe
code06,interpretsthecode,placestheaddress2001
ontheaddressbus,andthengetsbyte78Hand
incrementstheaddressinPCto2002.
➢TheFirsttwoinstructionisusedtotransferthedata
intoregisterBandRegisterA.

Microprocessor function with Example program
➢ThethirdinstructionADDisusedtoperformthe
additionoperationandtheresultisstoredinto
accumulator.Inthiscase78+F2=16AH,the
accumulatorholdsonlythevalue6A,thevalue1
indicatesthecarryflag.
➢TheFourthinstructionterminatestheprogram.

Peripheral or Externally Initiated Operation
➢External devices can initiate the following operations :
Reset, Interrupt, Ready and Hold.
➢Reset:Whentheresetpinisactivatedbyexternalkey
(resetkey),allinternaloperationsaresuspendedand
theprogramcounteriscleared.Now,theprogram
executioncanbeginatthezeromemoryaddress.
➢Interrupt:Themicroprocessorcanbeinterrupted
fromthenormalexecutionofinstructionsandaskedto
executesomeotherinstructionscalledaservice
routine.Themicroprocessorresumesitsoperation
aftercompletingtheserviceroutine.

Peripheral or Externally Initiated Operation
➢Ready:Ifthesignalofthisreadypinislow,the
microprocessorentersintoawaitstate.Ifitishigh,the
microprocessorreadytosendorreceivedata.
➢Hold:WhentheHOLDpinisactivatedbyan
externalsignal,themicroprocessorrelinquishes
controlofbusesandallowstheexternalperipheralsto
usethem.Forexample,theHOLDsignalisusedin
DirectMemoryAccess(DMA)datatransfer.

Difference between Microprocessor-initiated
operation and Peripheral-Initiated Operation
FeatureMicroprocessor-InitiatedPeripheral-Initiated
InitiatorMicroprocessor External device (peripheral)
Examples
Memory Read, Memory
Write, I/O Read
Interrupts, Direct Memory
Access (DMA)
Control
Controlled by
microprocessor signals
Triggered by external signals
PrioritySequentially executedCan interrupt current operations
Execution
Part of the microprocessor
program flow
Requires special handling like
ISR