SlideShare une entreprise Scribd logo
1  sur  3
Télécharger pour lire hors ligne
Chapter 3.3 Computer Architecture and the Fetch-Execute Cycle

3.3 (a)        Von Neumann Architecture
John Von Neumann introduced the idea of the stored program. Previously data and
programs were stored in separate memories. Von Neumann realised that data and
programs are indistinguishable and can, therefore, use the same memory. This led to
the introduction of compilers which accepted text as input and produced binary code
as output.

The Von Neumann architecture uses a single processor which follows a linear
sequence of fetch-decode-execute. In order to do this, the processor has to use some
special registers. These are

                   Register         Meaning
                   PC               Program Counter
                   CIR              Current Instruction Register
                   MAR              Memory Address Register
                   MDR              Memory Data Register
                   Accumulator      Holds results

The program counter keeps track of where to find the next instruction so that a copy
of the instruction can be placed in the current instruction register. Sometimes the
program counter is called the Sequence Control Register (SCR) as it controls the
sequence in which instructions are executed.

The current instruction register holds the instruction that is to be executed.

The memory address register is used to hold the memory address that contains either
the next piece of data or an instruction that is to be used.

The memory data register acts like a buffer and holds anything that is copied from the
memory ready for the processor to use it.

The central processor contains the arithmetic-logic unit (also known as the arithmetic
unit) and the control unit. The arithmetic-logic unit (ALU) is where data is processed.
This involves arithmetic and logical operations. Arithmetic operations are those that
add and subtract numbers, and so on. Logical operations involve comparing binary
patterns and making decisions.

The control unit fetches instructions from memory, decodes them and synchronises
the operations before sending signals to other parts of the computer.

The accumulator is in the arithmetic unit, the program counter and the instruction
registers are in the control unit and the memory data register and memory address
register are in the processor.




                                           4.3 - 1
3.3 (b)        The Fetch-Decode-Execute-Reset Cycle
The following is an algorithm that shows the steps in the cycle. At the end the cycle
is reset and the algorithm repeated.

   1. Load the address that is in the program counter (PC) into the memory address
      register (MAR).
   2. Increment the PC by 1.
   3. Load the instruction that is in the memory address given by the MAR into the
      memory data register (MDR).
   4. Load the instruction that is now in the MDR into the current instruction
      register (CIR).
   5. Decode the instruction that is in the CIR.
   6. If the instruction is a jump instruction then
          a. Load the address part of the instruction into the PC
          b. Reset by going to step 1.
   7. Execute the instruction.
   8. Reset by going to step 1.

Steps 1 to 4 are the fetch part of the cycle. Steps 5, 6a and 7 are the execute part of
the cycle and steps 6b and 8 are the reset part.

Step 1 simply places the address of the next instruction into the memory address
register so that the control unit can fetch the instruction from the right part of the
memory. The program counter is then incremented by 1 so that it contains the address
of the next instruction, assuming that the instructions are in consecutive locations.

The memory data register is used whenever anything is to go from the central
processing unit to main memory, or vice versa. Thus the next instruction is copied
from memory into the MDR and is then copied into the current instruction register.

Now that the instruction has been fetched the control unit can decode it and decide
what has to be done. This is the execute part of the cycle. If it is an arithmetic
instruction, this can be executed and the cycle restarted as the PC contains the address
of the next instruction in order. However, if the instruction involves jumping to an
instruction that is not the next one in order, the PC has to be loaded with the address
of the instruction that is to be executed next. This address is in the address part of the
current instruction, hence the address part is loaded into the PC before the cycle is
reset and starts all over again.




                                           4.3 - 2
