SlideShare a Scribd company logo
General Aspects of Computer Organization
(Lecture-3)
R S Ananda Murthy
Associate Professor
Department of Electrical & Electronics Engineering,
Sri Jayachamarajendra College of Engineering,
Mysore 570 006
R S Ananda Murthy General Aspects of Computer Organization
Specific Learning Outcomes
After completing this lecture the student should be able to –
Describe Von Neumann (Princeton) architecture.
Describe Harvard architecture.
Describe the function of MAR and MDR in the CPU.
Explain steps involved in executing an instruction.
Describe features of CISC and RISC computers.
R S Ananda Murthy General Aspects of Computer Organization
Von Neumann (Princeton) Architecture
CPU
Program
Memory
Data
Memory
Address Bus
Control Bus
Data Bus
Program and data memory share the same address space,
address and data buses.
Speed is limited because simultaneous access of program
and data memory by CPU is impossible.
Preferred in general purpose microprocessors where CPU
and memory are separate chips.
R S Ananda Murthy General Aspects of Computer Organization
Harvard Architecture
CPU
Data
Memory
Address Bus
Control Bus
Data Bus
Program
Memory
Address Bus
Data Bus
Control Bus
Program and data memory have different address space,
address and data buses.
Execution speed is increased because simultaneous
access of program and data memory by CPU is possible.
Preferred in microcontrollers where program memory, data
memory and CPU are in a single chip.
R S Ananda Murthy General Aspects of Computer Organization
MAR and MDR in CPU
MAR
PC
MDR
R0
R1
R2
:
Rn
IR
CU
ALU
Program
Memory
Data
Memory
Address Bus
Control Bus
Data Bus
Memory Address Register (MAR) stores the address of the
operand to be fetched from memory to execute the
instruction.
Memory Data Register (MDR) stores the operand (data)
after it is fetched from memory.
R S Ananda Murthy General Aspects of Computer Organization
Steps Followed by CPU in Instruction Execution
1 Fetch the instruction from the program memory location
pointed by PC into IR.
2 Determine the type of instruction present in the IR. This is
done by CU.
3 If the instruction uses an operand in memory, determine its
address and place it in MAR.
4 Fetch the operand and put it in MDR, and if needed, copy it
into a CPU register.
5 Execute the instruction. This is done by the CU.
6 Change the PC to point to the next instruction.
7 Go to Step 1 to begin executing the next instruction.
R S Ananda Murthy General Aspects of Computer Organization
An Imaginary Computer
MAR
PC
MDR
R0
R1
R2
:
R7
IR
CU
ALU
Address Bus
Control Bus
Data Bus
CPU
0x0000
0x0001
0x0002
0xFFFF
MEMORY Address in Hex
16 bits
16 bits
8 bits
8 bits
8 bits
8 bits
8 bits
8 bits
16 bits
8 bits
:
Blocks in side CPU are interconnected by internal address,
data, and control buses.
There are eight internal registers R0 to R7, each of 8 bits
width.
When we want to add two numbers, one number must be
present in R0 and the other one should be present in any
other register. The sum is placed in R0.
Instructions can be 1-byte, 2-bytes, or 3-bytes long.
R S Ananda Murthy General Aspects of Computer Organization
Instructions Recognized by Imaginary Computer
LDR Rn, MemAdr -- A three-byte instruction
1010 0 NNN
MemAdr Low Byte
MemAdr High Byte
n NNN
0 000
1 001
2 010
3-bit Code for
Registers
3 011
4 100
5 101
6 110
7 111
Opcode
Copies the data present at MemAdr
to the register Rn
ADD R0,Rn -- A one-byte instruction
11000 NNN
Adds contents of R0 and Rn and places
the sum in the register R0
Opcode
Operands
R S Ananda Murthy General Aspects of Computer Organization
Instructions Recognized by Imaginary Computer
MVI Rn, NextByte -- A two-byte instruction
1010 1 NNN
Data Byte
n NNN
0 000
1 001
2 010
3-bit Code for
Registers
3 011
4 100
5 101
6 110
7 111
Opcode
Copies the next data byte to the register Rn.
HALT -- A one-byte instruction
00000000
Stops incrementing of program counter.
Opcode
Operand
R S Ananda Murthy General Aspects of Computer Organization
Adding Two Numbers using Imaginary Computer
Memory
C1
00
:
A0
30
10
A1
31
10
LDR R0,0x1030
LDR R1,0x1031
ADD R0,R1
HALT
Hex Address
CD
EF
0x0000
0x0001
0x0002
0x0003
0x0004
0x0005
0x0006
0x0007
0x1030
:
0x1031
Augend
Addend
Data
How is opcode A0 obtained?
How is opcode A1 obtained?
How is opcode C1 obtained?
How many bytes in program?
Trace through the program
using steps given earlier.
After storing the program and data in the memory as
shown above we have to initialize PC with the starting
address 0x0000 and then give a command to the computer
to start execution of the program.
R S Ananda Murthy General Aspects of Computer Organization
Adding Two Numbers Another Way
Memory
A8
CD
A9
EF
C1
00
MVI R0,0xCD
ADD R0,R1
HALT
Hex Address
0x0000
0x0001
0x0002
0x0003
0x0004
0x0005
How is opcode A8 obtained?
How is opcode C1 obtained?
How many bytes in program?
MVI R1,0xEF How is opcode A9 obtained?
After storing the program and data in the memory as
shown above we have to initialize PC with the starting
address 0x0000 and then give a command to the computer
to start execution of the program.
Trace through the program using the steps given earlier.
R S Ananda Murthy General Aspects of Computer Organization
CISC and RISC
On the basis of type of instructions and how they are
executed, computers are roughly classified into two types –
Complex Instruction Set Computers (CISC) and Reduced
Instruction Set Computers (RISC).
CISC and RISC both have their merits and demerits.
Present trend is to incorporate the best features of both
CISC and RISC in processor design to get optimum
performance at optimum cost.
R S Ananda Murthy General Aspects of Computer Organization
Features of CISC
Traditionally most of the processors made in 1970s and
1980s were CISC adopting Princeton architecture.
Variable instruction length. For eg., there may be 1-byte,
2-byte, or 3-byte instructions as in case of Intel 8051 MCU.
As compared to RISC, CISC processors generally have
lesser number of internal registers in the CPU.
Variable instruction cycle time. Instruction cycle is the time
taken to execute an instruction. More complex instructions
take longer time to execute.
Large number of instructions in the instruction set.
Typically there can be more than 200 instructions in the
instruction set.
R S Ananda Murthy General Aspects of Computer Organization
Features of CISC
Generally, in CISC a portion of R/WM is used as stack to
store data while branching to subroutines.
Generally, in CISC instructions are available to operate on
data present in the memory directly without bringing it into
a register in side the CPU.
For a given task, a program in CISC results in smaller code
size.
Typically in CISC instructions are decoded by a
microprogram which is stored in CU. Microprogram
implementation requires more number of transistors to be
integrated on the chip.
Decoding of instructions using microprogram in CISC
slows down execution.
R S Ananda Murthy General Aspects of Computer Organization
Features of RISC
Traditionally RISC implementation is becoming popular
since 1990s.
Fixed instruction size. For eg. in AVR MCU which is a
RISC processor, almost all instructions are 2-bytes in
length with only a few 4-byte instructions.
Large number of internal registers in the CPU. For eg. AVR
MCU has 32 internal registers.
Because of large number of internal registers, usage of
stack to store data may not be essential as in CISC.
Smaller and simpler instruction set. Typically instruction
set may have less than 200 instructions.
For a given task, assembly language programming of RISC
machines generally requires more effort as compared to
CISC processors.
R S Ananda Murthy General Aspects of Computer Organization
Features of RISC
Due to the reason mentioned above, it is more convenient
to program RISC processors using higher level languages
like C or C++.
Fixed instruction cycle time for most of the instructions.
Many modern RISC processors adopt Harvard architecture
to speed up program execution.
Generally, in RISC it is not possible to perform arithmetic
and logical operations on data present in the memory
directly without bringing it into a register in side the CPU.
In RISC, instruction decoding in CU is done using
hardware and not by using a microprogram to speed up
instruction execution.
R S Ananda Murthy General Aspects of Computer Organization
License
This work is licensed under a
Creative Commons Attribution 4.0 International License.
R S Ananda Murthy General Aspects of Computer Organization

