Implementing Instructions

Slides:



Advertisements
Similar presentations
The Fetch – Execute Cycle
Advertisements

Machine cycle.
Central Processing Unit
1  1998 Morgan Kaufmann Publishers We will be reusing functional units –ALU used to compute address and to increment PC –Memory used for instruction and.
CHAPTER 4 COMPUTER SYSTEM – Von Neumann Model
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
Memory - Registers Instruction Sets
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
Chapters 5 - The LC-3 LC-3 Computer Architecture Memory Map
1 Sec (2.3) Program Execution. 2 In the CPU we have CU and ALU, in CU there are two special purpose registers: 1. Instruction Register 2. Program Counter.
Overview von Neumann Model Components of a Computer Some Computer Organization Models The Computer Bus An Example Organization: The LC-3.
Design and Synthesis of a RISC Stored-Program Machine
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Science 210 Computer Organization The Instruction Execution Cycle.
Basic Operational Concepts of a Computer
Micro-operations Are the functional, or atomic, operations of a processor. A single micro-operation generally involves a transfer between registers, transfer.
Computer Science 210 Computer Organization The von Neumann Architecture.
1 Computer Organization Today: First Hour: Computer Organization –Section 11.3 of Katz’s Textbook –In-class Activity #1 Second Hour: Test Review.
Chapter 4 MARIE: An Introduction to a Simple Computer.
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
Model Computer CPU Arithmetic Logic Unit Control Unit Memory Unit
The structure COMPUTER ARCHITECTURE – The elementary educational computer.
Lecture 14 Today’s topics MARIE Architecture Registers Buses
Fetch-execute cycle.
Computer architecture
Dale & Lewis Chapter 5 Computing components
Question What technology differentiates the different stages a computer had gone through from generation 1 to present?
GROUP 2 CHAPTER 16 CONTROL UNIT Group Members ๏ Evelio L. Hernandez ๏ Ashwin Soerdien ๏ Andrew Keiper ๏ Hermes Andino.
Structure and Role of a Processor
Processor Organization and Architecture Module III.
Designing a CPU –Reading a programs instruction from memory –Decoding the instruction –Executing the instruction –Transferring Data to/From memory / IO.
Computer Organization Instructions Language of The Computer (MIPS) 2.
Central Processing Unit Decode Cycle. Central Processing Unit Current Instruction Register (CIR) I1 The fetch cycle has transferred an instruction from.
BASIC COMPUTER ARCHITECTURE HOW COMPUTER SYSTEMS WORK.
Types of Micro-operation  Transfer data between registers  Transfer data from register to external  Transfer data from external to register  Perform.
Functions of Processor Operation Addressing modes Registers i/o module interface Memory module interface Interrupts.
ECE 4110–5110 Digital System Design
Lecture 13 - Introduction to the Central Processing Unit (CPU)
Computer Science 210 Computer Organization
Micro-Operations A computer executes a program Fetch/execute cycle
Chapter 4 The Von Neumann Model
Five Execution Steps Instruction Fetch
William Stallings Computer Organization and Architecture
William Stallings Computer Organization and Architecture 7th Edition
Chapter 15 Control Unit Operation
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Design of the Control Unit for Single-Cycle Instruction Execution
The fetch-execute cycle
Chapter 4 The Von Neumann Model
Computer Science 210 Computer Organization
Functional Units.
Computer Organization and ASSEMBLY LANGUAGE
Design of the Control Unit for One-cycle Instruction Execution
Topic 6 LC-3.
MARIE: An Introduction to a Simple Computer
Systems Architecture I (CS ) Lecture 2: A Simplified Computer
William Stallings Computer Organization and Architecture 7th Edition
Multicycle Approach We will be reusing functional units
Chapter 14 Control Unit Operation
THE FETCH-EXECUTE CYCLE.
Chapter 4 The Von Neumann Model
The Von Neumann Architecture Odds and Ends
The Stored Program Computer
Information Representation: Machine Instructions
Objectives Describe common CPU components and their function: ALU Arithmetic Logic Unit), CU (Control Unit), Cache Explain the function of the CPU as.
Instruction execution and ALU
Computer Architecture
COMPUTER ARCHITECTURE
Presentation transcript:

Implementing Instructions

Machine Cycle Fetch Decode Execute

Architeture High level architecture

Detailed View Data/Address Paths Not shown: Control signals

Special Purpose Registers PC : Current Instruction Address IR : Current Instruction MAR : Address to get/store MBR : Data to get/store

RTN RTN : Register Transfer Notation [r1]  [r3] + [r2] r1 gets set to sum of values in r2 and r3 [PC]  [PC] + 4 PC gets set to sum of PC and 4 [r1]  [[MAR]] r1 gets set to the value in the memory location stored in MAR [ALU:P]  [r1] The P input of ALU gets the value stored in r1

