SlideShare a Scribd company logo
1 of 27
Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
CPU AND ITS EXECUTION OF
INSTRUCTION
Jaseena A P
jsnp65@gmail.com
www.facebook.com/Jaseena
Muhammed A P
twitter.com/username
in.linkedin.com/in/profilena
me
9539443588
WHAT IS CPU?
 Central Processing Unit
 Brain of every computer
Two main components:
- ALU
- Control unit
COMPONENTS OF CPU
 ALU
-Arithmetic and Logical Unit
-Performs all arithmetic and logical operations.
Control Unit
- Extracts instruction from memory, decodes and
executes them
- Calls ALU whenever necessary.
REGISTERS
 Registers are temporary memory units that
store words.
 The registers are located in the processor, instead of
in RAM.
Some registers are
PC, AC, IR, Index register, AMASK, MAR, and MDR,
General purpose register, Data register and
Process status register.
Program Counter: Stores the address of the macro
instruction currently being executed.
Accumulator: Stores a previously calculated value or a
value loaded from the main memory.
Instruction Register: Stores a copy of the instruction
loaded from main memory (Instruction being executed
currently).
REGISTERS(CONTD..)
REGISTERS(CONTD..)
Address Mask: When the CPU needs to know the
address of a target word that an instruction is using,
the AMASK is AND'ed with the instruction to
eliminate the opcode, leaving only the desired
address.
 Memory Address Register: This register contains the
address of the place the CPU wants to work with in
the main memory. It is directly connected to the
RAM chips on the motherboard.
REGISTERS(CONTD….)
 Process status register:
This register contains the various information about
the cpu.
 Data register:
A register used in microcomputers to temporarily store
data being transmitted to or from a peripheral device.
 General purpose registers:
-A general purpose register is a memory cell.
-Each general purpose register has a unique name
-It is used to store intermediate result of complex
computation
REGISTERS(CONTD…)
 MDR(Memory data register)
-It is the register that contains the data to be
stored in the computer storage or data after a fetch
from the computer storage.
-It acts like a buffer and holds anything that is
copied from the memory ready for the processor
to use it,
 Index register:
-A hardware element which holds a number that
can be added to (or, in some cases, subtracted
from) the address portion of a computer
instruction to form an effective address.
-An index register in a computer's CPU is a
processor register used for modifying operand
addresses during the run of a program.
HOW CPU COMMUNICATES?
 Pathway that interconnect CPU to all the other
components on the motherboard
Two types:
-Internal
-External
 The lines or pins of a bus are of three types:
-Data
-Address
-Control
SYSTEM BUS
Address - the components pass memory addresses
to one another over the address bus.
Control - used to send out signals to coordinate and
manage the activities of the motherboard
components.
Data - transferred between peripherals, memory and
the CPU. Obviously, the data bus can be a very busy
pathway.
SYSTEM BUS(CONTD..)
INSTRUCTION
 Single operation of a processor defined by
the processor instruction set.
 An instruction has two components:
opcode operand
Eg: ADD Ro 100
INSTRUCTION TYPES
 Instructions can be divided into six groups:
