SlideShare a Scribd company logo
Computer Organization &
Assembly Language
Instructor: Ms. Saima Shoro
4 – Processor Basics
Basic Operational Concepts
3
Machine Instruction Elements
 Each instruction must have elements that contain the
information required by the CPU for execution.
 These elements can be:
 Operation code: Specifies the operation to be performed (e.g..
ADD, I/O).The operation is specified by a binary code, known as the
operation code, or opcode.
 Source operand reference: The operation may involve one or
more source operands, that is, operands that are inputs for the
operation.
 Result operand reference: The operation may produce a result.
Also called destination operand.
 Next instruction reference:This tells the CPU where to fetch the
next instruction.
Reference: http://cnx.org/content/m29425/latest/
4
Instruction Representation
 Within the computer, each instruction is represented by a
sequence of bits.
 16 bits instruction
 4 bit opcode, 6 bit operand 1, 6 bit operand 2
 4 bit opcode, 12 bit operand
 32 bits instruction
 64 bits instruction
Figure:A Simple Instruction Format
5
Contd..
 Binary representations of machine instructions is difficult to
remember.
 Use a symbolic representation of machine instructions.
 Opcodes are represented by abbreviations, called mnemonics,
that indicate the operation. Common examples include:
6
Instruction Types
 Data processing:Arithmetic and logic instructions
 Data storage: Memory instructions
 Data movement: I/O instructions
 Transfer of Control:Test and branch instructions
7
No. of Addresses in an Instruction
 Three addresses
 Operand 1, operand 2, result
 Two addresses
 Source
 Destination
 One addresses
 Source or Destination
 Zero address
 Zero-address instructions are applicable to a special memory
organization, called a Stack. A stack is a last-in-first-out set of
locations.
8
Types of Operands
 Machine instructions operate on data.
 The most important general categories of data are:
 Addresses
 Numbers
 Characters
 Logical data
9
Basic Operations – Processor
 Execute the software by fetching instruction from memory
 Look for any external signal and react accordingly
 Input signals from keyboard or mouse etc.
10
Processor Clock
 Heart of any processor
 Simple digital signals at equal time intervals
 Alternate On Off states
 All activity within the CPU is synchronized with the edges
(rising or falling) of this clock signal.
Reference: http://www.plantation-productions.com/Webster/www.artofasm.com/Linux/HTML/
SystemOrganizationa4.html
Rising Edge Falling Edge
11
Program Counter (a.k.a. Binary Counter)
 With every falling edge or rising edge (depending upon processor) of clock
signal, the counter is incremented by one.
 Width varies from processor to processor
 The contents of PC are used as target address for the memory area
Microprocessor
Memory
Control
Unit (CU)
PC
Data Buffer
Memory
Read
Memory address
Data from Memory
Data
Address
Read
Figure: Reading from memory
Basic Instruction Cycle
 Fetch  Decode  Execute
 Fetch
1. Fetch an instruction from memory
2. Decode the instruction to determine the operation
3. Fetch data from memory if necessary
 Execute
4. Perform the operation on the data
5. Store the result in memory if needed
12
Contd..
 Internal CPU Registers used in instruction cycle:
 Program Counter (PC) = Address of instruction
 Instruction Register (IR) = Instruction being executed
 Accumulator (AC) = Temporary Storage
13
Computer Components: Top Level View Contd..
14
Detailed Steps
 Address in the Program Counter register
 Program Counter (PC) holds address of next instruction to fetch
 Fetch the instruction from the memory
 Increment the Program Counter
 Unless told otherwise
 Instruction loaded into Instruction Register (IR)
 Decode the type of instruction
 Fetch the operands
 Execute the instruction
 Store the results
15
Instruction Execution Cycle
I-1 I-2 I-3 I-4
PC Program (RAM)
I-1
Instruction
Queue
op1
op2
Data
(RAM)
fetch
ALU
registers
store the output
decode
execute
16
Instruction Cycle State Diagram
17
18
Contd..
 Instruction Fetch
 Read instruction from memory into processor
 Instruction Operation Decoding
 Determine the type of operation to be performed and operand(s) to be used.
 Operand Address Calculation
 If operation involves reference to an operand in memory or I/O, then
determine the address of operand.
 Operand Fetch
 Fetch from memory or read from I/O
 Data Operation
 Perform the operation
 Operand Store
 Write into memory or out to I/O if required

More Related Content

