SlideShare una empresa de Scribd logo
1 de 13
MEMORYREFERENCE
INSTRUCTIONS
1
Presented by: Rabin BK
BSc.CSIT 3rd Semester
Introduction to Memory Reference Instructions
Some terminologies
Memory Reference Instructions
References
2
There are seven different memory-reference instructions
Actual execution of the instruction in the bus system requires a sequence of
microoperations as data in memory cannot be processed directly
Microoperations are needed for the data to be read from memory to a
register to operate them on logic circuits
3
Introduction to Memory Reference Instructions
Symbol Operation Decoder
AND D0
ADD D1
LDA D2
STA D3
BUN D4
BSA D5
ISZ D6
Effective address (EA)
• Any operand to an instruction which references memory
• Basically enclosed inside a square brackets
• Calculated as: EA = Base + (Index*Scale) + Displacement
• Displacement — An 8-, 16-, or 32-bit value.
• Base — The value in a general-purpose register
• Index — The value in a general-purpose register
• Scale factor — A value of 2, 4, or 8 that is multiplied by the index value
DR → Data Register
AR → Address Register
IR → Instruction Register
PC → Program Counter
AC→ Accumulator
SC → Sequence Counter
4
Some terminologies
AND to AC
 Performs the AND logic operations on pairs of bits in AC and the
memory word specified by the effective address
 Two timing signals are needed
• In T4 transfering operand from memory into DR
• In T5 transfering result of AND logic operation between the contents
of DR and AC
• In T5 SC is cleared to 0 and control is transfered to T0 to start a new
instruction cycle
 Example:
• D0T4: DR←M[AR]
• D0T5: AC←AC∧ DR, SC←0
5
Instructions
ADD to AC
 Adds the contents of memory word specified by the effective
address to the value of AC
 Sum is transferred into AC and the output carry Cout is transferred to
the E(extended accumulator) flip flop
 Two timing signals are needed but decoder D1 instead of D0
 Example:
• D1T4: DR←M[AR]
• D1T5: AC←AC+DR, E←Cout SC←0
6
Instructions cont...
LDA:Load to AC
 Tranfers the memory word specified by the effective address to AC
 Necessary to read the memory word into DR first and transfer the
contents of DR into AC
 there is no direct path from bus into AC
 to maintain one clock cycle as well
 Example:
 D2T4: DR←M[AR]
 D2T5: AC←DR SC←0
7
Instructions cont...
STA:Store AC
Stores the content of AC into the memory word specified by the
effective address
 The output of AC is applied to the bus and the data input of
memory is connected to the bus
 Example:
 D3T4: M[AR]←AC, SC←0
8
Instructions cont...
BUN:Branch Unconditionally
 PC is incremented at time T1 to prepare it for the address of the next
instruction in the program sequence
 BUN transfers the program to the instruction specified by the
effective address
 Allows the programmer to specify an instruction out of sequence
and we say that the program branches (jumps) unconditionally
 Example:
 D4T4: PC←AR SC←0 (resetting SC transfers control to T4)
9
Instructions cont...
BSA:Branch and Save Return Address
 Useful for branching to a portion of the program called a subroutine
or procedure
 When executed, it stores the address of the next instruction in
sequence (which is available in PC) into a memory location
specified by the effective address
 (Effective address + 1) is then transferred to PC to serve as the
address of the first instruction in the subroutine
 The return to the original program is accomplished by the BUN
instruction placed at the end of the subroutine
 Example:
 D5T4: M[AR]←PC, AR←AR+1
 D5T5: PC ← AR, SC←0
10
Instructions cont...
ISZ:Increment and Skip if Zero
 Increments the word specified by the effective address
 If the incremented value is equal to 0, PC is incremented by 1
 When a negative number(in 2's compelement) stored in memory word is
repeatedy incremented by 1 it eventually reaches zero
 At this time PC is incremented by one in order to skip the next
instruction in the program
 It is necessary to read the word into DR, increment DR and store the
word back into memory since it is not possible to increment a word
inside the memory
 Example:
 D6T4: DR←M[AR]
 D6T5: DR←DR+1
 D6T6: M[AR] ← DR, if (DR=0) then (PC←PC+1), SC←0
11
Instructions cont...
References
• Dasgupta, S., Computer Architecture: A Modern Synthersis, Vol. 2 New
York: John Wiley, 1989
• M.Morris Mano, Computer System Architecture, Pearson, Third Edition
• https://www.tortall.net/projects/yasm/manual/html/nasm-effaddr.html
• http://faculty.cs.niu.edu/~berezin/463/notes/addrmode.html
• https://everything2.com/title/Effective+address
12
Queries
13

Más contenido relacionado

La actualidad más candente

Computer instructions
Computer instructionsComputer instructions
Computer instructions
Anuj Modi
 
Registers and-common-bus
Registers and-common-busRegisters and-common-bus
Registers and-common-bus
Anuj Modi
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
sheetal singh
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
mekind
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
Haris456
 

La actualidad más candente (20)

Computer instructions
Computer instructionsComputer instructions
Computer instructions
 
Register organization, stack
Register organization, stackRegister organization, stack
Register organization, stack
 
Registers and-common-bus
Registers and-common-busRegisters and-common-bus
Registers and-common-bus
 
instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Instruction cycle
Instruction cycleInstruction cycle
Instruction cycle
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 
Micro program example
Micro program exampleMicro program example
Micro program example
 
bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)bus and memory tranfer (computer organaization)
bus and memory tranfer (computer organaization)
 