3.3 (c)        Parallel Processor Systems
Using the above architecture for a microprocessor illustrates that basically an
instruction can be in one of three phases. It could be being fetched (from memory),
decoded (by the control unit) or being executed (by the control unit). An alternative is
to split the processor up into three parts, each of which handles one of the three
stages. This would result in the situation shown in Fig. 3.3.c.1, which shows how this
process, known as pipelining, works.



                 Fetch                 Decode                  Execute
             Instruction 1

             Instruction 2           Instruction 1

             Instruction 3           Instruction 2           Instruction 1

             Instruction 4           Instruction 3           Instruction 2

             Instruction 5           Instruction 4           Instruction 3

                                      Fig. 3.3.c.1


The effect of pipe lining is that there are three instructions being dealt with at the
same time. This SHOULD reduce the execution times considerably (to approximately
1/3 of the standard times), however, this would only be true for a very linear program.
Once jump instructions are introduced the problem arises that the wrong instructions
are in the pipe line waiting to be executed, so every time the sequence of instructions
changes, the pipe line has to be cleared and the process started again.

Another type of computer architecture is to use many processors, each carrying out an
      individual instruction at the same time as its partners. This type of processing
      uses an architecture known as parallel processing, which involves many
      independent processors working in parallel on the same program. One of the
      difficulties with this is that the programs running on these systems need to
      have been written specially for them. If the programs have been written for
      standard architectures, then some instructions cannot be completed until
      others have been completed. Thus, checks have to be made to ensure that all
      prerequisites have been completed. However, these systems are in use
      particularly when systems are receiving many inputs from sensors and the data
      need to be processed in parallel.




                                         4.3 - 3

Contenu connexe

Tendances

Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycleMuhammad Ameer Mohavia
 
Central Processing Unit (CPU) – Part 2
Central Processing Unit (CPU) – Part 2Central Processing Unit (CPU) – Part 2
Central Processing Unit (CPU) – Part 2Ajeng Savitri
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organizationvishal choudhary
 
Structure And Role Of The Processor
Structure And Role Of The ProcessorStructure And Role Of The Processor
Structure And Role Of The Processorpy7rjs
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-stepsrsamurti
 
Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Ajeng Savitri
 
Coal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly ProgrammingCoal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly ProgrammingMuhammad Taqi Hassan Bukhari
 
Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cyclechantellemallia
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD) Ali Raza
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycleMkaur01
 
Processor structure and funtions
Processor structure and funtionsProcessor structure and funtions
Processor structure and funtionsMuhammad Ishaq
 
Computer Architecture - Program Execution
Computer Architecture - Program ExecutionComputer Architecture - Program Execution
Computer Architecture - Program ExecutionVarun Bhargava
 
Pipelining , structural hazards
Pipelining , structural hazardsPipelining , structural hazards
Pipelining , structural hazardsMunaam Munawar
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInteX Research Lab
 
Memory interleaving and superscalar processor
Memory interleaving and superscalar processorMemory interleaving and superscalar processor
Memory interleaving and superscalar processorsshwetasrivastava
 

Tendances (20)

Array Processor
Array ProcessorArray Processor
Array Processor
 
Parallel processing Concepts
Parallel processing ConceptsParallel processing Concepts
Parallel processing Concepts
 
Register Organization and Instruction cycle
Register Organization and Instruction cycleRegister Organization and Instruction cycle
Register Organization and Instruction cycle
 
Central Processing Unit (CPU) – Part 2
Central Processing Unit (CPU) – Part 2Central Processing Unit (CPU) – Part 2
Central Processing Unit (CPU) – Part 2
 
CO Module 5
CO Module 5CO Module 5
CO Module 5
 
Unit 4-input-output organization
Unit 4-input-output organizationUnit 4-input-output organization
Unit 4-input-output organization
 
Structure And Role Of The Processor
Structure And Role Of The ProcessorStructure And Role Of The Processor
Structure And Role Of The Processor
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-steps
 
Control Unit (CU) – Part 2
Control Unit (CU) – Part 2Control Unit (CU) – Part 2
Control Unit (CU) – Part 2
 