More Related Content

What's hot

Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptx
Akshat Bijronia
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
Linaro
 
FPGA Verilog Processor Design
FPGA Verilog Processor DesignFPGA Verilog Processor Design
FPGA Verilog Processor Design
Archana Udaranga
 
Embedded C
Embedded CEmbedded C
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
Dinesh Damodar
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
Kartik Sharma
 
Cache coherence ppt
Cache coherence pptCache coherence ppt
Cache coherence ppt
ArendraSingh2
 
Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]
Alwin Arrasyid
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
GlobalLogic Ukraine
 
Architectural support for High Level Language
Architectural support for High Level LanguageArchitectural support for High Level Language
Architectural support for High Level Language
Sudhanshu Janwadkar
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
Dheryta Jaisinghani
 
computer organization and architecture notes
computer organization and architecture notescomputer organization and architecture notes
computer organization and architecture notes
Upasana Talukdar
 
Loaders
LoadersLoaders
Computer Organization - Programming the basic computer : Machine Language, As...
Computer Organization - Programming the basic computer : Machine Language, As...Computer Organization - Programming the basic computer : Machine Language, As...
Computer Organization - Programming the basic computer : Machine Language, As...
Maitri Thakkar
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
Linaro
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
Emertxe Information Technologies Pvt Ltd
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processing
vishal choudhary
 