Basic Computer Organization and Design
Basic Computer Organization and DesignBasic Computer Organization and Design
Basic Computer Organization and Design
 
Computer Organisation - Addressing Modes
Computer Organisation - Addressing ModesComputer Organisation - Addressing Modes
Computer Organisation - Addressing Modes
 
Addressing sequencing
Addressing sequencingAddressing sequencing
Addressing sequencing
 
Computer architecture instruction formats
Computer architecture instruction formatsComputer architecture instruction formats
Computer architecture instruction formats
 
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.COMPUTER INSTRUCTIONS & TIMING & CONTROL.
COMPUTER INSTRUCTIONS & TIMING & CONTROL.
 
Memory organization (Computer architecture)
Memory organization (Computer architecture)Memory organization (Computer architecture)
Memory organization (Computer architecture)
 
Memory organization in computer architecture
Memory organization in computer architectureMemory organization in computer architecture
Memory organization in computer architecture
 
Instruction Formats
Instruction FormatsInstruction Formats
Instruction Formats
 
Addressing mode Computer Architecture
Addressing mode  Computer ArchitectureAddressing mode  Computer Architecture
Addressing mode Computer Architecture
 

Similar a Memory Reference Instructions

Similar a Memory Reference Instructions (20)

Memory reference
Memory referenceMemory reference
Memory reference
 
UNIT-3.pptx
UNIT-3.pptxUNIT-3.pptx
UNIT-3.pptx
 
ITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptxITEC582-Chapter 12.pptx
ITEC582-Chapter 12.pptx
 
CO_Chapter2.ppt
CO_Chapter2.pptCO_Chapter2.ppt
CO_Chapter2.ppt
 
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed controlB.sc cs-ii-u-3.1-basic computer programming and micro programmed control
B.sc cs-ii-u-3.1-basic computer programming and micro programmed control
 
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed controlBca 2nd sem-u-3.1-basic computer programming and micro programmed control
Bca 2nd sem-u-3.1-basic computer programming and micro programmed control
 
Ch12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdfCh12- instruction sets- char & funct.pdf
Ch12- instruction sets- char & funct.pdf
 
System Software
System SoftwareSystem Software
System Software
 
basic computer programming and micro programmed control
basic computer programming and micro programmed controlbasic computer programming and micro programmed control
basic computer programming and micro programmed control
 
Mca i-u-3-basic computer programming and micro programmed control
Mca i-u-3-basic computer programming and micro programmed controlMca i-u-3-basic computer programming and micro programmed control
Mca i-u-3-basic computer programming and micro programmed control
 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
 
Compreport
CompreportCompreport
Compreport
 
Assignment on different types of addressing modes
Assignment on different types of addressing modesAssignment on different types of addressing modes
Assignment on different types of addressing modes
 
Assembler
AssemblerAssembler
Assembler
 
Csa ic
Csa icCsa ic
Csa ic
 
Examinable Question and answer system programming
Examinable Question and answer system programmingExaminable Question and answer system programming
Examinable Question and answer system programming
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Ch2 csda
Ch2 csdaCh2 csda
Ch2 csda
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
 
Programming the basic computer
Programming the basic computerProgramming the basic computer
Programming the basic computer
 

Más de Rabin BK

Más de Rabin BK (20)

Artificial Intelligence in E-commerce
Artificial Intelligence in E-commerceArtificial Intelligence in E-commerce
Artificial Intelligence in E-commerce
 
Three address code generation
Three address code generationThree address code generation
Three address code generation
 
Consumer Oriented Application, Mercantile process and Mercantile models
Consumer Oriented Application, Mercantile process and Mercantile modelsConsumer Oriented Application, Mercantile process and Mercantile models
Consumer Oriented Application, Mercantile process and Mercantile models
 
Clang compiler `
Clang compiler `Clang compiler `
Clang compiler `
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
HTML text formatting tags
HTML text formatting tagsHTML text formatting tags
HTML text formatting tags
 
Data encryption in database management system
Data encryption in database management systemData encryption in database management system
Data encryption in database management system
 
Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)Object Relational Database Management System(ORDBMS)
Object Relational Database Management System(ORDBMS)
 
Kolmogorov Smirnov
Kolmogorov SmirnovKolmogorov Smirnov
Kolmogorov Smirnov
 
Job sequencing in Data Strcture
Job sequencing in Data StrctureJob sequencing in Data Strcture
Job sequencing in Data Strcture
 
Stack Data Structure
Stack Data StructureStack Data Structure
Stack Data Structure
 
Bluetooth
BluetoothBluetooth
Bluetooth
 