-Data transfer
eg: MOV, LOAD
-Arithmetic
eg: ADD, SUB, DIV
-Logical
eg: AND, OR, NOT
-System-control
eg: STOP
-I/O
eg: IN and OUT
-Program Control
Program control can be divided into:
-Unconditional Branch
eg:JMP NEXT % Jump to the label NEXT
-Conditional Branch
eg: JZ LABEL % jump to label if current value in
AC is ZERO
-Subroutine call
eg: CALL SUB
-Interrupt handling
eg:TRAP
INSTRUCTION TYPES
INSTRUCTION CYCLE
1. Load the address of next instruction in the PC into the
MAR.
So that the control unit can fetch the instruction from the right part
of the memory.
2. Copy the instruction/data that is in the memory address
given by the MAR into the MDR.
MDR is used whenever anything is to go from the CPU to main
memory, or vice versa.
3. Increment the PC by 1.
So that it contains the address of the next instruction, assuming
that the instructions are in consecutive locations.
4. Load the instruction/data that is now in the MDR into
the IR.
Thus the next instruction is copied from memory -> MDR -> IR.
1.FETCH
2.DECODE
1. Contents of IR split into operation code and address
if present e.g. store, add or jump instructions.
2. Decode the instruction that is in the IR
3.EXECUTE
• If the instruction is a jump instruction then
Load the address part of the instruction in the IR into the PC.
• If the instruction is an input / load (directly) instruction
then
take data input and place in accumulator.
• If the instruction is a load (from memory) instruction.
Copy address part of the instruction (to load from) in the IR into MAR.
Copy data from memory address held in MAR to MDR.
Copy data in MDR into accumulator
• If the instruction is a store instruction then:
Copy address part of the instruction (to store in) in the IR into
MAR.
Copy data in accumulator to MDR.
Copy data in MDR into memory address held in MAR.
• If the instruction is arithmetic then:
Copy address part of the instruction (of number to perform
arithmetic operation) in the IR into MAR.
Copy number from memory address held in MAR into MDR.
Perform operation to number in accumulator (accumulator will
now hold the result).
EXECUTE(CONTD..)
• If the instruction is an output (from memory)
instruction then:
Copy address part of part of the instruction (of data to output) in IR
into MAR.
Output contents of MDR.
EXECUTE(CONTD…)
4.STORE THE OUTPUT
Result of calculations in cpu stored in main memory
or sent to output devices.
Program Counter could be updated to a new address
AN EXAMPLE
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.
Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

More Related Content

What's hot

Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecturevikram patel
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationMOHIT AGARWAL
 
COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5Dr.MAYA NAYAK
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulationSanjeev Patel
 
Unit – 2
Unit – 2Unit – 2
Unit – 2techbed
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycleMuhammad Ameer Mohavia
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycleMkaur01
 
Data Manipulation
Data ManipulationData Manipulation
Data ManipulationAsfi Bhai
 
How CPU’s and Memory Work
How CPU’s and Memory WorkHow CPU’s and Memory Work
How CPU’s and Memory WorkJonathan Reid
 
top level view of computer function and interconnection
top level view of computer function and interconnectiontop level view of computer function and interconnection
top level view of computer function and interconnectionSajid Marwat
 
Computer organization
Computer organizationComputer organization
Computer organizationishapadhy
 
computer architecture
computer architecture computer architecture
computer architecture Dr.Umadevi V
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and ArchitectureSubhasis Dash
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Subhasis Dash
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and ArchitectureVinit Raut
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4Dr.MAYA NAYAK
 

What's hot (20)

Input output in computer Orgranization and architecture
Input output in computer Orgranization and architectureInput output in computer Orgranization and architecture
Input output in computer Orgranization and architecture
 
Modes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output OrganizationModes Of Transfer in Input/Output Organization
Modes Of Transfer in Input/Output Organization
 
COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5COMPUTER ORGANIZATION NOTES Unit 5
COMPUTER ORGANIZATION NOTES Unit 5
 
Data transfer and manipulation
Data transfer and manipulationData transfer and manipulation
Data transfer and manipulation
 
CPU & RAM
CPU & RAMCPU & RAM
CPU & RAM
 
Unit – 2
Unit – 2Unit – 2
Unit – 2
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycle
 
Data Manipulation
Data ManipulationData Manipulation
Data Manipulation
 
How CPU’s and Memory Work
How CPU’s and Memory WorkHow CPU’s and Memory Work
How CPU’s and Memory Work
 
top level view of computer function and interconnection
top level view of computer function and interconnectiontop level view of computer function and interconnection
top level view of computer function and interconnection
 
Computer organization
Computer organizationComputer organization
Computer organization
 
Cpu & its execution of instruction
Cpu & its execution of instructionCpu & its execution of instruction
Cpu & its execution of instruction
 
computer architecture
computer architecture computer architecture
computer architecture
 
Computer Organisation and Architecture
Computer Organisation and ArchitectureComputer Organisation and Architecture
Computer Organisation and Architecture
 
Input-Output Modules
Input-Output ModulesInput-Output Modules
Input-Output Modules
 
Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1) Computer Organisation & Architecture (chapter 1)
Computer Organisation & Architecture (chapter 1)
 
Processor Organization and Architecture
Processor Organization and ArchitectureProcessor Organization and Architecture
Processor Organization and Architecture
 