Fetch Step 1 Copy PC to MAR [MAR]  [PC] Step to next instruction [PC]  [PC] + 4

Fetch Step 1 Copy PC to MAR [MAR]  [PC] Step to next instruction [PC]  [PC] + 4

Fetch Step 2 Retrieve Intruction from memory [MBR]  [[MAR]] 0x00001000 Retrieve Intruction from memory [MBR]  [[MAR]]

Fetch Step 2 Retrieve Intruction from memory [MBR]  [[MAR]] 0x00001000 Retrieve Intruction from memory [MBR]  [[MAR]] 0xE59F100C

Fetch Step 3 Put instruction in IR [IR]  [MBR] 0xE59F100C

Fetch Step 3 Put instruction in IR [IR]  [MBR] 0xE59F100C 0xE59F100C

Fetch Summary [MAR]  [PC] [PC]  [PC] + 4 [MBR]  [[MAR]] [IR]  [MBR]

Decode Control unit reads opcode, sets control lines 0xE59F100C

LDR Instruction represents: LDR r1, x 0xE59F100C

Execute LDR Step 1 Copy Operand part of IR to MAR [MAR]  [IR(Operands)] OR [MAR]  [IR(Address)] 0xE59F100C

Selecting MBR Source Any time two lines join, need a multiplexer:

Execute LDR Step 1 Copy Operand part of IR to MAR 0x100C Copy Operand part of IR to MAR [MAR]  [IR(Operands)] OR [MAR]  [IR(Address)] 0xE59F100C

Execute LDR Step 2 0x100C Get date from memory [MBR]  [[MAR]]

Execute LDR Step 2 0x100C Get date from memory [MBR]  [[MAR]] 5

Execute LDR Step 3 Store to register [r1]  [MBR] 5

Execute LDR Step 3 Store to register [r1]  [MBR] 5 5

LDR Summary [MAR]  [IR(Operands)] [MBR]  [[MAR]] [r1]  [MBR]

ADD Instruction represents: ADD r3, r1, r2 0xE0813002

ADD Step 1 Store to register [ALU:P]  [r1] [ALU:Q]  [r2] 4 3

ADD Step 1 Store to register [ALU:P]  [r1] [ALU:Q]  [r2] 4 3 4 3

ADD Step 2 Write result to register [r3]  [ALU:P] + [ALU:Q] OR [r3]  [r1] + [r2] 4 3

ADD Step 2 Write result to register [r3]  [ALU:P] + [ALU:Q] OR [r3]  [r1] + [r2] 7 4 3

ADD Summary [ALU:P]  [r1] [ALU:Q]  [r2] [r3]  [ALU:P] + [ALU:Q] OR [r3]  [r1] + [r2]

Immediates Instruction represents: MOV r2, #4 0xE3812004

Move Immediate Step 1 Move operand bits to r2 [r2]  [IR(Operands)] 0xE3820004

Move Immediate Step 1 Move operand bits to r2 [r2]  [IR(Operands)] 0xE3820004 0x0004

Add Immediate Instruction represents: ADD r2, r1, #4 0xE5210004 3

Add Immediate Step 1 Move immediate to Q Move r1 to P [ALU:Q]  [IR(Operands)] [ALU:P]  [r1] 0xE5210004 3

Add Immediate Step 1 Move immediate to Q Move r1 to P [ALU:Q]  [IR(Operands)] [ALU:P]  [r1] 0xE5210004 3 3 0x0004

Add Immediate Step 2 Store result to r3 [r2]  [ALU:P] + [ALU:Q] 3 0x0004

Add Immediate Step 2 Store result to r3 [r2]  [ALU:P] + [ALU:Q] 7 3 0x0004

Add Immediate Summary [ALU:Q]  [IR(Operands)] [ALU:P]  [r1] [r2]  [ALU:P] + [ALU:Q]

Branches Instruction represents BEQ foo Where foo is at 2024 0xEA612024

Branches EQ means Z(ero) flag is set If Z, set PC to 2024 0xEA612024

Branches Possibility 1 If Z, set PC to 2024 RTN: If [Z] = 1 THEN [PC]  [IR(Operands)] 0xEA612024 1010

Branches Possibility 1 If Z, set PC to 2024 RTN: If [Z] = 1 THEN [PC]  [IR(Operands)] 0x2024 0xEA612024 1010

Branches Possibility 2 If Z, set PC to 2024 RTN: If [Z] = 1 THEN [PC]  [IR(Operands)] 0xEA612024 0010