PPTX
Processor Basics
PPTX
Lecture004BasicsofthedProcessor (1).pptx
PPTX
Part Four The CPU architecture in .pptx
PDF
CO Unit 3.pdf (Important chapter of coa)
PPTX
Central Processing Unit
PPT
coa Chapter 2 final edited*Minimum 40 characters required.ppt
PDF
Instruction execution cycle _
PPTX
COA SEMINAfrdreewqfeeerttfwsreeeeewwR.pptx
Processor Basics
Lecture004BasicsofthedProcessor (1).pptx
Part Four The CPU architecture in .pptx
CO Unit 3.pdf (Important chapter of coa)
Central Processing Unit
coa Chapter 2 final edited*Minimum 40 characters required.ppt
Instruction execution cycle _
COA SEMINAfrdreewqfeeerttfwsreeeeewwR.pptx

Similar to Computer organizations and assembly language (20)

PPTX
Chapter 3 Assembly level machine organization Assembly level machine organiza...
PDF
Central processing unit i
PPT
lecture 1(1).ppt
PPTX
Register Organization and Instruction cycle
PDF
Unit 3 - Computer Organization .pdf
PPTX
PPTX
basicfunctionalunit-190124043726555.pptx
PPT
Data path of Computer Architecture ALU and other components
PPT
COA Chapter 3 final edited*Minimum 40 characters required.ppt
PPT
Control unit
PDF
APznzaboj9CF_9DQRT2HR-lWEYeLjr197Vw_ZUktUfDvP5Qqd8SL2ZSNwpIwVoC6MN9lqvglTXM11...
PPTX
instruction
PPTX
Computer Architecture Lecture slide 2. course se 222
PPTX
ITEC582-Chapter 12.pptx
PPT
Chapter01 (1).ppt
PPTX
lecture2.pptx
PPTX
instruction cycle
PPTX
Computer Organization and Architecture - UNIT I.pptx
PPT
Memory & the fetch decode-execute cycle
PPT
03. top level view of computer function & interconnection
Chapter 3 Assembly level machine organization Assembly level machine organiza...
Central processing unit i
lecture 1(1).ppt
Register Organization and Instruction cycle
Unit 3 - Computer Organization .pdf
basicfunctionalunit-190124043726555.pptx
Data path of Computer Architecture ALU and other components
COA Chapter 3 final edited*Minimum 40 characters required.ppt
Control unit
APznzaboj9CF_9DQRT2HR-lWEYeLjr197Vw_ZUktUfDvP5Qqd8SL2ZSNwpIwVoC6MN9lqvglTXM11...
instruction
Computer Architecture Lecture slide 2. course se 222
ITEC582-Chapter 12.pptx
Chapter01 (1).ppt
lecture2.pptx
instruction cycle
Computer Organization and Architecture - UNIT I.pptx
Memory & the fetch decode-execute cycle
03. top level view of computer function & interconnection
Ad

More from KamranNazakat1 (9)

PPTX
Management in business schools for all learners
PPTX
Motivations employees in management sciences
PPTX
The dynamic rules and principles of Management
PPT
Organisational structure and design in management sciences
PDF
Management Principles and it's vital role in business
PPT
This is a special PPT on Tenses. This will help learners to learn more and ha...
PPTX
Idioms PPT for Beginners and Learners. Specially designed for Intermediate st...
PPTX
Punctuation Marks 2: a very comprehensive PPat on rules on it .
PPTX
Punctuation Marks: a very comprehensive PPT on rules
Management in business schools for all learners
Motivations employees in management sciences
The dynamic rules and principles of Management
Organisational structure and design in management sciences
Management Principles and it's vital role in business
This is a special PPT on Tenses. This will help learners to learn more and ha...
Idioms PPT for Beginners and Learners. Specially designed for Intermediate st...
Punctuation Marks 2: a very comprehensive PPat on rules on it .
Punctuation Marks: a very comprehensive PPT on rules
Ad

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Insiders guide to clinical Medicine.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Pharma ospi slides which help in ospi learning
PPTX
Institutional Correction lecture only . . .
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Pre independence Education in Inndia.pdf
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Cell Types and Its function , kingdom of life
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Business Ethics Teaching Materials for college
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Insiders guide to clinical Medicine.pdf
Anesthesia in Laparoscopic Surgery in India
Pharma ospi slides which help in ospi learning
Institutional Correction lecture only . . .
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Week 4 Term 3 Study Techniques revisited.pptx
Microbial diseases, their pathogenesis and prophylaxis
STATICS OF THE RIGID BODIES Hibbelers.pdf
Pre independence Education in Inndia.pdf
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Cell Types and Its function , kingdom of life
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Business Ethics Teaching Materials for college
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O5-L3 Freight Transport Ops (International) V1.pdf
VCE English Exam - Section C Student Revision Booklet
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
2.FourierTransform-ShortQuestionswithAnswers.pdf