ARM Processor architecture
ARM Processor  architectureARM Processor  architecture
ARM Processor architecture
rajkciitr
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copymkazree
 

What's hot (20)

Introduction to Arduino.pptx
Introduction to Arduino.pptxIntroduction to Arduino.pptx
Introduction to Arduino.pptx
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
FPGA Verilog Processor Design
FPGA Verilog Processor DesignFPGA Verilog Processor Design
FPGA Verilog Processor Design
 
Embedded C
Embedded CEmbedded C
Embedded C
 
What is Bootloader???
What is Bootloader???What is Bootloader???
What is Bootloader???
 
Unit 2 assembly language programming
Unit 2   assembly language programmingUnit 2   assembly language programming
Unit 2 assembly language programming
 
Cache coherence ppt
Cache coherence pptCache coherence ppt
Cache coherence ppt
 
Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]Introduction to ESP32 Programming [Road to RIoT 2017]
Introduction to ESP32 Programming [Road to RIoT 2017]
 
Linux Audio Drivers. ALSA
Linux Audio Drivers. ALSALinux Audio Drivers. ALSA
Linux Audio Drivers. ALSA
 
06. thumb instructions
06. thumb instructions06. thumb instructions
06. thumb instructions
 
Architectural support for High Level Language
Architectural support for High Level LanguageArchitectural support for High Level Language
Architectural support for High Level Language
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
computer organization and architecture notes
computer organization and architecture notescomputer organization and architecture notes
computer organization and architecture notes
 
Loaders
LoadersLoaders
Loaders
 
Computer Organization - Programming the basic computer : Machine Language, As...
Computer Organization - Programming the basic computer : Machine Language, As...Computer Organization - Programming the basic computer : Machine Language, As...
Computer Organization - Programming the basic computer : Machine Language, As...
 
LCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted FirmwareLCU14 500 ARM Trusted Firmware
LCU14 500 ARM Trusted Firmware
 
Introduction to Embedded System
Introduction to Embedded SystemIntroduction to Embedded System
Introduction to Embedded System
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processing
 
ARM Processor architecture
ARM Processor  architectureARM Processor  architecture
ARM Processor architecture
 
Chp4 introduction to the pic microcontroller copy
Chp4 introduction to the pic microcontroller   copyChp4 introduction to the pic microcontroller   copy
Chp4 introduction to the pic microcontroller copy
 

Similar to L3 instruction-execution-steps

UNIT 2_ESD.pdf
UNIT 2_ESD.pdfUNIT 2_ESD.pdf
UNIT 2_ESD.pdf
SaralaT3
 
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdfCS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
Asst.prof M.Gokilavani
 
Hg3612911294
Hg3612911294Hg3612911294
Hg3612911294
IJERA Editor
 
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR IN CADENCE 45nmTECHNOLOGY
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR  IN CADENCE 45nmTECHNOLOGYDESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR  IN CADENCE 45nmTECHNOLOGY
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR IN CADENCE 45nmTECHNOLOGY
shaikalthaf40
 
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORSA REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
IRJET Journal
 
Introduction to computer architecture .pptx
Introduction to computer architecture .pptxIntroduction to computer architecture .pptx
Introduction to computer architecture .pptx
Fatma Sayed Ibrahim
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
Susam Pal
 
Advanced Processor Power Point Presentation
Advanced Processor  Power Point  PresentationAdvanced Processor  Power Point  Presentation
Advanced Processor Power Point Presentation
PrashantYadav931011
 
