SlideShare a Scribd company logo
1 of 21
Computer Architecture
and Organization
Instructor: Col Dr. Khawar Mehmood
You can revolutionize the way computers are built, if you understand both the
hardware and the software and change each accordingly
Introduction
• Why Do We Have Computers?
• To Solve Problems
• How Does a Computer Solve Problems?
• Orchestrating Electrons
• How Do Problems Get Solved by Electrons?
Introduction - The Transformation Hierarchy
Micro-architecture
SW/HW Interface
Program/Language
Algorithm
Problem
Logic
Devices
System Software
Electrons
Computer Architecture
(narrow view)
Computer Architecture
(expanded view)
Computer Organization
vs.
Architecture
Computer Architecture vs. Organization
• Architecture:
—Logical aspects of computer hardware that are
visible to the programmer
– What instruction a computer understands!
– Instruction Set Architecture (ISA)
—Example: Architectural design issue is
whether a computer will have multiply
instruction or not.
5
Computer Organization vs. Architecture
• Organization:
—Physical aspects of computer hardware that
are invisible to the programmer
– How does the computer hardware carries out
instructions!
– Hardware details are transparent to the programmer
—For Example: Is there a special hardware
multiply unit for multiplication operation or is
it done by repeated addition?
6
7
Concept of the ISA
• ISA stands for Instruction Set Architecture,
and it could be viewed as a model for the
computer
• It includes the instruction set, memory space
and all the programmer-accessible registers
• It serves as the interface between the
program and the functional units of the
computer
Types of Computer Architectures
• Microcontrollers generally use two types of
Architecture.
—Von Neumann Architecture
—Harvard Architecture
8
Types of Computer Architectures
9
Differences
Von Neumann Harvard
Single Memory to be shared by
both code and data
Separate Memory for code and
data
Need two clock cycles to fetch
instruction and data
Single clock cycle is sufficient to
fetch instruction and data
Simple in design – requires less
hardware components
Complex in design
Types of Computer Architectures
10
Von Neumann CPU
Data
Instructions Data / Instruction Bus
Address Bus
Control Bus
Memory
Types of Computer Architectures
11
Harvard CPU
Instructions
Memory
Data
Memory
Instruction Bus
Address Bus
Control Bus
Data Bus
Address Bus
Control Bus
Why Learn Assembly
Language?
Why to learn Assembly Language
Why to learn Assembly Language
• There is a general impression that assembly
language is difficult to learn
• In fact if you are not an expert, you will learn
assembly language quickly, as non-experts see
things with simplicity and the basic beauty of
assembly language is that it is exceptionally
simple.
• Do not ever try to find a complication, as one will
not be there.
• In assembly language what is written in the
program is all that is there, no less and no more.
15
Why to learn Assembly Language
• Assembly language commands are a symbolic
representation of machine language commands
using “English like” keywords called “mnemonics”
• Using assembly language commands, its much
easier to program as compared to machine
language in the form of long strings of 1s and 0s
• Commands in assembly language have a one-to-
one correspondence with machine language
commands
16
Example
• Some assembly language instructions of the
x86 family of computers and their equivalent
machine language instructions
Assembly
Language
Machine Language
(Binary)
Machine
Language
(Hex)
Instruction
type
add cx, dx 0000 0001 1101 0001 01 D1 Arithmetic
mov alx, 34h 1011 1000 0011 0100 0000 0000 B8 34 00 Data transfer
xor ax, bx 0011 0001 1101 1000 31 D8 Logic
jmp alpha 1110 1011 1111 1100 EB FC Control
Why to learn Assembly Language
• Why should we learn assembly language when
there are higher level languages one better than
the other
—A translator translating from English to Japanese
—Think about a three-color picture scanned at 300 dots per inch
making 90000 pixels per square inch.
—Now a processing on this picture requires 270000 operations
per square inch, one operation for each color of each pixel.
—A few extra instructions placed by the translator can cost hours
of extra time.
—The only way to optimize this is to do it directly in assembly
language.
—IMPORTANT: This doesn’t mean that the whole application has
to be written in assembly language, which is almost never the
case. It’s only the performance critical part that is coded in
assembly language to save few extra cycles that matter at that
Why to learn Assembly Language
• Time Critical / Real time systems
—Real time systems have time bound responses
—For such precise timing requirement, we must keep
the instructions in our total control.
—In higher level languages we cannot even tell how
many computer instructions were actually used
—In assembly language we have precise control over
them
• No assembly language, no optimization
• Sometimes a useful application becomes
useless just because it is not optimized
Why to learn Assembly Language
• For reverse engineering –
—taking malware and figuring out what it does
• Vulnerability research
—Taking a program and finding flaws in it
• Exploit crafting
—Writing code to take advantage of a flaw in a program
• Some types of forensics, memory forensics in
particular
—Figuring out what happened during a cyber attack
• And many more.
Machine Language vs Assembly Language
Machine Language Assembly Language
Only understandable by the computers.
only understandable by humans not by
computers.
Represented in binary format(0s and 1s)
Represented with mnemonics such as Mov,
Add, Sub etc.
Difficult to understand by human beings. Easy to understand by the human being.
Error fixing is almost impossible
Error fixing can be done in assembly
language.
Difficult to memorize so difficult to learn
Easy to memorize (mnemonics) thus easy
to learn
Execution is fast as all data is already in
0s and 1s
Execution is slow as compared to machine
language.
There is no need of translator Assembler is used as translator
Machine language is hardware
dependent.
Assembly language is the machine
dependent and it is not portable.
computer architecture and organization.ppt