Computer organizations and assembly language

  • 1. Computer Organization & Assembly Language Instructor: Ms. Saima Shoro 4 – Processor Basics
  • 3. 3 Machine Instruction Elements  Each instruction must have elements that contain the information required by the CPU for execution.  These elements can be:  Operation code: Specifies the operation to be performed (e.g.. ADD, I/O).The operation is specified by a binary code, known as the operation code, or opcode.  Source operand reference: The operation may involve one or more source operands, that is, operands that are inputs for the operation.  Result operand reference: The operation may produce a result. Also called destination operand.  Next instruction reference:This tells the CPU where to fetch the next instruction. Reference: http://cnx.org/content/m29425/latest/
  • 4. 4 Instruction Representation  Within the computer, each instruction is represented by a sequence of bits.  16 bits instruction  4 bit opcode, 6 bit operand 1, 6 bit operand 2  4 bit opcode, 12 bit operand  32 bits instruction  64 bits instruction Figure:A Simple Instruction Format
  • 5. 5 Contd..  Binary representations of machine instructions is difficult to remember.  Use a symbolic representation of machine instructions.  Opcodes are represented by abbreviations, called mnemonics, that indicate the operation. Common examples include:
  • 6. 6 Instruction Types  Data processing:Arithmetic and logic instructions  Data storage: Memory instructions  Data movement: I/O instructions  Transfer of Control:Test and branch instructions
  • 7. 7 No. of Addresses in an Instruction  Three addresses  Operand 1, operand 2, result  Two addresses  Source  Destination  One addresses  Source or Destination  Zero address  Zero-address instructions are applicable to a special memory organization, called a Stack. A stack is a last-in-first-out set of locations.
  • 8. 8 Types of Operands  Machine instructions operate on data.  The most important general categories of data are:  Addresses  Numbers  Characters  Logical data
  • 9. 9 Basic Operations – Processor  Execute the software by fetching instruction from memory  Look for any external signal and react accordingly  Input signals from keyboard or mouse etc.
  • 10. 10 Processor Clock  Heart of any processor  Simple digital signals at equal time intervals  Alternate On Off states  All activity within the CPU is synchronized with the edges (rising or falling) of this clock signal. Reference: http://www.plantation-productions.com/Webster/www.artofasm.com/Linux/HTML/ SystemOrganizationa4.html Rising Edge Falling Edge
  • 11. 11 Program Counter (a.k.a. Binary Counter)  With every falling edge or rising edge (depending upon processor) of clock signal, the counter is incremented by one.  Width varies from processor to processor  The contents of PC are used as target address for the memory area Microprocessor Memory Control Unit (CU) PC Data Buffer Memory Read Memory address Data from Memory Data Address Read Figure: Reading from memory
  • 12. Basic Instruction Cycle  Fetch  Decode  Execute  Fetch 1. Fetch an instruction from memory 2. Decode the instruction to determine the operation 3. Fetch data from memory if necessary  Execute 4. Perform the operation on the data 5. Store the result in memory if needed 12
  • 13. Contd..  Internal CPU Registers used in instruction cycle:  Program Counter (PC) = Address of instruction  Instruction Register (IR) = Instruction being executed  Accumulator (AC) = Temporary Storage 13
  • 14. Computer Components: Top Level View Contd.. 14
  • 15. Detailed Steps  Address in the Program Counter register  Program Counter (PC) holds address of next instruction to fetch  Fetch the instruction from the memory  Increment the Program Counter  Unless told otherwise  Instruction loaded into Instruction Register (IR)  Decode the type of instruction  Fetch the operands  Execute the instruction  Store the results 15
  • 16. Instruction Execution Cycle I-1 I-2 I-3 I-4 PC Program (RAM) I-1 Instruction Queue op1 op2 Data (RAM) fetch ALU registers store the output decode execute 16
  • 18. 18 Contd..  Instruction Fetch  Read instruction from memory into processor  Instruction Operation Decoding  Determine the type of operation to be performed and operand(s) to be used.  Operand Address Calculation  If operation involves reference to an operand in memory or I/O, then determine the address of operand.  Operand Fetch  Fetch from memory or read from I/O  Data Operation  Perform the operation  Operand Store  Write into memory or out to I/O if required

Editor's Notes