Necessity of 32-Bit Controllers
Necessity of 32-Bit ControllersNecessity of 32-Bit Controllers
Necessity of 32-Bit Controllers
mohanav
 
Computer Organization.pptx
Computer Organization.pptxComputer Organization.pptx
Computer Organization.pptx
saimagul310
 
Module-2 Instruction Set Cpus.pdf
Module-2 Instruction Set Cpus.pdfModule-2 Instruction Set Cpus.pdf
Module-2 Instruction Set Cpus.pdf
Sitamarhi Institute of Technology
 
Realization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processorRealization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processor
eSAT Publishing House
 
CPU.ppd
CPU.ppdCPU.ppd
Question 1. please describe an embedded system in less than 100 word.pdf
Question 1. please describe an embedded system in less than 100 word.pdfQuestion 1. please describe an embedded system in less than 100 word.pdf
Question 1. please describe an embedded system in less than 100 word.pdf
armcomputers
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips Processor
IOSR Journals
 
L1 intro-to-mpu-mcu
L1 intro-to-mpu-mcuL1 intro-to-mpu-mcu
L1 intro-to-mpu-mcu
rsamurti
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
Suvendu Kumar Dash
 
Risc processors
Risc processorsRisc processors
Risc processors
Ganesh Rocky
 
M&i(lec#01)
M&i(lec#01)M&i(lec#01)
M&i(lec#01)
Majid Mehmood
 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1
Hossam Hassan
 

Similar to L3 instruction-execution-steps (20)

UNIT 2_ESD.pdf
UNIT 2_ESD.pdfUNIT 2_ESD.pdf
UNIT 2_ESD.pdf
 
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdfCS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
CS304PC:Computer Organization and Architecture UNIT V_merged_merged.pdf
 
Hg3612911294
Hg3612911294Hg3612911294
Hg3612911294
 
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR IN CADENCE 45nmTECHNOLOGY
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR  IN CADENCE 45nmTECHNOLOGYDESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR  IN CADENCE 45nmTECHNOLOGY
DESIGN OF A 16-BIT HARVARD STRUCTURED RISC PROCESSOR IN CADENCE 45nmTECHNOLOGY
 
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORSA REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
A REVIEW ON ANALYSIS OF 32-BIT AND 64-BIT RISC PROCESSORS
 
Introduction to computer architecture .pptx
Introduction to computer architecture .pptxIntroduction to computer architecture .pptx
Introduction to computer architecture .pptx
 
16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)16-bit Microprocessor Design (2005)
16-bit Microprocessor Design (2005)
 
Advanced Processor Power Point Presentation
Advanced Processor  Power Point  PresentationAdvanced Processor  Power Point  Presentation
Advanced Processor Power Point Presentation
 
Necessity of 32-Bit Controllers
Necessity of 32-Bit ControllersNecessity of 32-Bit Controllers
Necessity of 32-Bit Controllers
 
Computer Organization.pptx
Computer Organization.pptxComputer Organization.pptx
Computer Organization.pptx
 
Module-2 Instruction Set Cpus.pdf
Module-2 Instruction Set Cpus.pdfModule-2 Instruction Set Cpus.pdf
Module-2 Instruction Set Cpus.pdf
 
Realization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processorRealization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processor
 
CPU.ppd
CPU.ppdCPU.ppd
CPU.ppd
 
Question 1. please describe an embedded system in less than 100 word.pdf
Question 1. please describe an embedded system in less than 100 word.pdfQuestion 1. please describe an embedded system in less than 100 word.pdf
Question 1. please describe an embedded system in less than 100 word.pdf
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips Processor
 
L1 intro-to-mpu-mcu
L1 intro-to-mpu-mcuL1 intro-to-mpu-mcu
L1 intro-to-mpu-mcu
 
CISC & RISC Architecture
CISC & RISC Architecture CISC & RISC Architecture
CISC & RISC Architecture
 
Risc processors
Risc processorsRisc processors
Risc processors
 
M&i(lec#01)
M&i(lec#01)M&i(lec#01)
M&i(lec#01)
 
An introduction to digital signal processors 1
An introduction to digital signal processors 1An introduction to digital signal processors 1
An introduction to digital signal processors 1
 

More from rsamurti

EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)
rsamurti
 
Trends in-power-electronics
Trends in-power-electronicsTrends in-power-electronics
Trends in-power-electronics
rsamurti
 
Introduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeXIntroduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeX
rsamurti
 
Synchronous generators
Synchronous generatorsSynchronous generators
Synchronous generators
rsamurti
 
Transformers
TransformersTransformers
Transformers
rsamurti
 
Three phase-circuits
Three phase-circuitsThree phase-circuits
Three phase-circuits
rsamurti
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
rsamurti
 
L14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 pL14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 p
rsamurti
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 p
rsamurti
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
rsamurti
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
rsamurti
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
rsamurti
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
rsamurti
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
rsamurti
 
L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1
rsamurti
 
L7 starting-to-use-mcu
L7 starting-to-use-mcuL7 starting-to-use-mcu
L7 starting-to-use-mcu
rsamurti
 
L6 primary-memory
L6 primary-memoryL6 primary-memory
L6 primary-memory
rsamurti
 
L5 data-parallel-computers
L5 data-parallel-computersL5 data-parallel-computers
L5 data-parallel-computers
rsamurti
 
L4 speeding-up-execution
L4 speeding-up-executionL4 speeding-up-execution
L4 speeding-up-execution
rsamurti
 
L2 types-of-computers
L2 types-of-computersL2 types-of-computers
L2 types-of-computers
rsamurti
 

More from rsamurti (20)

EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)EE110-elementary-circuit-and-network-theory-(a)
EE110-elementary-circuit-and-network-theory-(a)
 
Trends in-power-electronics
Trends in-power-electronicsTrends in-power-electronics
Trends in-power-electronics
 
Introduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeXIntroduction to-Tex-and-LaTeX
Introduction to-Tex-and-LaTeX
 
Synchronous generators
Synchronous generatorsSynchronous generators
Synchronous generators
 
Transformers
TransformersTransformers
Transformers
 
Three phase-circuits
Three phase-circuitsThree phase-circuits
Three phase-circuits
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
L14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 pL14 kb-lcd-interfacing-with-atmega328 p
L14 kb-lcd-interfacing-with-atmega328 p
 
L13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 pL13 interrupts-in-atmega328 p
L13 interrupts-in-atmega328 p
 
L12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 pL12 c-language-programming-of-atmega328 p
L12 c-language-programming-of-atmega328 p
 
L16 usart-atmega328 p
L16 usart-atmega328 pL16 usart-atmega328 p
L16 usart-atmega328 p
 
L11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 pL11 assembly-language-programming-of-atmega328 p
L11 assembly-language-programming-of-atmega328 p
 
L10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 pL10 assembly-language-programming-of-atmega328 p
L10 assembly-language-programming-of-atmega328 p
 
L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2L9 understanding-atmega328 p-2
L9 understanding-atmega328 p-2
 
L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1L8 understanding-atmega328 p-1
L8 understanding-atmega328 p-1
 
L7 starting-to-use-mcu
L7 starting-to-use-mcuL7 starting-to-use-mcu
L7 starting-to-use-mcu
 
L6 primary-memory
L6 primary-memoryL6 primary-memory
L6 primary-memory
 
L5 data-parallel-computers
L5 data-parallel-computersL5 data-parallel-computers
L5 data-parallel-computers
 
L4 speeding-up-execution
L4 speeding-up-executionL4 speeding-up-execution
L4 speeding-up-execution
 
L2 types-of-computers
L2 types-of-computersL2 types-of-computers
L2 types-of-computers
 

Recently uploaded

Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
Rahul
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
NidhalKahouli2
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
drwaing
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
JoytuBarua2
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
Mukeshwaran Balu
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
ssuser36d3051
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
aqil azizi
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
nooriasukmaningtyas
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
dxobcob
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
bakpo1
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
zwunae
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
ClaraZara1
 

Recently uploaded (20)

Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024ACEP Magazine edition 4th launched on 05.06.2024
ACEP Magazine edition 4th launched on 05.06.2024
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
basic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdfbasic-wireline-operations-course-mahmoud-f-radwan.pdf
basic-wireline-operations-course-mahmoud-f-radwan.pdf
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
digital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdfdigital fundamental by Thomas L.floydl.pdf
digital fundamental by Thomas L.floydl.pdf
 
Planning Of Procurement o different goods and services
Planning Of Procurement o different goods and servicesPlanning Of Procurement o different goods and services
Planning Of Procurement o different goods and services
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
ACRP 4-09 Risk Assessment Method to Support Modification of Airfield Separat...
 
sieving analysis and results interpretation
sieving analysis and results interpretationsieving analysis and results interpretation
sieving analysis and results interpretation
 
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdfTutorial for 16S rRNA Gene Analysis with QIIME2.pdf
Tutorial for 16S rRNA Gene Analysis with QIIME2.pdf
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...A review on techniques and modelling methodologies used for checking electrom...
A review on techniques and modelling methodologies used for checking electrom...
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
一比一原版(Otago毕业证)奥塔哥大学毕业证成绩单如何办理
 
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
一比一原版(SFU毕业证)西蒙菲莎大学毕业证成绩单如何办理
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单专业办理
 
6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)6th International Conference on Machine Learning & Applications (CMLA 2024)
6th International Conference on Machine Learning & Applications (CMLA 2024)
 

L3 instruction-execution-steps

  • 1. General Aspects of Computer Organization (Lecture-3) R S Ananda Murthy Associate Professor Department of Electrical & Electronics Engineering, Sri Jayachamarajendra College of Engineering, Mysore 570 006 R S Ananda Murthy General Aspects of Computer Organization
  • 2. Specific Learning Outcomes After completing this lecture the student should be able to – Describe Von Neumann (Princeton) architecture. Describe Harvard architecture. Describe the function of MAR and MDR in the CPU. Explain steps involved in executing an instruction. Describe features of CISC and RISC computers. R S Ananda Murthy General Aspects of Computer Organization
  • 3. Von Neumann (Princeton) Architecture CPU Program Memory Data Memory Address Bus Control Bus Data Bus Program and data memory share the same address space, address and data buses. Speed is limited because simultaneous access of program and data memory by CPU is impossible. Preferred in general purpose microprocessors where CPU and memory are separate chips. R S Ananda Murthy General Aspects of Computer Organization
  • 4. Harvard Architecture CPU Data Memory Address Bus Control Bus Data Bus Program Memory Address Bus Data Bus Control Bus Program and data memory have different address space, address and data buses. Execution speed is increased because simultaneous access of program and data memory by CPU is possible. Preferred in microcontrollers where program memory, data memory and CPU are in a single chip. R S Ananda Murthy General Aspects of Computer Organization
  • 5. MAR and MDR in CPU MAR PC MDR R0 R1 R2 : Rn IR CU ALU Program Memory Data Memory Address Bus Control Bus Data Bus Memory Address Register (MAR) stores the address of the operand to be fetched from memory to execute the instruction. Memory Data Register (MDR) stores the operand (data) after it is fetched from memory. R S Ananda Murthy General Aspects of Computer Organization
  • 6. Steps Followed by CPU in Instruction Execution 1 Fetch the instruction from the program memory location pointed by PC into IR. 2 Determine the type of instruction present in the IR. This is done by CU. 3 If the instruction uses an operand in memory, determine its address and place it in MAR. 4 Fetch the operand and put it in MDR, and if needed, copy it into a CPU register. 5 Execute the instruction. This is done by the CU. 6 Change the PC to point to the next instruction. 7 Go to Step 1 to begin executing the next instruction. R S Ananda Murthy General Aspects of Computer Organization
  • 7. An Imaginary Computer MAR PC MDR R0 R1 R2 : R7 IR CU ALU Address Bus Control Bus Data Bus CPU 0x0000 0x0001 0x0002 0xFFFF MEMORY Address in Hex 16 bits 16 bits 8 bits 8 bits 8 bits 8 bits 8 bits 8 bits 16 bits 8 bits : Blocks in side CPU are interconnected by internal address, data, and control buses. There are eight internal registers R0 to R7, each of 8 bits width. When we want to add two numbers, one number must be present in R0 and the other one should be present in any other register. The sum is placed in R0. Instructions can be 1-byte, 2-bytes, or 3-bytes long. R S Ananda Murthy General Aspects of Computer Organization
  • 8. Instructions Recognized by Imaginary Computer LDR Rn, MemAdr -- A three-byte instruction 1010 0 NNN MemAdr Low Byte MemAdr High Byte n NNN 0 000 1 001 2 010 3-bit Code for Registers 3 011 4 100 5 101 6 110 7 111 Opcode Copies the data present at MemAdr to the register Rn ADD R0,Rn -- A one-byte instruction 11000 NNN Adds contents of R0 and Rn and places the sum in the register R0 Opcode Operands R S Ananda Murthy General Aspects of Computer Organization
  • 9. Instructions Recognized by Imaginary Computer MVI Rn, NextByte -- A two-byte instruction 1010 1 NNN Data Byte n NNN 0 000 1 001 2 010 3-bit Code for Registers 3 011 4 100 5 101 6 110 7 111 Opcode Copies the next data byte to the register Rn. HALT -- A one-byte instruction 00000000 Stops incrementing of program counter. Opcode Operand R S Ananda Murthy General Aspects of Computer Organization
  • 10. Adding Two Numbers using Imaginary Computer Memory C1 00 : A0 30 10 A1 31 10 LDR R0,0x1030 LDR R1,0x1031 ADD R0,R1 HALT Hex Address CD EF 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 0x0006 0x0007 0x1030 : 0x1031 Augend Addend Data How is opcode A0 obtained? How is opcode A1 obtained? How is opcode C1 obtained? How many bytes in program? Trace through the program using steps given earlier. After storing the program and data in the memory as shown above we have to initialize PC with the starting address 0x0000 and then give a command to the computer to start execution of the program. R S Ananda Murthy General Aspects of Computer Organization
  • 11. Adding Two Numbers Another Way Memory A8 CD A9 EF C1 00 MVI R0,0xCD ADD R0,R1 HALT Hex Address 0x0000 0x0001 0x0002 0x0003 0x0004 0x0005 How is opcode A8 obtained? How is opcode C1 obtained? How many bytes in program? MVI R1,0xEF How is opcode A9 obtained? After storing the program and data in the memory as shown above we have to initialize PC with the starting address 0x0000 and then give a command to the computer to start execution of the program. Trace through the program using the steps given earlier. R S Ananda Murthy General Aspects of Computer Organization
  • 12. CISC and RISC On the basis of type of instructions and how they are executed, computers are roughly classified into two types – Complex Instruction Set Computers (CISC) and Reduced Instruction Set Computers (RISC). CISC and RISC both have their merits and demerits. Present trend is to incorporate the best features of both CISC and RISC in processor design to get optimum performance at optimum cost. R S Ananda Murthy General Aspects of Computer Organization
  • 13. Features of CISC Traditionally most of the processors made in 1970s and 1980s were CISC adopting Princeton architecture. Variable instruction length. For eg., there may be 1-byte, 2-byte, or 3-byte instructions as in case of Intel 8051 MCU. As compared to RISC, CISC processors generally have lesser number of internal registers in the CPU. Variable instruction cycle time. Instruction cycle is the time taken to execute an instruction. More complex instructions take longer time to execute. Large number of instructions in the instruction set. Typically there can be more than 200 instructions in the instruction set. R S Ananda Murthy General Aspects of Computer Organization
  • 14. Features of CISC Generally, in CISC a portion of R/WM is used as stack to store data while branching to subroutines. Generally, in CISC instructions are available to operate on data present in the memory directly without bringing it into a register in side the CPU. For a given task, a program in CISC results in smaller code size. Typically in CISC instructions are decoded by a microprogram which is stored in CU. Microprogram implementation requires more number of transistors to be integrated on the chip. Decoding of instructions using microprogram in CISC slows down execution. R S Ananda Murthy General Aspects of Computer Organization
  • 15. Features of RISC Traditionally RISC implementation is becoming popular since 1990s. Fixed instruction size. For eg. in AVR MCU which is a RISC processor, almost all instructions are 2-bytes in length with only a few 4-byte instructions. Large number of internal registers in the CPU. For eg. AVR MCU has 32 internal registers. Because of large number of internal registers, usage of stack to store data may not be essential as in CISC. Smaller and simpler instruction set. Typically instruction set may have less than 200 instructions. For a given task, assembly language programming of RISC machines generally requires more effort as compared to CISC processors. R S Ananda Murthy General Aspects of Computer Organization
  • 16. Features of RISC Due to the reason mentioned above, it is more convenient to program RISC processors using higher level languages like C or C++. Fixed instruction cycle time for most of the instructions. Many modern RISC processors adopt Harvard architecture to speed up program execution. Generally, in RISC it is not possible to perform arithmetic and logical operations on data present in the memory directly without bringing it into a register in side the CPU. In RISC, instruction decoding in CU is done using hardware and not by using a microprogram to speed up instruction execution. R S Ananda Murthy General Aspects of Computer Organization
  • 17. License This work is licensed under a Creative Commons Attribution 4.0 International License. R S Ananda Murthy General Aspects of Computer Organization