More Related Content

Similar to computer architecture and organization.ppt

Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming VanessaBuensalida
 
what is assembly language by faisal shahzad
what is assembly language by faisal shahzadwhat is assembly language by faisal shahzad
what is assembly language by faisal shahzadFaisal Shehzad
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langaugemustafkhalid
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxlematadese670
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresNisarg Amin
 
introduction to assembly language by Faisal Shehzad
introduction to assembly language by Faisal Shehzadintroduction to assembly language by Faisal Shehzad
introduction to assembly language by Faisal ShehzadFaisal Shehzad
 
introduction to assembly language.
introduction to assembly language.introduction to assembly language.
introduction to assembly language.Faisal Shehzad
 
Ch0 computer systems overview
Ch0 computer systems overviewCh0 computer systems overview
Ch0 computer systems overviewAboubakarIbrahima
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & LanguagesGaditek
 
Problem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdfProblem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdfjlu08167
 

Similar to computer architecture and organization.ppt (20)

sege.pdf
sege.pdfsege.pdf
sege.pdf
 
Introduction to computer programming
Introduction to computer programming Introduction to computer programming
Introduction to computer programming
 
what is assembly language by faisal shahzad
what is assembly language by faisal shahzadwhat is assembly language by faisal shahzad
what is assembly language by faisal shahzad
 
programming.pptx
programming.pptxprogramming.pptx
programming.pptx
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
Assembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly LangaugeAssembly Langauge Assembly Langauge Assembly Langauge
Assembly Langauge Assembly Langauge Assembly Langauge
 
Language processors
Language processorsLanguage processors
Language processors
 
Embedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptxEmbedded programming Embedded programming (1).pptx
Embedded programming Embedded programming (1).pptx
 
Programming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwaresProgramming languages,compiler,interpreter,softwares
Programming languages,compiler,interpreter,softwares
 
introduction to assembly language by Faisal Shehzad
introduction to assembly language by Faisal Shehzadintroduction to assembly language by Faisal Shehzad
introduction to assembly language by Faisal Shehzad
 
introduction to assembly language.
introduction to assembly language.introduction to assembly language.
introduction to assembly language.
 
System softare
System softareSystem softare
System softare
 
Programming languages.pptx
Programming languages.pptxProgramming languages.pptx
Programming languages.pptx
 
Ch0 computer systems overview
Ch0 computer systems overviewCh0 computer systems overview
Ch0 computer systems overview
 
Csc240 lecture 1
Csc240   lecture 1Csc240   lecture 1
Csc240 lecture 1
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
Assembly language
Assembly languageAssembly language
Assembly language
 
Problem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdfProblem Solving and Program Design in C_1.pdf
Problem Solving and Program Design in C_1.pdf
 
01CHAP_1.PPT
01CHAP_1.PPT01CHAP_1.PPT
01CHAP_1.PPT
 