Aca 2
Aca 2Aca 2
Aca 2
 
Coal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly ProgrammingCoal 10 instruction cycle and interrupts in Assembly Programming
Coal 10 instruction cycle and interrupts in Assembly Programming
 
Memory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycleMemory & the fetch decode-execute cycle
Memory & the fetch decode-execute cycle
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Instruction set and instruction execution cycle
Instruction set and instruction execution cycleInstruction set and instruction execution cycle
Instruction set and instruction execution cycle
 
Processor structure and funtions
Processor structure and funtionsProcessor structure and funtions
Processor structure and funtions
 
Computer Architecture - Program Execution
Computer Architecture - Program ExecutionComputer Architecture - Program Execution
Computer Architecture - Program Execution
 
Cpu & its execution of instruction
Cpu & its execution of instructionCpu & its execution of instruction
Cpu & its execution of instruction
 
Pipelining , structural hazards
Pipelining , structural hazardsPipelining , structural hazards
Pipelining , structural hazards
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 
Memory interleaving and superscalar processor
Memory interleaving and superscalar processorMemory interleaving and superscalar processor
Memory interleaving and superscalar processor
 

En vedette

Proposed structure of pgdm marketing project
Proposed structure of pgdm marketing projectProposed structure of pgdm marketing project
Proposed structure of pgdm marketing projectManish Parihar
 
Amonika computer parts, computer parts marketing strategy, marketing
Amonika computer parts, computer parts marketing strategy, marketingAmonika computer parts, computer parts marketing strategy, marketing
Amonika computer parts, computer parts marketing strategy, marketingAjay Parmar
 
Computer Parts by Sarah & Serena
Computer Parts by Sarah & SerenaComputer Parts by Sarah & Serena
Computer Parts by Sarah & SerenaSue Pisano
 
Basic Parts of Computer
Basic Parts of ComputerBasic Parts of Computer
Basic Parts of ComputerDex Wasin
 
A PROJECT REPORT ON MARKETING RESEARCH
A PROJECT REPORT ON MARKETING RESEARCHA PROJECT REPORT ON MARKETING RESEARCH
A PROJECT REPORT ON MARKETING RESEARCHsanjay3017
 
Sample project -Marketing Management
Sample project -Marketing Management Sample project -Marketing Management
Sample project -Marketing Management Mamta Narula
 

En vedette (6)

Proposed structure of pgdm marketing project
Proposed structure of pgdm marketing projectProposed structure of pgdm marketing project
Proposed structure of pgdm marketing project
 
Amonika computer parts, computer parts marketing strategy, marketing
Amonika computer parts, computer parts marketing strategy, marketingAmonika computer parts, computer parts marketing strategy, marketing
Amonika computer parts, computer parts marketing strategy, marketing
 
Computer Parts by Sarah & Serena
Computer Parts by Sarah & SerenaComputer Parts by Sarah & Serena
Computer Parts by Sarah & Serena
 
Basic Parts of Computer
Basic Parts of ComputerBasic Parts of Computer
Basic Parts of Computer
 
A PROJECT REPORT ON MARKETING RESEARCH
A PROJECT REPORT ON MARKETING RESEARCHA PROJECT REPORT ON MARKETING RESEARCH
A PROJECT REPORT ON MARKETING RESEARCH
 
Sample project -Marketing Management
Sample project -Marketing Management Sample project -Marketing Management
Sample project -Marketing Management
 

Similaire à 3.3

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 ZAKTabsheer Hasan
 
Pipelining in Computer System Achitecture
Pipelining in Computer System AchitecturePipelining in Computer System Achitecture
Pipelining in Computer System AchitectureYashiUpadhyay3
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/AAbdul Munam
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnectionnoman yasin
 
Operating system
Operating systemOperating system
Operating systemraj732723
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2Naruin
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2ekul
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2Kyle
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data RepresentationNaruin
 

Similaire à 3.3 (20)

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
 
