CS/COE0447 Computer Organization & Assembly Language

Slides:



Advertisements
Similar presentations
CS/COE1541: Introduction to Computer Architecture Datapath and Control Review Sangyeun Cho Computer Science Department University of Pittsburgh.
Advertisements

Pipeline Example: cycle 1 lw R10,9(R1) sub R11,R2, R3 and R12,R4, R5 or R13,R6, R7.
The Processor: Datapath & Control
Chapter 5 The Processor: Datapath and Control Basic MIPS Architecture Homework 2 due October 28 th. Project Designs due October 28 th. Project Reports.
ENEE350 Ankur Srivastava University of Maryland, College Park Based on Slides from Mary Jane Irwin ( )
Computer Structure - Datapath and Control Goal: Design a Datapath  We will design the datapath of a processor that includes a subset of the MIPS instruction.
Copyright 1998 Morgan Kaufmann Publishers, Inc. All rights reserved. Digital Architectures1 Machine instructions execution steps (1) FETCH = Read the instruction.
The Datapath Andreas Klappenecker CPSC321 Computer Architecture.
331 W10.1Spring :332:331 Computer Architecture and Assembly Language Spring 2005 Week 10 Building a Multi-Cycle Datapath [Adapted from Dave Patterson’s.
Datapath and Control Andreas Klappenecker CPSC321 Computer Architecture.
CSE431 L05 Basic MIPS Architecture.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 05: Basic MIPS Architecture Review Mary Jane Irwin.
Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
Chapter 4 Sections 4.1 – 4.4 Appendix D.1 and D.2 Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
Supplementary notes for pipelining LW ____,____ SUB ____,____,____ BEQ ____,____,____ ; assume that, condition for branch is not satisfied OR ____,____,____.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
CPE232 Basic MIPS Architecture1 Computer Organization Multi-cycle Approach Dr. Iyad Jafar Adapted from Dr. Gheith Abandah slides
1 CS/COE0447 Computer Organization & Assembly Language Multi-Cycle Execution.
CS2100 Computer Organisation
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
ECE-C355 Computer Structures Winter 2008 The MIPS Datapath Slides have been adapted from Prof. Mary Jane Irwin ( )
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
PC Instruction Memory Address Instr. [31-0] 4 Fig 4.6 p 309 Instruction Fetch.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2.
Datapath and Control AddressInstruction Memory Write Data Reg Addr Register File ALU Data Memory Address Write Data Read Data PC Read Data Read Data.
COM181 Computer Hardware Lecture 6: The MIPs CPU.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Multi-Cycle Datapath and Control.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 3 In-Class Exercises.
Computer Architecture Lecture 6.  Our implementation of the MIPS is simplified memory-reference instructions: lw, sw arithmetic-logical instructions:
Single-cycle CPU Control
Access the Instruction from Memory
EE204 Computer Architecture
Single Cycle CPU - Control
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
Chapter 5: A Multi-Cycle CPU.
CS 230: Computer Organization and Assembly Language
Single-Cycle Datapath and Control
Computer Architecture
Multi-Cycle CPU.
ECS 154B Computer Architecture II Spring 2009
Basic MIPS Architecture
CS/COE0447 Computer Organization & Assembly Language
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
CS/COE0447 Computer Organization & Assembly Language
Systems Architecture II
Datapath & Control MIPS
Chapter Five The Processor: Datapath and Control
Topic 5: Processor Architecture Implementation Methodology
Composing the Elements
Composing the Elements
The Processor Lecture 3.3: Single-cycle Implementation
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Processor: Multi-Cycle Datapath & Control
CS/COE0447 Computer Organization & Assembly Language
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
Control Unit (single cycle implementation)
The Processor: Datapath & Control.
COMS 361 Computer Organization
Processor: Datapath and Control
CS161 – Design and Architecture of Computer Systems
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

CS/COE0447 Computer Organization & Assembly Language Chapter 5 Part 2

Fig 5.17

Control Unit Implements (in hardware) an if statement: If opcode == 000000 # r-type instruction MemWrite = 0 MemRead = 0 MemToReg = 0 … # values assigned for all the control unit’s output signals Elif opcode == 0x23 # lw MemRead = 1 MemToReg = 1 … Elif opcode == 0x4 # beq MemToReg = X # don’t care … # an Elif test for each opcode

Examples In Lab 10, you did examples for an R-type instruction and for sw Now, let’s look at examples for beq and lw

Instruction Execution (reminder) beq Fetch instruction and add 4 to PC beq $t0,$t1,L Assume that L is +3 instructions away Read two source registers $t0,$t1 Sign Extend the immediate, and shift it left by 2 0x0003  0x0000000c Perform the test, and update the PC if it is true If $t0 == $t1, the PC = PC + 0x0000000c [we will follow what Mars does, so this is not Immediate == 0x0002; PC = PC + 4 + 0x00000008]

Fig 5.17 0x10010000: beq $t0,$t1,L L == 1001000c; $t0 = 4; $t1 = 4 0x1001000c 0x10010004 0x10010000 MARS 0x1001000c X 0x0000000c 1 1 000100 later 01000 4 1 X 01001 4 00000 4 Sub 0x0003 0x00000003 000011

lw r8,32(r18) r18 = 1000; M[1032] = 0x11223344 (PC+4) (PC+4) Branch=0 35 RegWrite (PC+4) 18 1000 8 0x11223344 RegDest=0 ALUSrc=1 8 1032 MemtoReg=1 32 0x11223344 32 32 MemRead 0x11223344

Control Signal Table Fig 5.18 Now let’s understand these, and the other ALU signals Figure 5.18 shows the control-signal information for Fig 5.17. Figure 5.16 describes each of these signals, with one mistake: “PCSrc” in 5.16 should be “Branch”

Fig 5.17 Actual operation of ALU Input based on opcode Input from funct field of instruction

Fig 5.17 lw,sw: add; beq: sub; R-inst: depends on funct ALUOp1 ALUOp0 Funct = 0x20 for add; 0x22 for sub; 0x24 for and; etc.

ALU Control ALU control input (3 bits) (page 301) 000: AND 001: OR 010: ADD 110: SUB 111: SET-IF-LESS-THAN (similar to SUB) On the diagram (next slide)

Fig 5.17 p. 301: 000:and 001:or 010:add 110:sub 111:slt Actual operation of ALU

ALU Control (figure 5.12) Next slide: just the truth table values

ALU Control Unit Truth Table Fig 5.13 Output from ALU control unit [input to ALU itself] Input to ALU control unit

Fig 5.17 p. 301: 000:and 001:or 010:add 110:sub 111:slt Output Inputs

Control Unit Design Control Unit ALU Control Unit Trace through pieces of this logic: in lecture

Fig 5.17 RegDst = 1 if opcode is 000000.

ALU Control (figure 5.12)

Datapath w/ Jump Fig 5.24

Transition to Multi-Cycle Control So far in Chapter 5: ideas of functional units, datapath, control. We’ll continue to use these ideas… But so far, all instructions take a single cycle It turns out that this is too inefficient

What We Have Now Fig 5.24

Functional Units Used

Single-Cycle Execution Timing (in pico-seconds)

Single-Cycle Exe. Problem The cycle time depends on the most time-consuming instruction What happens if we implement a more complex instruction, e.g., a floating-point mult. All resources are simultaneously active – there is no sharing of resources Multi-cycle solution Use a faster clock Allow a different number of clock cycles per instruction

A Multi-cycle Datapath A single memory unit for both instructions and data Single ALU rather than ALU & two adders Registers added after every major functional unit to hold the output until it is used in a subsequent clock cycle

Multi-cycle Approach Reusing functional units Break up instruction execution into smaller steps We’ll need more and expanded MUX’s At the end of a cycle, keep results in registers So, registers are added to the datapath Now, control signals are NOT solely determined by the instruction bits, but they also depend on which cycle it is Controls will be generated by a finite state machine