SlideShare a Scribd company logo
1 of 9
Download to read offline
AC ¬ AC + M[X ] 
X = Operand Address 
R1¬ R2 + R3 
TOS ¬ M[X ] 
R ¬ M A + 
M B 
1 [ ] [ ] 
ADD R1, A, B 
ADD R2, C, D 
MUL X, R1, R2 [ ] 1 2 
R ¬ M C + 
M D 
2 [ ] [ ] 
M X ¬ R * 
R 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
1 / 22 
 3 types of CPU organizations 
l 1) Single AC Org. : ADD X 
l 2) General Register Org. : ADD R1, R2, R3 
l 3) Stack Org. : PUSH X 
 The influence of the number of addresses on computer instruction 
X = (A + B)*(C + D) 
- 4 arithmetic operations : ADD, SUB, MUL, DIV 
- 1 transfer operation to and from memory and general register : MOV 
- 2 transfer operation to and from memory and AC register : STORE, LOAD 
- Operand memory addresses : A, B, C, D 
- Result memory address : X 
l 1) Three-Address Instruction 
» Each address fields specify either a processor register or a memory operand 
» : Short program 
» Require too many bit to specify 3 address 
y 
8-4. Instruction Formats
8-4. Instruction Formats 
R ¬ 
M A 
1 [ ] 
MOV R1, A 
ADD R1, B 
MOV R2, C 
ADD R2, D 
MUL R1, R2 
MOV X, R1 [ ] 1 
R ¬ R + 
M B 
1 1 [ ] 
R ¬ 
M C 
2 [ ] 
R ¬ R + 
M D 
2 2 [ ] 
R ¬ R * 
R 
1 1 2 
M X ¬ 
R 
AC ¬ 
M A 
[ ] 
LOAD A 
ADD B 
STORE T 
LOAD C 
ADD D 
MUL T 
STORE X M X AC 
AC ¬ AC + 
M B 
M [ T ] 
¬ 
AC 
AC ¬ 
M C 
[ ] 
[ ] 
AC ¬ AC + 
M D 
[ ] 
AC ¬ AC * 
M T 
¬ 
[ ] 
[ ] 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
2 / 22 
l 2) Two-Address Instruction 
» The most common in commercial computers 
» Each address fields specify either a processor register or a memory operand 
l 3) One-Address Instruction 
» All operations are done between the AC register and memory operand
8-4. Instruction Formats 
TOS ¬ 
A 
PUSH A 
PUSH B 
TOS ¬ 
B 
ADD 
PUSH C 
PUSH D 
ADD 
MUL 
POP X M X TOS 
TOS ¬ A + 
B 
( ) 
TOS ¬ 
C 
TOS ¬ 
D 
TOS ¬ C + 
D 
( ) 
TOS ¬ C + D * A + 
B 
( ) ( ) 
¬ 
[ ] 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
3 / 22 
l 4) Zero-Address Instruction 
» Stack-organized computer does not use an address field for the instructions ADD, and 
MUL 
» PUSH, and POP instructions need an address field to specify the operand 
» Zero-Address : absence of address ( ADD, MUL )
8-5. Addressing Modes 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
4 / 22 
 Addressing Mode 
l 1) To give programming versatility to the user 
» pointers to memory, counters for loop control, indexing of data, …. 
l 2) To reduce the number of bits in the addressing field of the instruction 
 Instruction Cycle 
l 1) Fetch the instruction from memory and PC + 1 
l 2) Decode the instruction 
l 3) Execute the instruction
8-5. Addressing Modes 
Opcode Mode Address 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
5 / 22 
 Program Counter (PC) 
l PC keeps track of the instructions in the program stored in memory 
l PC holds the address of the instruction to be executed next 
l PC is incremented each time an instruction is fetched from memory 
 Addressing Mode of the Instruction 
1) Distinct Binary Code 
2) Single Binary Code 
 Implied Mode 
l Operands are specified implicitly in definition of the instruction 
l Examples 
» CMA : Complement Accumulator 
n Operand in AC is implied in the definition of the instruction 
» PUSH : Stack push 
n Operand is implied to be on top of the stack
8-5. Addressing Modes 
AC ¬ R1 Implied Mode 
AC ¬ M[R1] 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
6 / 22 
 Immediate Mode 
