SlideShare a Scribd company logo
5
Most read
6
Most read
10
Most read
Instruction Set
Architecture – II
CS2052 Computer Architecture
Computer Science & Engineering
University of Moratuwa
Dilum Bandara
Dilum.Bandara@uom.lk
Outline
 Types of memory
 Von Neumann vs. Harvard architecture
 Addressing modes
 RISC & CISC
2
Blocks of a Microprocessor
3
Literal
Address
Operation
Program
Memory
Instruction
Register
STACK Program Counter
Instruction
Decoder
Timing, Control and Register selection
Accumulator
RAM &
Data
Registers
ALU
IO
IO
FLAG &
Special
Function
Registers
Clock
Reset
Interrupts
Program Execution Section Register Processing Section
Set up
Set up
Modify
Address
Internal data bus
Source: Makis Malliris & Sabir Ghauri, UWE
Memory
 Instruction memory
 Store program instructions
 Data memory
 Store data for instructions
 Stack
 e.g., stack of plates
 For temporary storage of state
 Initially stored in ROM
 Or Flash
 Read/Write while in RAM
4
Memory Architectures
5
Source: Introduction to PIC Microcontroller – Part 1 by Khan Wahid
Von Neumann vs. Harvard
Architecture
6
Memory Addressing
 Place an
address on
address bus
 Read or write
operation
 Data placed on
data bus
7
Source: www.alf.sd83.bc.ca/courses/It12/using_it/processor_speed.htm
Memory Addressing (Cont.)
8
Address Data
Word
No of words
0
9
Memory Addressing (Cont.)
Memory Capacity = Word Size × No of Words
 Example
 PIC 16F877A can store up to 8K instructions
 Each instruction is 14-bit
 This is the size of Instruction Register
 What is the size of instruction memory in KB?
 8 × 1024 x 14 /(8 x 1024) = 14 KB
9
Example – Memory Addressing
 PIC 16F877A can store up to 8K
instructions
 What is the length of an instruction
address?
 No of bits required to uniquely address
each word
 log2 8 × 1024 = log2 213 = 13 bits
 This is the size of Program Counter
 How many bits are required to
address 348 instructions?
10
0
8K -1
Example – Instruction Memory
 How many bits we need to address 4Kbit
memory?
 It depends on smallest unit (word length) that we need
to address
 Suppose 8-bit addressable
 4Kb/8b = 512 locations
 Requires log2 512 = 9 bits
11
Addressing Modes
 Way the microprocessor
 Identifies location of data
 Access data
 Absolute address
 Actual physical address
 Direct addressing
 Relative address
 Address relative to a known reference
 Indirect addressing
12
 Segments
 Special areas in memory that is used to hold code, data, & stack
13
Programmers View of Memory
0
100
50
100 50
150
SS – Stack Segment
DS – Data Segment
CS – Code Segment
14
Segment + Offset Addressing
 Indicate address using segment boundary &
offset
 Example 1
 What is the actual memory location if DS register is
03E0h & offset is 32h?
DS 03E0
Offset 32 +
Address 412
15
Pointer Registers
 Are used to hold offset values
 Example 2
 What is the actual memory location if CS register is
39B0h & Instruction Pointer (IP) register is 514h?
CS 39B0
Offset 514 +
Address 3EC4
Addressing Modes
1. Immediate addressing
 Data/operand specified in instruction
 e.g., MOVLW k
2. Direct/Register addressing
 Register address is specified in instruction
 e.g., MOVF f, d
16
Addressing Modes (Cont.)
3. Indexed addressing
 Index Register store index
 Value in index register is
added to address specified
in instruction
 e.g., while accessing an
element in an array
 MOV R1, Table[2]
17
…..
1st
Element
2nd
Element
12th
Element
3rd
Element
215
Index Register
Addressing Modes (Cont.)
4. Base Register
addressing
 Same idea as Index
Register addressing
 Used with segments
 Enable relocation of
code
 e.g., MOV R1, [21]
18
21st
value
1st
value
2nd
value
…..
…..
215
Base Register
Addressing Modes (Cont.)
5. Register indirect addressing
 Address is stored in some other register
 Instruction specify which register to look at
 Address field of instruction can be smaller than actual
physical address
19
Source: http://cnx.org/content/m29425/latest/
Example – 8086 Addressing Modes
20
Source: www.electronics.dit.ie
Swapping Data
 Swap contents of W with register R5
 Use only PIC instructions
 No register-register operations
 Routine requires 2 temporary
