Computer Science 210 Computer Organization

Slides:



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

Chapter 4 The Von Neumann Model
Chapter 4 The Von Neumann Model
Chapter 5 The LC-3.
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
Chapter 5 The LC-3 LC-3 Computer Architecture Memory Map
Chapter 6 Programming in Machine Language The LC-3 Simulator
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
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.
Computer Science 210 Computer Organization The Instruction Execution Cycle.
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
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.
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.
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
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Computer Science 210 Computer Organization Machine Language Instructions: Control.
Control Unit Lecture 6.
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
COSC121: Computer Systems: Review
Chapter 4 The Von Neumann Model
Introduction to Computer Engineering
Chapter 4 The Von Neumann Model
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
Chapter 5 The LC-3.
The LC-3 Instruction Set Architecture Data Movement instructions
The Processor and Machine Language
Chapter 4 The Von Neumann Model
LC-3 Details and Examples
Computer Science 210 Computer Organization
Computer Science 210 Computer Organization
Chapter 5 The LC-3.
Design of the Control Unit for One-cycle Instruction Execution
Computer Science 210 Computer Organization
Introduction to Computer Engineering
Topic 6 LC-3.
The Von Neumann Model Basic components Instruction processing
Introduction to Computer Engineering
Instruction encoding We’ve already seen some important aspects of processor design. A datapath contains an ALU, registers and memory. Programmers and compilers.
Computer Architecture and the Fetch-Execute Cycle
The Little Man Computer
Sequencing, Selection, and Loops in Machine Language
Computer Architecture
Chapter 4 The Von Neumann Model
ECE 352 Digital System Fundamentals
The Stored Program Computer
Review: The whole processor
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 Create source code Translate to machine code Editor Compiler Translate to machine code Linker Add library code Loader Place code in appropriate memory locations Runtime System Execute code

Runtime System: Execution Cycle Memory (array of instructions) 0010011100111100 Fetch Load instruction from memory 1000011100110100 0000011100110100 0010011100110100 Decode Figure out what to do 0000011100110101 0100011100110100 Execute Do it 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 Opcode Operand(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 Format: Code: Add the contents of R2 and R6 and store the result in R6

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 Format: Code: Load the contents of memory at address (R3 + 6) into R2

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 Fetch Decode Decode Execute Evaluate address Fetch operands Execute operation Store result

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

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

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

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

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

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

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] Format: Code: Load the contents of R3 into the PC

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

Machine language instructions for calculations For Monday Machine language instructions for calculations