l Operand field contains the actual operand 
l Useful for initializing registers to a constant value 
l Example : LDA #NBR 
 Register Mode 
l Operands are in registers 
l Register is selected from a register field in the instruction 
» k-bit register field can specify any one of 2k registers 
l Example : LDA R1 
 Register Indirect Mode 
l Selected register contains the address of the operand rather than the operand 
itself 
l Address field of the instruction uses fewer bits to select a memory address 
l Example : LDA (R1) 
 Autoincrement or Autodecrement Mode 
l Similar to the register indirect mode except that 
» the register is incremented after its value is used to access memory 
» the register is decrement before its value is used to access memory
8-5. Addressing Modes 
AC ¬ M[R1], R1¬ R1+1 
ADR = Address part of Instruction 
AC ¬ M[ADR] 
AC ¬ M[M[ADR]] 
AC ¬ M[PC + ADR] 
AC ¬ M[ADR + XR] 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
7 / 22 
l Example (Autoincrement) : LD (R1)+ 
 Direct Addressing Mode 
l Effective address is equal to the address field of the instruction (Operand) 
l Address field specifies the actual branch address in a branch-type instruction 
l Example : LD ADR 
 Indirect Addressing Mode 
l Address field of instruction gives the address where the effective address is 
stored in memory 
l Example : LD @ADR 
 Relative Addressing Mode 
l PC is added to the address part of the instruction to obtain the effective address 
l Example : LD $ADR 
 Indexed Addressing Mode 
l XR (Index register) is added to the address part of the instruction to obtain the 
effective address 
l Example : LD ADR(XR) 
 Base Register Addressing Mode 
l the content of a base register is added to the address part of the instruction to 
obtain the effective address 
AC ¬ M[BR + ADR]
Numerical Example 
A d d r e s s M e m o r y 
4 5 0 
2 0 1 
2 0 2 
3 9 9 
4 0 0 
5 0 0 
6 0 0 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
8 / 22 
L o a d t o A C M o d e 
A d d r e s s = 5 0 0 
N e x t in s t r u c t i o n 
7 0 0 
8 0 0 
9 0 0 
3 2 5 
3 0 0 
P C = 2 0 0 
R 1 = 4 0 0 
X R = 1 0 0 
A C 
2 0 0 
7 0 2 
8 0 0
8-5. Addressing Modes 
Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 
9 / 22 
Addressing Mode Effective Address Content of AC 
Immediate Address Mode 201 500 
Direct Address Mode 500 800 
Indirect Address Mode 800 300 
Register Mode 400 
Register Indirect Mode 400 700 
Relative Address Mode 702 325 
Indexed Address Mode 600 900 
Autoincrement Mode 400 700 
Autodecrement Mode 399 450 
A d d r e s s M e m o r y 
L o a d t o A C M o d e 
A d d r e s s = 5 0 0 
N e x t in s t r u c t io n 
4 5 0 
7 0 0 
8 0 0 
9 0 0 
3 2 5 
3 0 0 
P C = 2 0 0 
R 1 = 4 0 0 
X R = 1 0 0 
A C 
2 0 0 
2 0 1 
2 0 2 
3 9 9 
4 0 0 
5 0 0 
6 0 0 
7 0 2 
8 0 0

More Related Content

What's hot

Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
Subesh Kumar Yadav
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
Mahesh Kumar Attri
 
09 chapter04 timers_fa14
09 chapter04 timers_fa1409 chapter04 timers_fa14
09 chapter04 timers_fa14
John Todora
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Hsien-Hsin Sean Lee, Ph.D.
 

What's hot (19)

central processing unit and pipeline
central processing unit and pipelinecentral processing unit and pipeline
central processing unit and pipeline
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
Instruction codes and computer registers
Instruction codes and computer registersInstruction codes and computer registers
Instruction codes and computer registers
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Cpu unit
Cpu unitCpu unit
Cpu unit
 
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
Bca 2nd sem-u-2.1-overview of register transfer, micro operations and basic c...
 
Memory Reference Instructions
Memory Reference InstructionsMemory Reference Instructions
Memory Reference Instructions
 
COMPUTER ORGANIZATION NOTES Unit 2
COMPUTER ORGANIZATION NOTES  Unit 2COMPUTER ORGANIZATION NOTES  Unit 2
COMPUTER ORGANIZATION NOTES Unit 2
 