locations W
tempA
tempB
R5
movwf tempA
movf R5, 0
movwf tempB
movf tempA, 0
movwf R5
movf tempB, 0
21
Stack
 For temporary storage of state
 Last in first out
 e.g., stack of plates
 Example
100 CALL Delay
101 .....
214 Delay: .....
.....
218 Return
22
Source: http://sir.unl.edu/portal/bios/Stack.php
Stack Example
105 a
{
…
112 b()
…
}
231 b
{
…
236 f()
…
}
175 f
{
…
179 g()
…
} 23
113
180
237
CISC vs. RISC
Complex Instruction Set
Computer
 Many instructions
 e.g., 75-100
 Many instructions are
macro-like
 Simplifies programming
 Most microcontrollers are
based on CISC concept
 e.g., PDP-11, VAX,
Motorola 68k
 PIC is an exception
Reduced Instruction Set
Computers
 Few instructions
 e.g., 30-40
 Smaller chip, smaller pin
count, & very low-power
consumption
 Simple but fast instructions
 Harvard architecture,
instruction pipelining
 Industry trend for
microprocessor design
 e.g., Intel Pentium, PIC 24

More Related Content

What's hot (20)

PDF
Operating Systems - memory management
Mukesh Chinta
 
PPT
mano.ppt
prathamgunj
 
PPT
Pipeline hazard
AJAL A J
 
PPT
Microarchitecture
meashi
 
PPTX
Physical design
Mantra VLSI
 
PPT
Chapter 1
Ashhad Kamal
 
PDF
Pci express technology 3.0
Biddika Manjusree
 
PDF
Compiler lec 8
Ramadan Babers, PhD
 
PPTX
Instruction pipelining
Tech_MX
 
PPT
Computer organization and architecture
POOJA MEHTA
 
PPS
Virtual memory
Anuj Modi
 
PPTX
STRUKTUR DAN FUNGSI CPU
Andhika Chandra Gulpa
 
PPTX
Operand and Opcode | Computer Science
Transweb Global Inc
 
PPTX
80286 microprocessors
Rajesh Reddy G
 
PDF
Computer Organization Lecture Notes
FellowBuddy.com
 
PDF
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
suddentrike2
 
PPT
Standard IO Interface
tamizh arthanari
 
PDF
Block Ciphers and the Data Encryption Standard
Dr.Florence Dayana
 
PPTX
Unit 3 sp assembler
Deepmala Sharma
 
PPTX
Computer architecture addressing modes and formats
Mazin Alwaaly
 
Operating Systems - memory management
Mukesh Chinta
 
mano.ppt
prathamgunj
 
Pipeline hazard
AJAL A J
 
Microarchitecture
meashi
 
Physical design
Mantra VLSI
 
Chapter 1
Ashhad Kamal
 
Pci express technology 3.0
Biddika Manjusree
 
Compiler lec 8
Ramadan Babers, PhD
 
Instruction pipelining
Tech_MX
 
Computer organization and architecture
POOJA MEHTA
 
Virtual memory
Anuj Modi
 
STRUKTUR DAN FUNGSI CPU
Andhika Chandra Gulpa
 
Operand and Opcode | Computer Science
Transweb Global Inc
 
80286 microprocessors
Rajesh Reddy G
 
Computer Organization Lecture Notes
FellowBuddy.com
 
Gate-Level Simulation Methodology Improving Gate-Level Simulation Performance
suddentrike2
 
Standard IO Interface
tamizh arthanari
 
Block Ciphers and the Data Encryption Standard
Dr.Florence Dayana
 
Unit 3 sp assembler
Deepmala Sharma
 
Computer architecture addressing modes and formats
Mazin Alwaaly
 

Viewers also liked (7)

PDF
CISC vs RISC Processor Architecture
Kaushik Patra
 
PDF
Plataformas cisc e risc
Tiago
 
PPT
Risc processors
Ganesh Rocky
 
PPT
Tibor
sharma_lokraj
 
PPTX
RISC Vs CISC, Harvard v/s Van Neumann
Ravikumar Tiwari
 
PPT
Flynns classification
Yasir Khan
 
CISC vs RISC Processor Architecture
Kaushik Patra
 
Plataformas cisc e risc
Tiago
 
Risc processors
Ganesh Rocky
 
RISC Vs CISC, Harvard v/s Van Neumann
Ravikumar Tiwari
 
Flynns classification
Yasir Khan
 
Ad

Similar to Instruction Set Architecture – II (20)