Data Science
Data ScienceData Science
Data Science
 
Graphics_3D viewing
Graphics_3D viewingGraphics_3D viewing
Graphics_3D viewing
 
Neural Netwrok
Neural NetwrokNeural Netwrok
Neural Netwrok
 
Watermarking in digital images
Watermarking in digital imagesWatermarking in digital images
Watermarking in digital images
 
Heun's Method
Heun's MethodHeun's Method
Heun's Method
 
Mutual Exclusion
Mutual ExclusionMutual Exclusion
Mutual Exclusion
 
Systems Usage
Systems UsageSystems Usage
Systems Usage
 
Manager of a company
Manager of a companyManager of a company
Manager of a company
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Memory Reference Instructions

  • 2. Introduction to Memory Reference Instructions Some terminologies Memory Reference Instructions References 2
  • 3. There are seven different memory-reference instructions Actual execution of the instruction in the bus system requires a sequence of microoperations as data in memory cannot be processed directly Microoperations are needed for the data to be read from memory to a register to operate them on logic circuits 3 Introduction to Memory Reference Instructions Symbol Operation Decoder AND D0 ADD D1 LDA D2 STA D3 BUN D4 BSA D5 ISZ D6
  • 4. Effective address (EA) • Any operand to an instruction which references memory • Basically enclosed inside a square brackets • Calculated as: EA = Base + (Index*Scale) + Displacement • Displacement — An 8-, 16-, or 32-bit value. • Base — The value in a general-purpose register • Index — The value in a general-purpose register • Scale factor — A value of 2, 4, or 8 that is multiplied by the index value DR → Data Register AR → Address Register IR → Instruction Register PC → Program Counter AC→ Accumulator SC → Sequence Counter 4 Some terminologies
  • 5. AND to AC  Performs the AND logic operations on pairs of bits in AC and the memory word specified by the effective address  Two timing signals are needed • In T4 transfering operand from memory into DR • In T5 transfering result of AND logic operation between the contents of DR and AC • In T5 SC is cleared to 0 and control is transfered to T0 to start a new instruction cycle  Example: • D0T4: DR←M[AR] • D0T5: AC←AC∧ DR, SC←0 5 Instructions
  • 6. ADD to AC  Adds the contents of memory word specified by the effective address to the value of AC  Sum is transferred into AC and the output carry Cout is transferred to the E(extended accumulator) flip flop  Two timing signals are needed but decoder D1 instead of D0  Example: • D1T4: DR←M[AR] • D1T5: AC←AC+DR, E←Cout SC←0 6 Instructions cont...
  • 7. LDA:Load to AC  Tranfers the memory word specified by the effective address to AC  Necessary to read the memory word into DR first and transfer the contents of DR into AC  there is no direct path from bus into AC  to maintain one clock cycle as well  Example:  D2T4: DR←M[AR]  D2T5: AC←DR SC←0 7 Instructions cont...
  • 8. STA:Store AC Stores the content of AC into the memory word specified by the effective address  The output of AC is applied to the bus and the data input of memory is connected to the bus  Example:  D3T4: M[AR]←AC, SC←0 8 Instructions cont...
  • 9. BUN:Branch Unconditionally  PC is incremented at time T1 to prepare it for the address of the next instruction in the program sequence  BUN transfers the program to the instruction specified by the effective address  Allows the programmer to specify an instruction out of sequence and we say that the program branches (jumps) unconditionally  Example:  D4T4: PC←AR SC←0 (resetting SC transfers control to T4) 9 Instructions cont...
  • 10. BSA:Branch and Save Return Address  Useful for branching to a portion of the program called a subroutine or procedure  When executed, it stores the address of the next instruction in sequence (which is available in PC) into a memory location specified by the effective address  (Effective address + 1) is then transferred to PC to serve as the address of the first instruction in the subroutine  The return to the original program is accomplished by the BUN instruction placed at the end of the subroutine  Example:  D5T4: M[AR]←PC, AR←AR+1  D5T5: PC ← AR, SC←0 10 Instructions cont...
  • 11. ISZ:Increment and Skip if Zero  Increments the word specified by the effective address  If the incremented value is equal to 0, PC is incremented by 1  When a negative number(in 2's compelement) stored in memory word is repeatedy incremented by 1 it eventually reaches zero  At this time PC is incremented by one in order to skip the next instruction in the program  It is necessary to read the word into DR, increment DR and store the word back into memory since it is not possible to increment a word inside the memory  Example:  D6T4: DR←M[AR]  D6T5: DR←DR+1  D6T6: M[AR] ← DR, if (DR=0) then (PC←PC+1), SC←0 11 Instructions cont...
  • 12. References • Dasgupta, S., Computer Architecture: A Modern Synthersis, Vol. 2 New York: John Wiley, 1989 • M.Morris Mano, Computer System Architecture, Pearson, Third Edition • https://www.tortall.net/projects/yasm/manual/html/nasm-effaddr.html • http://faculty.cs.niu.edu/~berezin/463/notes/addrmode.html • https://everything2.com/title/Effective+address 12