Computer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) pptComputer arithmetics (computer organisation & arithmetics) ppt
Computer arithmetics (computer organisation & arithmetics) ppt
 
Register transfer and micro-operation
Register transfer and micro-operationRegister transfer and micro-operation
Register transfer and micro-operation
 
Instruction codes
Instruction codesInstruction codes
Instruction codes
 
Computer organization and architecture
Computer organization and architectureComputer organization and architecture
Computer organization and architecture
 
Memory Reference instruction
Memory Reference instructionMemory Reference instruction
Memory Reference instruction
 
Addressing modes (detailed data path)
Addressing modes (detailed data path)Addressing modes (detailed data path)
Addressing modes (detailed data path)
 
09 chapter04 timers_fa14
09 chapter04 timers_fa1409 chapter04 timers_fa14
09 chapter04 timers_fa14
 
Pipeline r014
Pipeline   r014Pipeline   r014
Pipeline r014
 
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
Lec18 Intro to Computer Engineering by Hsien-Hsin Sean Lee Georgia Tech -- In...
 
Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)Instruction Set Architecture (ISA)
Instruction Set Architecture (ISA)
 
Various type of register
Various type of registerVarious type of register
Various type of register
 

Similar to Ch 8

Ch8_CENTRAL PROCESSING UNIT Registers ALU
Ch8_CENTRAL PROCESSING UNIT Registers ALUCh8_CENTRAL PROCESSING UNIT Registers ALU
Ch8_CENTRAL PROCESSING UNIT Registers ALU
RNShukla7
 
central processing unit.ppt
central processing unit.pptcentral processing unit.ppt
central processing unit.ppt
ssuserd27779
 

Similar to Ch 8 (20)

Unit iii mca 1st year
Unit iii mca 1st yearUnit iii mca 1st year
Unit iii mca 1st year
 
Chapter8.ppt
Chapter8.pptChapter8.ppt
Chapter8.ppt
 
UNIT-3.pptx
UNIT-3.pptxUNIT-3.pptx
UNIT-3.pptx
 
COA_mod2.ppt
COA_mod2.pptCOA_mod2.ppt
COA_mod2.ppt
 
7. CPU_Unit3 (1).pdf
7. CPU_Unit3 (1).pdf7. CPU_Unit3 (1).pdf
7. CPU_Unit3 (1).pdf
 
Chapter3.ppt
Chapter3.pptChapter3.ppt
Chapter3.ppt
 
Ch8_CENTRAL PROCESSING UNIT Registers ALU
Ch8_CENTRAL PROCESSING UNIT Registers ALUCh8_CENTRAL PROCESSING UNIT Registers ALU
Ch8_CENTRAL PROCESSING UNIT Registers ALU
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and Architecture
 
Mca i-u-4 central processing unit and pipeline
Mca i-u-4 central processing unit and pipelineMca i-u-4 central processing unit and pipeline
Mca i-u-4 central processing unit and pipeline
 
central processing unit.ppt
central processing unit.pptcentral processing unit.ppt
central processing unit.ppt
 
Bca 2nd sem-u-4 central processing unit and pipeline
Bca 2nd sem-u-4 central processing unit and pipelineBca 2nd sem-u-4 central processing unit and pipeline
Bca 2nd sem-u-4 central processing unit and pipeline
 
B.sc cs-ii-u-4 central processing unit and pipeline
B.sc cs-ii-u-4 central processing unit and pipelineB.sc cs-ii-u-4 central processing unit and pipeline
B.sc cs-ii-u-4 central processing unit and pipeline
 
CAO_Unit-3.ppt
CAO_Unit-3.pptCAO_Unit-3.ppt
CAO_Unit-3.ppt
 
Chapter8.ppt
Chapter8.pptChapter8.ppt
Chapter8.ppt
 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
 
Central processor organization
Central processor organizationCentral processor organization
Central processor organization
 
pdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.pptpdfslide.net_morris-mano-ppt.ppt
pdfslide.net_morris-mano-ppt.ppt
 
CPU Register Organization.ppt
CPU Register Organization.pptCPU Register Organization.ppt
CPU Register Organization.ppt
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Types of Instruction Format
Types of Instruction FormatTypes of Instruction Format
Types of Instruction Format
 