PPTX
Computer architecture instruction formats
Mazin Alwaaly
 
PPT
(246431835) instruction set principles (2) (1)
Alveena Saleem
 
PPT
other-architectures.ppt
Jaya Chavan
 
PPT
Ch2 csda
Jalal Faisal
 
PPT
Module 1-ppt System programming
vishnu sankar
 
PPT
Computer Organization and Architecture2.ppt
ಚಂದ್ರು ಗುಡದಾ
 
PDF
Module 2 instruction set
Deepak John
 
PPT
Compreport
xdarlord
 
PDF
Ec 252 ec-252-l10-instruction sets and addressing modes
bhshmuec
 
PPTX
Register & Memory
Education Front
 
PPTX
Instruction codes
pradeepa velmurugan
 
PDF
Cao 2012
Raja Basharat
 
PPTX
Instruction set (prasenjit dey)
Prasenjit Dey
 
DOCX
Bc0040
hayerpa
 
PPT
Al2ed chapter2
Abdullelah Al-Fahad
 
PPTX
Pai unit 1_l1-l2-l3-l4_upload
Yogesh Deshpande
 
PPTX
Chapter 4 addressing mode in microprocessor.pptx
Getnet Tigabie Askale -(GM)
 
PPTX
Instruction Set (Part 2)
Ajeng Savitri
 
PDF
Please send the answers to my email. [email protected] se.pdf
ebrahimbadushata00
 
PPTX
Instruction set.pptx
ssuser000e54
 
Computer architecture instruction formats
Mazin Alwaaly
 
(246431835) instruction set principles (2) (1)
Alveena Saleem
 
other-architectures.ppt
Jaya Chavan
 
Ch2 csda
Jalal Faisal
 
Module 1-ppt System programming
vishnu sankar
 
Computer Organization and Architecture2.ppt
ಚಂದ್ರು ಗುಡದಾ
 
Module 2 instruction set
Deepak John
 
Compreport
xdarlord
 
Ec 252 ec-252-l10-instruction sets and addressing modes
bhshmuec
 
Register & Memory
Education Front
 
Instruction codes
pradeepa velmurugan
 
Cao 2012
Raja Basharat
 
Instruction set (prasenjit dey)
Prasenjit Dey
 
Bc0040
hayerpa
 
Al2ed chapter2
Abdullelah Al-Fahad
 
Pai unit 1_l1-l2-l3-l4_upload
Yogesh Deshpande
 
Chapter 4 addressing mode in microprocessor.pptx
Getnet Tigabie Askale -(GM)
 
Instruction Set (Part 2)
Ajeng Savitri
 
Please send the answers to my email. [email protected] se.pdf
ebrahimbadushata00
 
Instruction set.pptx
ssuser000e54
 
Ad

More from Dilum Bandara (20)

PPTX
Designing for Multiple Blockchains in Industry Ecosystems
Dilum Bandara
 
PPTX
Introduction to Machine Learning
Dilum Bandara
 
PPTX
Time Series Analysis and Forecasting in Practice
Dilum Bandara
 
PPTX
Introduction to Dimension Reduction with PCA
Dilum Bandara
 
PPTX
Introduction to Descriptive & Predictive Analytics
Dilum Bandara
 
PPTX
Introduction to Concurrent Data Structures
Dilum Bandara
 
PPTX
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Dilum Bandara
 
PPTX
Introduction to Map-Reduce Programming with Hadoop
Dilum Bandara
 
PPTX
Embarrassingly/Delightfully Parallel Problems
Dilum Bandara
 
PPTX
Introduction to Warehouse-Scale Computers
Dilum Bandara
 
PPTX
Introduction to Thread Level Parallelism
Dilum Bandara
 
PPTX
CPU Memory Hierarchy and Caching Techniques
Dilum Bandara
 
PPTX
Data-Level Parallelism in Microprocessors
Dilum Bandara
 
PDF
Instruction Level Parallelism – Hardware Techniques
Dilum Bandara
 
PPTX
Instruction Level Parallelism – Compiler Techniques
Dilum Bandara
 
PPTX
CPU Pipelining and Hazards - An Introduction
Dilum Bandara
 
PPTX
Advanced Computer Architecture – An Introduction
Dilum Bandara
 
PPTX
High Performance Networking with Advanced TCP
Dilum Bandara
 
PPTX
Introduction to Content Delivery Networks
Dilum Bandara
 
PPTX
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 
Designing for Multiple Blockchains in Industry Ecosystems
Dilum Bandara
 