Pipelining in Computer System Achitecture
Pipelining in Computer System AchitecturePipelining in Computer System Achitecture
Pipelining in Computer System Achitecture
 
Bc0040
Bc0040Bc0040
Bc0040
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/A
 
Reconfigurable computing
Reconfigurable computingReconfigurable computing
Reconfigurable computing
 
Co notes3 sem
Co notes3 semCo notes3 sem
Co notes3 sem
 
Unit 2
Unit 2Unit 2
Unit 2
 
Unit 2
Unit 2Unit 2
Unit 2
 
Control unit
Control  unitControl  unit
Control unit
 
03. top level view of computer function & interconnection
03. top level view of computer function & interconnection03. top level view of computer function & interconnection
03. top level view of computer function & interconnection
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
1.prallelism
1.prallelism1.prallelism
1.prallelism
 
Pipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan ChowdhuryPipeline Computing by S. M. Risalat Hasan Chowdhury
Pipeline Computing by S. M. Risalat Hasan Chowdhury
 
Operating system
Operating systemOperating system
Operating system
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Hcs Topic 2 Computer Structure V2
Hcs Topic 2  Computer Structure V2Hcs Topic 2  Computer Structure V2
Hcs Topic 2 Computer Structure V2
 
Topic 1 Data Representation
Topic 1 Data RepresentationTopic 1 Data Representation
Topic 1 Data Representation
 
Spr ch-01
Spr ch-01Spr ch-01
Spr ch-01
 

Plus de Samimvez

Plus de Samimvez (20)

Sql installation tutorial
Sql installation tutorialSql installation tutorial
Sql installation tutorial
 
Example3
Example3Example3
Example3
 
Coms1010 exam paper - nov10
Coms1010   exam paper - nov10Coms1010   exam paper - nov10
Coms1010 exam paper - nov10
 
Coms1010 exam paper - may 08
Coms1010   exam paper - may 08Coms1010   exam paper - may 08
Coms1010 exam paper - may 08
 
Example2
Example2Example2
Example2
 
Labsheet 3
Labsheet 3Labsheet 3
Labsheet 3
 
Labsheet 3,5
Labsheet 3,5Labsheet 3,5
Labsheet 3,5
 
EQ V3x
EQ V3xEQ V3x
EQ V3x
 
Eq v2
Eq v2Eq v2
Eq v2
 
3.6
3.63.6
3.6
 
3.2
3.23.2
3.2
 
3.10
3.103.10
3.10
 
3.1
3.13.1
3.1
 
3.8
3.83.8
3.8
 
3.4
3.43.4
3.4
 
3.7
3.73.7
3.7
 
3.5
3.53.5
3.5
 
3.9
3.93.9
3.9
 
Nov 05 P3
Nov 05 P3Nov 05 P3
Nov 05 P3
 
June 02 MS2
June 02 MS2June 02 MS2
June 02 MS2
 