COMPUTER ORGANIZATION NOTES Unit 3 4
COMPUTER ORGANIZATION NOTES  Unit 3 4COMPUTER ORGANIZATION NOTES  Unit 3 4
COMPUTER ORGANIZATION NOTES Unit 3 4
 

Similar to CPU and its execution of instruction

Similar to CPU and its execution of instruction (20)

Cpu & its execution of instruction
Cpu & its execution of instructionCpu & its execution of instruction
Cpu & its execution of instruction
 
Cpu execution
Cpu executionCpu execution
Cpu execution
 
Cpu
CpuCpu
Cpu
 
CPU Architecture
CPU ArchitectureCPU Architecture
CPU Architecture
 
CAO.pptx
CAO.pptxCAO.pptx
CAO.pptx
 
Processor organization & register organization
Processor organization & register organizationProcessor organization & register organization
Processor organization & register organization
 
cpuorganisation-140723043011-phpapp02.pdf
cpuorganisation-140723043011-phpapp02.pdfcpuorganisation-140723043011-phpapp02.pdf
cpuorganisation-140723043011-phpapp02.pdf
 
Computer Organization and Architechuture basics
Computer Organization and Architechuture basicsComputer Organization and Architechuture basics
Computer Organization and Architechuture basics
 
Bc0040
Bc0040Bc0040
Bc0040
 
Bca examination 2015 csa
Bca examination 2015 csaBca examination 2015 csa
Bca examination 2015 csa
 
INSTRUCTION TYPES
INSTRUCTION TYPESINSTRUCTION TYPES
INSTRUCTION TYPES
 
Co unit 1
Co unit 1Co unit 1
Co unit 1
 
Cpu organisation
Cpu organisationCpu organisation
Cpu organisation
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
co1_aiml_new.pptx
co1_aiml_new.pptxco1_aiml_new.pptx
co1_aiml_new.pptx
 
computer architecture and the fetch execute cycle By ZAK
computer architecture and the fetch execute cycle By ZAKcomputer architecture and the fetch execute cycle By ZAK
computer architecture and the fetch execute cycle By ZAK
 
1.3.2 computer architecture and the fetch execute cycle By ZAK
1.3.2 computer architecture and the fetch execute cycle By ZAK1.3.2 computer architecture and the fetch execute cycle By ZAK
1.3.2 computer architecture and the fetch execute cycle By ZAK
 
Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2Computer Organization & Architecture (COA) Unit 2
Computer Organization & Architecture (COA) Unit 2
 
COMPONENTS OF SYSTEM UNIT
COMPONENTS OF SYSTEM UNITCOMPONENTS OF SYSTEM UNIT
COMPONENTS OF SYSTEM UNIT
 
Computer system Hardware and Instruction
Computer system Hardware and InstructionComputer system Hardware and Instruction
Computer system Hardware and Instruction
 

More from baabtra.com - No. 1 supplier of quality freshers

More from baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Recently uploaded

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