Introduction to Machine Learning
Dilum Bandara
 
Time Series Analysis and Forecasting in Practice
Dilum Bandara
 
Introduction to Dimension Reduction with PCA
Dilum Bandara
 
Introduction to Descriptive & Predictive Analytics
Dilum Bandara
 
Introduction to Concurrent Data Structures
Dilum Bandara
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Dilum Bandara
 
Introduction to Map-Reduce Programming with Hadoop
Dilum Bandara
 
Embarrassingly/Delightfully Parallel Problems
Dilum Bandara
 
Introduction to Warehouse-Scale Computers
Dilum Bandara
 
Introduction to Thread Level Parallelism
Dilum Bandara
 
CPU Memory Hierarchy and Caching Techniques
Dilum Bandara
 
Data-Level Parallelism in Microprocessors
Dilum Bandara
 
Instruction Level Parallelism – Hardware Techniques
Dilum Bandara
 
Instruction Level Parallelism – Compiler Techniques
Dilum Bandara
 
CPU Pipelining and Hazards - An Introduction
Dilum Bandara
 
Advanced Computer Architecture – An Introduction
Dilum Bandara
 
High Performance Networking with Advanced TCP
Dilum Bandara
 
Introduction to Content Delivery Networks
Dilum Bandara
 
Peer-to-Peer Networking Systems and Streaming
Dilum Bandara
 

Recently uploaded (20)

PPTX
site survey architecture student B.arch.
sri02032006
 
PPTX
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
DOCX
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
PPTX
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
PDF
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
PDF
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
PDF
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
PPT
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
PPTX
Introduction to Design of Machine Elements
PradeepKumarS27
 
PDF
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
PDF
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
PPTX
Green Building & Energy Conservation ppt
Sagar Sarangi
 
PPTX
Thermal runway and thermal stability.pptx
godow93766
 
PPTX
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
PDF
monopile foundation seminar topic for civil engineering students
Ahina5
 
PDF
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
PPTX
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
PPTX
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 
site survey architecture student B.arch.
sri02032006
 
Break Statement in Programming with 6 Real Examples
manojpoojary2004
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
CS-802 (A) BDH Lab manual IPS Academy Indore
thegodhimself05
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
Types of Bearing_Specifications_PPT.pptx
PranjulAgrahariAkash
 
6th International Conference on Machine Learning Techniques and Data Science ...
ijistjournal
 
Ethics and Trustworthy AI in Healthcare – Governing Sensitive Data, Profiling...
AlqualsaDIResearchGr
 
Book.pdf01_Intro.ppt algorithm for preperation stu used
archu26
 
Oxygen Co2 Transport in the Lungs(Exchange og gases)
SUNDERLINSHIBUD
 
Introduction to Design of Machine Elements
PradeepKumarS27
 
IoT - Unit 2 (Internet of Things-Concepts) - PPT.pdf
dipakraut82
 
ARC--BUILDING-UTILITIES-2-PART-2 (1).pdf
IzzyBaniquedBusto
 
Green Building & Energy Conservation ppt
Sagar Sarangi
 
Thermal runway and thermal stability.pptx
godow93766
 
Destructive Tests corrosion engineer (1).pptx
zeidali3
 
monopile foundation seminar topic for civil engineering students
Ahina5
 
UNIT-4-FEEDBACK AMPLIFIERS AND OSCILLATORS (1).pdf
Sridhar191373
 
MPMC_Module-2 xxxxxxxxxxxxxxxxxxxxx.pptx
ShivanshVaidya5
 
Pharmaceuticals and fine chemicals.pptxx
jaypa242004
 