3.3

  • 1. Chapter 3.3 Computer Architecture and the Fetch-Execute Cycle 3.3 (a) Von Neumann Architecture John Von Neumann introduced the idea of the stored program. Previously data and programs were stored in separate memories. Von Neumann realised that data and programs are indistinguishable and can, therefore, use the same memory. This led to the introduction of compilers which accepted text as input and produced binary code as output. The Von Neumann architecture uses a single processor which follows a linear sequence of fetch-decode-execute. In order to do this, the processor has to use some special registers. These are Register Meaning PC Program Counter CIR Current Instruction Register MAR Memory Address Register MDR Memory Data Register Accumulator Holds results The program counter keeps track of where to find the next instruction so that a copy of the instruction can be placed in the current instruction register. Sometimes the program counter is called the Sequence Control Register (SCR) as it controls the sequence in which instructions are executed. The current instruction register holds the instruction that is to be executed. The memory address register is used to hold the memory address that contains either the next piece of data or an instruction that is to be used. The memory data register acts like a buffer and holds anything that is copied from the memory ready for the processor to use it. The central processor contains the arithmetic-logic unit (also known as the arithmetic unit) and the control unit. The arithmetic-logic unit (ALU) is where data is processed. This involves arithmetic and logical operations. Arithmetic operations are those that add and subtract numbers, and so on. Logical operations involve comparing binary patterns and making decisions. The control unit fetches instructions from memory, decodes them and synchronises the operations before sending signals to other parts of the computer. The accumulator is in the arithmetic unit, the program counter and the instruction registers are in the control unit and the memory data register and memory address register are in the processor. 4.3 - 1
  • 2. 3.3 (b) The Fetch-Decode-Execute-Reset Cycle The following is an algorithm that shows the steps in the cycle. At the end the cycle is reset and the algorithm repeated. 1. Load the address that is in the program counter (PC) into the memory address register (MAR). 2. Increment the PC by 1. 3. Load the instruction that is in the memory address given by the MAR into the memory data register (MDR). 4. Load the instruction that is now in the MDR into the current instruction register (CIR). 5. Decode the instruction that is in the CIR. 6. If the instruction is a jump instruction then a. Load the address part of the instruction into the PC b. Reset by going to step 1. 7. Execute the instruction. 8. Reset by going to step 1. Steps 1 to 4 are the fetch part of the cycle. Steps 5, 6a and 7 are the execute part of the cycle and steps 6b and 8 are the reset part. Step 1 simply places the address of the next instruction into the memory address register so that the control unit can fetch the instruction from the right part of the memory. The program counter is then incremented by 1 so that it contains the address of the next instruction, assuming that the instructions are in consecutive locations. The memory data register is used whenever anything is to go from the central processing unit to main memory, or vice versa. Thus the next instruction is copied from memory into the MDR and is then copied into the current instruction register. Now that the instruction has been fetched the control unit can decode it and decide what has to be done. This is the execute part of the cycle. If it is an arithmetic instruction, this can be executed and the cycle restarted as the PC contains the address of the next instruction in order. However, if the instruction involves jumping to an instruction that is not the next one in order, the PC has to be loaded with the address of the instruction that is to be executed next. This address is in the address part of the current instruction, hence the address part is loaded into the PC before the cycle is reset and starts all over again. 4.3 - 2
  • 3. 3.3 (c) Parallel Processor Systems Using the above architecture for a microprocessor illustrates that basically an instruction can be in one of three phases. It could be being fetched (from memory), decoded (by the control unit) or being executed (by the control unit). An alternative is to split the processor up into three parts, each of which handles one of the three stages. This would result in the situation shown in Fig. 3.3.c.1, which shows how this process, known as pipelining, works. Fetch Decode Execute Instruction 1 Instruction 2 Instruction 1 Instruction 3 Instruction 2 Instruction 1 Instruction 4 Instruction 3 Instruction 2 Instruction 5 Instruction 4 Instruction 3 Fig. 3.3.c.1 The effect of pipe lining is that there are three instructions being dealt with at the same time. This SHOULD reduce the execution times considerably (to approximately 1/3 of the standard times), however, this would only be true for a very linear program. Once jump instructions are introduced the problem arises that the wrong instructions are in the pipe line waiting to be executed, so every time the sequence of instructions changes, the pipe line has to be cleared and the process started again. Another type of computer architecture is to use many processors, each carrying out an individual instruction at the same time as its partners. This type of processing uses an architecture known as parallel processing, which involves many independent processors working in parallel on the same program. One of the difficulties with this is that the programs running on these systems need to have been written specially for them. If the programs have been written for standard architectures, then some instructions cannot be completed until others have been completed. Thus, checks have to be made to ensure that all prerequisites have been completed. However, these systems are in use particularly when systems are receiving many inputs from sensors and the data need to be processed in parallel. 4.3 - 3