More from Nitesh Singh (20)

Risk taking and emotions
Risk taking and emotionsRisk taking and emotions
Risk taking and emotions
 
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SADProject report RAILWAY TICKET RESERVATION SYSTEM SAD
Project report RAILWAY TICKET RESERVATION SYSTEM SAD
 
The real comedy behind comedy
The real comedy behind comedyThe real comedy behind comedy
The real comedy behind comedy
 
Project report Rs Dry celaners
Project report Rs Dry celaners Project report Rs Dry celaners
Project report Rs Dry celaners
 
BIG DATA ANALYSIS
BIG DATA ANALYSISBIG DATA ANALYSIS
BIG DATA ANALYSIS
 
Udp vs-tcp
Udp vs-tcpUdp vs-tcp
Udp vs-tcp
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
 
Routers vs-switch
Routers vs-switchRouters vs-switch
Routers vs-switch
 
New udp
New udpNew udp
New udp
 
I pv4 format
I pv4 formatI pv4 format
I pv4 format
 
I pv4 addressing
I pv4 addressingI pv4 addressing
I pv4 addressing
 
Hub vs-switch
Hub vs-switchHub vs-switch
Hub vs-switch
 
Ftp
FtpFtp
Ftp
 
Email ftp
Email ftpEmail ftp
Email ftp
 
Www and http
Www and httpWww and http
Www and http
 
Transmission main
Transmission mainTransmission main
Transmission main
 
Ta 104-topology
Ta 104-topologyTa 104-topology
Ta 104-topology
 
Ta 104-topology (1)
Ta 104-topology (1)Ta 104-topology (1)
Ta 104-topology (1)
 
Ta 104-tcp
Ta 104-tcpTa 104-tcp
Ta 104-tcp
 
Ta 104-media-3
Ta 104-media-3Ta 104-media-3
Ta 104-media-3
 

Recently uploaded

Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Recently uploaded (20)

Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 