Instruction Set Architecture – II

  • 1. Instruction Set Architecture – II CS2052 Computer Architecture Computer Science & Engineering University of Moratuwa Dilum Bandara [email protected]
  • 2. Outline  Types of memory  Von Neumann vs. Harvard architecture  Addressing modes  RISC & CISC 2
  • 3. Blocks of a Microprocessor 3 Literal Address Operation Program Memory Instruction Register STACK Program Counter Instruction Decoder Timing, Control and Register selection Accumulator RAM & Data Registers ALU IO IO FLAG & Special Function Registers Clock Reset Interrupts Program Execution Section Register Processing Section Set up Set up Modify Address Internal data bus Source: Makis Malliris & Sabir Ghauri, UWE
  • 4. Memory  Instruction memory  Store program instructions  Data memory  Store data for instructions  Stack  e.g., stack of plates  For temporary storage of state  Initially stored in ROM  Or Flash  Read/Write while in RAM 4
  • 5. Memory Architectures 5 Source: Introduction to PIC Microcontroller – Part 1 by Khan Wahid
  • 6. Von Neumann vs. Harvard Architecture 6
  • 7. Memory Addressing  Place an address on address bus  Read or write operation  Data placed on data bus 7 Source: www.alf.sd83.bc.ca/courses/It12/using_it/processor_speed.htm
  • 8. Memory Addressing (Cont.) 8 Address Data Word No of words 0 9
  • 9. Memory Addressing (Cont.) Memory Capacity = Word Size × No of Words  Example  PIC 16F877A can store up to 8K instructions  Each instruction is 14-bit  This is the size of Instruction Register  What is the size of instruction memory in KB?  8 × 1024 x 14 /(8 x 1024) = 14 KB 9
  • 10. Example – Memory Addressing  PIC 16F877A can store up to 8K instructions  What is the length of an instruction address?  No of bits required to uniquely address each word  log2 8 × 1024 = log2 213 = 13 bits  This is the size of Program Counter  How many bits are required to address 348 instructions? 10 0 8K -1
  • 11. Example – Instruction Memory  How many bits we need to address 4Kbit memory?  It depends on smallest unit (word length) that we need to address  Suppose 8-bit addressable  4Kb/8b = 512 locations  Requires log2 512 = 9 bits 11
  • 12. Addressing Modes  Way the microprocessor  Identifies location of data  Access data  Absolute address  Actual physical address  Direct addressing  Relative address  Address relative to a known reference  Indirect addressing 12
  • 13.  Segments  Special areas in memory that is used to hold code, data, & stack 13 Programmers View of Memory 0 100 50 100 50 150 SS – Stack Segment DS – Data Segment CS – Code Segment
  • 14. 14 Segment + Offset Addressing  Indicate address using segment boundary & offset  Example 1  What is the actual memory location if DS register is 03E0h & offset is 32h? DS 03E0 Offset 32 + Address 412
  • 15. 15 Pointer Registers  Are used to hold offset values  Example 2  What is the actual memory location if CS register is 39B0h & Instruction Pointer (IP) register is 514h? CS 39B0 Offset 514 + Address 3EC4
  • 16. Addressing Modes 1. Immediate addressing  Data/operand specified in instruction  e.g., MOVLW k 2. Direct/Register addressing  Register address is specified in instruction  e.g., MOVF f, d 16
  • 17. Addressing Modes (Cont.) 3. Indexed addressing  Index Register store index  Value in index register is added to address specified in instruction  e.g., while accessing an element in an array  MOV R1, Table[2] 17 ….. 1st Element 2nd Element 12th Element 3rd Element 215 Index Register
  • 18. Addressing Modes (Cont.) 4. Base Register addressing  Same idea as Index Register addressing  Used with segments  Enable relocation of code  e.g., MOV R1, [21] 18 21st value 1st value 2nd value ….. ….. 215 Base Register
  • 19. Addressing Modes (Cont.) 5. Register indirect addressing  Address is stored in some other register  Instruction specify which register to look at  Address field of instruction can be smaller than actual physical address 19 Source: http://cnx.org/content/m29425/latest/
  • 20. Example – 8086 Addressing Modes 20 Source: www.electronics.dit.ie
  • 21. Swapping Data  Swap contents of W with register R5  Use only PIC instructions  No register-register operations  Routine requires 2 temporary locations W tempA tempB R5 movwf tempA movf R5, 0 movwf tempB movf tempA, 0 movwf R5 movf tempB, 0 21
  • 22. Stack  For temporary storage of state  Last in first out  e.g., stack of plates  Example 100 CALL Delay 101 ..... 214 Delay: ..... ..... 218 Return 22 Source: http://sir.unl.edu/portal/bios/Stack.php
  • 23. Stack Example 105 a { … 112 b() … } 231 b { … 236 f() … } 175 f { … 179 g() … } 23 113 180 237
  • 24. CISC vs. RISC Complex Instruction Set Computer  Many instructions  e.g., 75-100  Many instructions are macro-like  Simplifies programming  Most microcontrollers are based on CISC concept  e.g., PDP-11, VAX, Motorola 68k  PIC is an exception Reduced Instruction Set Computers  Few instructions  e.g., 30-40  Smaller chip, smaller pin count, & very low-power consumption  Simple but fast instructions  Harvard architecture, instruction pipelining  Industry trend for microprocessor design  e.g., Intel Pentium, PIC 24