Recently uploaded

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Recently uploaded (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

computer architecture and organization.ppt

  • 1. Computer Architecture and Organization Instructor: Col Dr. Khawar Mehmood You can revolutionize the way computers are built, if you understand both the hardware and the software and change each accordingly
  • 2. Introduction • Why Do We Have Computers? • To Solve Problems • How Does a Computer Solve Problems? • Orchestrating Electrons • How Do Problems Get Solved by Electrons?
  • 3. Introduction - The Transformation Hierarchy Micro-architecture SW/HW Interface Program/Language Algorithm Problem Logic Devices System Software Electrons Computer Architecture (narrow view) Computer Architecture (expanded view)
  • 5. Computer Architecture vs. Organization • Architecture: —Logical aspects of computer hardware that are visible to the programmer – What instruction a computer understands! – Instruction Set Architecture (ISA) —Example: Architectural design issue is whether a computer will have multiply instruction or not. 5
  • 6. Computer Organization vs. Architecture • Organization: —Physical aspects of computer hardware that are invisible to the programmer – How does the computer hardware carries out instructions! – Hardware details are transparent to the programmer —For Example: Is there a special hardware multiply unit for multiplication operation or is it done by repeated addition? 6
  • 7. 7 Concept of the ISA • ISA stands for Instruction Set Architecture, and it could be viewed as a model for the computer • It includes the instruction set, memory space and all the programmer-accessible registers • It serves as the interface between the program and the functional units of the computer
  • 8. Types of Computer Architectures • Microcontrollers generally use two types of Architecture. —Von Neumann Architecture —Harvard Architecture 8
  • 9. Types of Computer Architectures 9 Differences Von Neumann Harvard Single Memory to be shared by both code and data Separate Memory for code and data Need two clock cycles to fetch instruction and data Single clock cycle is sufficient to fetch instruction and data Simple in design – requires less hardware components Complex in design
  • 10. Types of Computer Architectures 10 Von Neumann CPU Data Instructions Data / Instruction Bus Address Bus Control Bus Memory
  • 11. Types of Computer Architectures 11 Harvard CPU Instructions Memory Data Memory Instruction Bus Address Bus Control Bus Data Bus Address Bus Control Bus
  • 13. Why to learn Assembly Language
  • 14. Why to learn Assembly Language • There is a general impression that assembly language is difficult to learn • In fact if you are not an expert, you will learn assembly language quickly, as non-experts see things with simplicity and the basic beauty of assembly language is that it is exceptionally simple. • Do not ever try to find a complication, as one will not be there. • In assembly language what is written in the program is all that is there, no less and no more.
  • 15. 15 Why to learn Assembly Language • Assembly language commands are a symbolic representation of machine language commands using “English like” keywords called “mnemonics” • Using assembly language commands, its much easier to program as compared to machine language in the form of long strings of 1s and 0s • Commands in assembly language have a one-to- one correspondence with machine language commands
  • 16. 16 Example • Some assembly language instructions of the x86 family of computers and their equivalent machine language instructions Assembly Language Machine Language (Binary) Machine Language (Hex) Instruction type add cx, dx 0000 0001 1101 0001 01 D1 Arithmetic mov alx, 34h 1011 1000 0011 0100 0000 0000 B8 34 00 Data transfer xor ax, bx 0011 0001 1101 1000 31 D8 Logic jmp alpha 1110 1011 1111 1100 EB FC Control
  • 17. Why to learn Assembly Language • Why should we learn assembly language when there are higher level languages one better than the other —A translator translating from English to Japanese —Think about a three-color picture scanned at 300 dots per inch making 90000 pixels per square inch. —Now a processing on this picture requires 270000 operations per square inch, one operation for each color of each pixel. —A few extra instructions placed by the translator can cost hours of extra time. —The only way to optimize this is to do it directly in assembly language. —IMPORTANT: This doesn’t mean that the whole application has to be written in assembly language, which is almost never the case. It’s only the performance critical part that is coded in assembly language to save few extra cycles that matter at that
  • 18. Why to learn Assembly Language • Time Critical / Real time systems —Real time systems have time bound responses —For such precise timing requirement, we must keep the instructions in our total control. —In higher level languages we cannot even tell how many computer instructions were actually used —In assembly language we have precise control over them • No assembly language, no optimization • Sometimes a useful application becomes useless just because it is not optimized
  • 19. Why to learn Assembly Language • For reverse engineering – —taking malware and figuring out what it does • Vulnerability research —Taking a program and finding flaws in it • Exploit crafting —Writing code to take advantage of a flaw in a program • Some types of forensics, memory forensics in particular —Figuring out what happened during a cyber attack • And many more.
  • 20. Machine Language vs Assembly Language Machine Language Assembly Language Only understandable by the computers. only understandable by humans not by computers. Represented in binary format(0s and 1s) Represented with mnemonics such as Mov, Add, Sub etc. Difficult to understand by human beings. Easy to understand by the human being. Error fixing is almost impossible Error fixing can be done in assembly language. Difficult to memorize so difficult to learn Easy to memorize (mnemonics) thus easy to learn Execution is fast as all data is already in 0s and 1s Execution is slow as compared to machine language. There is no need of translator Assembler is used as translator Machine language is hardware dependent. Assembly language is the machine dependent and it is not portable.