Ch 8

  • 1. AC ¬ AC + M[X ] X = Operand Address R1¬ R2 + R3 TOS ¬ M[X ] R ¬ M A + M B 1 [ ] [ ] ADD R1, A, B ADD R2, C, D MUL X, R1, R2 [ ] 1 2 R ¬ M C + M D 2 [ ] [ ] M X ¬ R * R Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 1 / 22  3 types of CPU organizations l 1) Single AC Org. : ADD X l 2) General Register Org. : ADD R1, R2, R3 l 3) Stack Org. : PUSH X  The influence of the number of addresses on computer instruction X = (A + B)*(C + D) - 4 arithmetic operations : ADD, SUB, MUL, DIV - 1 transfer operation to and from memory and general register : MOV - 2 transfer operation to and from memory and AC register : STORE, LOAD - Operand memory addresses : A, B, C, D - Result memory address : X l 1) Three-Address Instruction » Each address fields specify either a processor register or a memory operand » : Short program » Require too many bit to specify 3 address y 8-4. Instruction Formats
  • 2. 8-4. Instruction Formats R ¬ M A 1 [ ] MOV R1, A ADD R1, B MOV R2, C ADD R2, D MUL R1, R2 MOV X, R1 [ ] 1 R ¬ R + M B 1 1 [ ] R ¬ M C 2 [ ] R ¬ R + M D 2 2 [ ] R ¬ R * R 1 1 2 M X ¬ R AC ¬ M A [ ] LOAD A ADD B STORE T LOAD C ADD D MUL T STORE X M X AC AC ¬ AC + M B M [ T ] ¬ AC AC ¬ M C [ ] [ ] AC ¬ AC + M D [ ] AC ¬ AC * M T ¬ [ ] [ ] Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 2 / 22 l 2) Two-Address Instruction » The most common in commercial computers » Each address fields specify either a processor register or a memory operand l 3) One-Address Instruction » All operations are done between the AC register and memory operand
  • 3. 8-4. Instruction Formats TOS ¬ A PUSH A PUSH B TOS ¬ B ADD PUSH C PUSH D ADD MUL POP X M X TOS TOS ¬ A + B ( ) TOS ¬ C TOS ¬ D TOS ¬ C + D ( ) TOS ¬ C + D * A + B ( ) ( ) ¬ [ ] Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 3 / 22 l 4) Zero-Address Instruction » Stack-organized computer does not use an address field for the instructions ADD, and MUL » PUSH, and POP instructions need an address field to specify the operand » Zero-Address : absence of address ( ADD, MUL )
  • 4. 8-5. Addressing Modes Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 4 / 22  Addressing Mode l 1) To give programming versatility to the user » pointers to memory, counters for loop control, indexing of data, …. l 2) To reduce the number of bits in the addressing field of the instruction  Instruction Cycle l 1) Fetch the instruction from memory and PC + 1 l 2) Decode the instruction l 3) Execute the instruction
  • 5. 8-5. Addressing Modes Opcode Mode Address Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 5 / 22  Program Counter (PC) l PC keeps track of the instructions in the program stored in memory l PC holds the address of the instruction to be executed next l PC is incremented each time an instruction is fetched from memory  Addressing Mode of the Instruction 1) Distinct Binary Code 2) Single Binary Code  Implied Mode l Operands are specified implicitly in definition of the instruction l Examples » CMA : Complement Accumulator n Operand in AC is implied in the definition of the instruction » PUSH : Stack push n Operand is implied to be on top of the stack
  • 6. 8-5. Addressing Modes AC ¬ R1 Implied Mode AC ¬ M[R1] Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 6 / 22  Immediate Mode l Operand field contains the actual operand l Useful for initializing registers to a constant value l Example : LDA #NBR  Register Mode l Operands are in registers l Register is selected from a register field in the instruction » k-bit register field can specify any one of 2k registers l Example : LDA R1  Register Indirect Mode l Selected register contains the address of the operand rather than the operand itself l Address field of the instruction uses fewer bits to select a memory address l Example : LDA (R1)  Autoincrement or Autodecrement Mode l Similar to the register indirect mode except that » the register is incremented after its value is used to access memory » the register is decrement before its value is used to access memory
  • 7. 8-5. Addressing Modes AC ¬ M[R1], R1¬ R1+1 ADR = Address part of Instruction AC ¬ M[ADR] AC ¬ M[M[ADR]] AC ¬ M[PC + ADR] AC ¬ M[ADR + XR] Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 7 / 22 l Example (Autoincrement) : LD (R1)+  Direct Addressing Mode l Effective address is equal to the address field of the instruction (Operand) l Address field specifies the actual branch address in a branch-type instruction l Example : LD ADR  Indirect Addressing Mode l Address field of instruction gives the address where the effective address is stored in memory l Example : LD @ADR  Relative Addressing Mode l PC is added to the address part of the instruction to obtain the effective address l Example : LD $ADR  Indexed Addressing Mode l XR (Index register) is added to the address part of the instruction to obtain the effective address l Example : LD ADR(XR)  Base Register Addressing Mode l the content of a base register is added to the address part of the instruction to obtain the effective address AC ¬ M[BR + ADR]
  • 8. Numerical Example A d d r e s s M e m o r y 4 5 0 2 0 1 2 0 2 3 9 9 4 0 0 5 0 0 6 0 0 Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 8 / 22 L o a d t o A C M o d e A d d r e s s = 5 0 0 N e x t in s t r u c t i o n 7 0 0 8 0 0 9 0 0 3 2 5 3 0 0 P C = 2 0 0 R 1 = 4 0 0 X R = 1 0 0 A C 2 0 0 7 0 2 8 0 0
  • 9. 8-5. Addressing Modes Computer System Architecture Chap. 8 Central PPrroocceessssiinngg UUnniitt 9 / 22 Addressing Mode Effective Address Content of AC Immediate Address Mode 201 500 Direct Address Mode 500 800 Indirect Address Mode 800 300 Register Mode 400 Register Indirect Mode 400 700 Relative Address Mode 702 325 Indexed Address Mode 600 900 Autoincrement Mode 400 700 Autodecrement Mode 399 450 A d d r e s s M e m o r y L o a d t o A C M o d e A d d r e s s = 5 0 0 N e x t in s t r u c t io n 4 5 0 7 0 0 8 0 0 9 0 0 3 2 5 3 0 0 P C = 2 0 0 R 1 = 4 0 0 X R = 1 0 0 A C 2 0 0 2 0 1 2 0 2 3 9 9 4 0 0 5 0 0 6 0 0 7 0 2 8 0 0