CPU and its execution of instruction

  • 1.
  • 2. Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring Partner Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd
  • 3.
  • 4. CPU AND ITS EXECUTION OF INSTRUCTION Jaseena A P jsnp65@gmail.com www.facebook.com/Jaseena Muhammed A P twitter.com/username in.linkedin.com/in/profilena me 9539443588
  • 5. WHAT IS CPU?  Central Processing Unit  Brain of every computer Two main components: - ALU - Control unit
  • 6. COMPONENTS OF CPU  ALU -Arithmetic and Logical Unit -Performs all arithmetic and logical operations. Control Unit - Extracts instruction from memory, decodes and executes them - Calls ALU whenever necessary.
  • 7. REGISTERS  Registers are temporary memory units that store words.  The registers are located in the processor, instead of in RAM. Some registers are PC, AC, IR, Index register, AMASK, MAR, and MDR, General purpose register, Data register and Process status register.
  • 8. Program Counter: Stores the address of the macro instruction currently being executed. Accumulator: Stores a previously calculated value or a value loaded from the main memory. Instruction Register: Stores a copy of the instruction loaded from main memory (Instruction being executed currently). REGISTERS(CONTD..)
  • 9. REGISTERS(CONTD..) Address Mask: When the CPU needs to know the address of a target word that an instruction is using, the AMASK is AND'ed with the instruction to eliminate the opcode, leaving only the desired address.  Memory Address Register: This register contains the address of the place the CPU wants to work with in the main memory. It is directly connected to the RAM chips on the motherboard.
  • 10. REGISTERS(CONTD….)  Process status register: This register contains the various information about the cpu.  Data register: A register used in microcomputers to temporarily store data being transmitted to or from a peripheral device.  General purpose registers: -A general purpose register is a memory cell. -Each general purpose register has a unique name -It is used to store intermediate result of complex computation
  • 11. REGISTERS(CONTD…)  MDR(Memory data register) -It is the register that contains the data to be stored in the computer storage or data after a fetch from the computer storage. -It acts like a buffer and holds anything that is copied from the memory ready for the processor to use it,  Index register: -A hardware element which holds a number that can be added to (or, in some cases, subtracted from) the address portion of a computer instruction to form an effective address. -An index register in a computer's CPU is a processor register used for modifying operand addresses during the run of a program.
  • 13.  Pathway that interconnect CPU to all the other components on the motherboard Two types: -Internal -External  The lines or pins of a bus are of three types: -Data -Address -Control SYSTEM BUS
  • 14. Address - the components pass memory addresses to one another over the address bus. Control - used to send out signals to coordinate and manage the activities of the motherboard components. Data - transferred between peripherals, memory and the CPU. Obviously, the data bus can be a very busy pathway. SYSTEM BUS(CONTD..)
  • 15. INSTRUCTION  Single operation of a processor defined by the processor instruction set.  An instruction has two components: opcode operand Eg: ADD Ro 100
  • 16. INSTRUCTION TYPES  Instructions can be divided into six groups: -Data transfer eg: MOV, LOAD -Arithmetic eg: ADD, SUB, DIV -Logical eg: AND, OR, NOT -System-control eg: STOP -I/O eg: IN and OUT -Program Control
  • 17. Program control can be divided into: -Unconditional Branch eg:JMP NEXT % Jump to the label NEXT -Conditional Branch eg: JZ LABEL % jump to label if current value in AC is ZERO -Subroutine call eg: CALL SUB -Interrupt handling eg:TRAP INSTRUCTION TYPES
  • 19. 1. Load the address of next instruction in the PC into the MAR. So that the control unit can fetch the instruction from the right part of the memory. 2. Copy the instruction/data that is in the memory address given by the MAR into the MDR. MDR is used whenever anything is to go from the CPU to main memory, or vice versa. 3. Increment the PC by 1. So that it contains the address of the next instruction, assuming that the instructions are in consecutive locations. 4. Load the instruction/data that is now in the MDR into the IR. Thus the next instruction is copied from memory -> MDR -> IR. 1.FETCH
  • 20. 2.DECODE 1. Contents of IR split into operation code and address if present e.g. store, add or jump instructions. 2. Decode the instruction that is in the IR
  • 21. 3.EXECUTE • If the instruction is a jump instruction then Load the address part of the instruction in the IR into the PC. • If the instruction is an input / load (directly) instruction then take data input and place in accumulator. • If the instruction is a load (from memory) instruction. Copy address part of the instruction (to load from) in the IR into MAR. Copy data from memory address held in MAR to MDR. Copy data in MDR into accumulator
  • 22. • If the instruction is a store instruction then: Copy address part of the instruction (to store in) in the IR into MAR. Copy data in accumulator to MDR. Copy data in MDR into memory address held in MAR. • If the instruction is arithmetic then: Copy address part of the instruction (of number to perform arithmetic operation) in the IR into MAR. Copy number from memory address held in MAR into MDR. Perform operation to number in accumulator (accumulator will now hold the result). EXECUTE(CONTD..)
  • 23. • If the instruction is an output (from memory) instruction then: Copy address part of part of the instruction (of data to output) in IR into MAR. Output contents of MDR. EXECUTE(CONTD…)
  • 24. 4.STORE THE OUTPUT Result of calculations in cpu stored in main memory or sent to output devices. Program Counter could be updated to a new address
  • 26. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 27. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com