Computer Science 210 Computer Organization The Instruction Execution Cycle.

Slides:



Advertisements
Similar presentations
Processor Data Path and Control Diana Palsetia UPenn
Advertisements

The Fetch – Execute Cycle
Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Chapter 5 The LC-3.
Chapter 4 - ISA 1.The Von Neumann Model. 4-2 The Stored Program Computer 1943: ENIAC Presper Eckert and John Mauchly -- first general electronic computer.
LC-3 Computer LC-3 Instructions
S. Barua – CPSC 240 CHAPTER 5 THE LC-3 Topics Memory organization Registers Instruction set Opcodes.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
LC-3 Instruction Set Architecture (Textbook’s Chapter 5)
LC-3 Architecture Patt and Patel Ch. 4 1.
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter 6 Programming in Machine Language The LC-3 Simulator
Overview The von Neumann Machine - the programmable digital computer Introducing the LC-3 Computer - A “toy” computer for us to learn from Computer machine.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
LC-3 Instruction Set Architecture
Chapters 4 & 5: LC-3 Computer Architecture Machine Instructions Assembly language Programming in Machine and Assembly Language.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Chapter 5 The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Computer Science 210 Computer Organization The von Neumann Architecture.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 4 The Von Neumann Model Basic components Instruction processing.
CPU Design. Introduction – The CPU must perform three main tasks: Communication with memory – Fetching Instructions – Fetching and storing data Interpretation.
Chapter 4 The Von Neumann Model
The von Neumann Model – Chapter 4
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Introduction to Computer Engineering CS/ECE 252, Fall 2009 Prof. Mark D. Hill Computer Sciences Department University of Wisconsin – Madison.
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
Introduction to Computer Engineering ECE/CS 252, Fall 2010 Prof. Mikko Lipasti Department of Electrical and Computer Engineering University of Wisconsin.
The LC-3. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 5-2 Instruction Set Architecture ISA = All of the.
Chapter 5 The LC Instruction Set Architecture ISA = All of the programmer-visible components and operations of the computer memory organization.
Fetch-execute cycle.
Represents different voltage levels High: 5 Volts Low: 0 Volts At this raw level a digital computer is instructed to carry out instructions.
The von Neumann Model – Chapter 4 COMP 2620 Dr. James Money COMP
Dale & Lewis Chapter 5 Computing components
© BYU LC3-DC Page 1 ECEn 224 LC3-DC Designing The LC-3 Control IR PC enaMARMenaPC enaALU enaMDR ALU AB.
Von Neumann Model Computer Organization I 1 September 2009 © McQuain, Feng & Ribbens The Stored Program Computer 1945: John von Neumann –
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
Chapter 4 The Von Neumann Model
Introduction to Computing Systems and Programming The LC-2.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Science 210 Computer Organization Machine Language Instructions: Control.
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
The Processor and Machine Language
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Design of the Control Unit for One-cycle Instruction Execution
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Topic 6 LC-3.
Introduction to Computer Engineering
The Little Man Computer
Sequencing, Selection, and Loops in Machine Language
Computer Architecture
Chapter 4 The Von Neumann Model
The Stored Program Computer
Program Execution.
Basic components Instruction processing
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
Presentation transcript:

Computer Science 210 Computer Organization The Instruction Execution Cycle

Program Development Compiler Linker Loader Runtime System Editor Translate to machine code Add library code Place code in appropriate memory locations Execute code Create source code

Runtime System: Execution Cycle Fetch Decode Execute Load instruction from memory Figure out what to do Do it Memory (array of instructions) This cycle repeats until a HALT instruction is reached

A Machine Language Instruction Specifies an opcode and one or more operands The control unit interprets the sequence of bits and sends a sequence of control signals to other units OpcodeOperand(s)

Example: LC-3 ADD Instruction Each instruction has a four-bit opcode in bits [15:12] This instruction also specifies two source registers and one destination register Add the contents of R2 and R6 and store the result in R6 Format: Code:

LDR (Load Data Relative) Instruction Sign-extend the Offset value to 16 bits, add it to the contents of the Base register, and load the datum at the resulting memory address into the Dst register Load the contents of memory at address (R3 + 6) into R2 Format: Code:

The LC-3 Instruction Set (page 119) 4 bits per opcode, 16 distinct opcodes But some instructions share an opcode Example: So, actually 20 distinct instructions ADD DR SR1 SR2, when bit 5 is clear ADD DR SR1 IR[4:0], when bit 5 is set

Types of Instructions Computation: ADD, AND, etc. Data movement: LDR, etc. Control: BR, JMP, JSR, etc. Complete set in Table 5.3, page 119 of text

Detailed View of Instruction Processing Fetch Decode Execute Fetch Decode Evaluate address Fetch operands Execute operation Store result

Instruction Processing: Fetch Fetch Decode Evaluate address Fetch operands Execute operation Store result Load next instruction into IR from memory at address in PC: Then increment address in PC MAR = PC Send read signal to memory IR = MDR

Instruction Processing: Decode Fetch Decode Evaluate address Fetch operands Execute operation Store result Identify the opcode: Depending on the opcode, identify the other operands from the remaining bits Bits [15:12] in LC-3 4-to-16 decoder asserts a control line For the first ADD, bits [11:9] = Destination register bits [8:6] = Source register 1 bits [2:0] = Source register 2

Instruction Processing: Evaluate Address Fetch Decode Evaluate address Fetch operands Execute operation Store result For instructions with memory access, compute the address used for access Add offset to base register Add offset to PC Add offset to zero Etc.

Instruction Processing: Fetch Operands Fetch Decode Evaluate address Fetch operands Execute operation Store result Obtain the operands needed for the operation Load data from memory (LDR) Read data from register file (ADD) Etc.

Fetch Decode Evaluate address Fetch operands Execute operation Store result Perform the operation using the operands Send operands to ALU and assert the ADD signal Do nothing (for LOAD and STORE) Etc. Instruction Processing: Execute Operation

Instruction Processing: Store Result Fetch Decode Evaluate address Fetch operands Execute operation Store result Write results to destination (register or memory): Write address to MAR Write data to MDR Assert write signal to memory To destination register (ADD, LDR) For STORE instruction,

Changing the Sequence of Instructions Fetch increments the PC by 1 Loops, if-statements, procedure calls don’t do this Control instructions modify the PC directly –Jumps: unconditional, always taken –Branches: conditional, depend on contents of status registers

The JMP Instruction Set the PC to the address contained in a register This register is specified in IR[8:6] Load the contents of R3 into the PC Format: Code:

The Control Unit The control unit is a finite state machine; a simplified view:

Stopping the Computer As long as the clock is running, the execution cycle continues If not processing instructions in your program, it’s processing instructions in the OS To stop: AND the generator signal with 0