Composing the Elements

Slides:



Advertisements
Similar presentations
The Processor: Datapath & Control
Advertisements

Processor II CPSC 321 Andreas Klappenecker. Midterm 1 Tuesday, October 5 Thursday, October 7 Advantage: less material Disadvantage: less preparation time.
331 Lec 14.1Fall 2002 Review: Abstract Implementation View  Split memory (Harvard) model - single cycle operation  Simplified to contain only the instructions:
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.
The Processor 2 Andreas Klappenecker CPSC321 Computer Architecture.
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.
©UCB CS 161Computer Architecture Chapter 5 Instructor: L.N. Bhuyan LECTURE 10.
The Processor: Datapath & Control. Implementing Instructions Simplified instruction set memory-reference instructions: lw, sw arithmetic-logical instructions:
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.
COSC 3430 L08 Basic MIPS Architecture.1 COSC 3430 Computer Architecture Lecture 08 Processors Single cycle Datapath PH 3: Sections
Computer Organization CS224 Fall 2012 Lesson 26. Summary of Control Signals addsuborilwswbeqj RegDst ALUSrc MemtoReg RegWrite MemWrite Branch Jump ExtOp.
Chapter 4 CSF 2009 The processor: Building the datapath.
Processor: Datapath and Control
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /19/2013 Lecture 17: The Processor - Overview Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Datapath Design Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Composing the Elements First-cut data path does an instruction.
Computer Architecture and Design – ECEN 350 Part 6 [Some slides adapted from A. Sprintson, M. Irwin, D. Paterson and others]
1 A single-cycle MIPS processor  An instruction set architecture is an interface that defines the hardware operations which are available to software.
MIPS processor continued. In Class Exercise Question Show the datapath of a processor that supports only R-type and jr reg instructions.
Chapter 4 From: Dr. Iyad F. Jafar Basic MIPS Architecture: Single-Cycle Datapath and Control.
MIPS processor continued
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.
MIPS Processor.
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
CS Computer Architecture Week 10: Single Cycle Implementation
Single Cycle CPU - Control
Multi-Cycle Datapath and Control
CS161 – Design and Architecture of Computer Systems
Single-Cycle Datapath and Control
Computer Architecture
Morgan Kaufmann Publishers
Introduction CPU performance factors
Morgan Kaufmann Publishers The Processor
Morgan Kaufmann Publishers
Processor Architecture: Introduction to RISC Datapath (MIPS and Nios II) CSCE 230.
Morgan Kaufmann Publishers The Processor
Processor (I).
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for Single-Cycle Instruction Execution
MIPS processor continued
Designing MIPS Processor (Single-Cycle) Presentation G
CSCI206 - Computer Organization & Programming
CS/COE0447 Computer Organization & Assembly Language
Single-Cycle CPU DataPath.
CS/COE0447 Computer Organization & Assembly Language
Design of the Control Unit for One-cycle Instruction Execution
CSCI206 - Computer Organization & Programming
MIPS Processor.
Datapath & Control MIPS
Topic 5: Processor Architecture Implementation Methodology
Rocky K. C. Chang 6 November 2017
Composing the Elements
The Processor Lecture 3.2: Building a Datapath with Control
Topic 5: Processor Architecture
COSC 2021: Computer Organization Instructor: Dr. Amir Asif
Lecture 14: Single Cycle MIPS Processor
Single Cycle Datapath Lecture notes from MKP, H. H. Lee and S. Yalamanchili.
Data Path Diagrams.
MIPS processor continued
CS/COE0447 Computer Organization & Assembly Language
Control Unit (single cycle implementation)
The Processor: Datapath & Control.
COMS 361 Computer Organization
MIPS Processor.
Processor: Datapath and Control
CS/COE0447 Computer Organization & Assembly Language
Presentation transcript:

Composing the Elements First-cut data path does an instruction in one clock cycle - Each datapath element can only do one function at a time - Hence, we need separate instruction and data memories Use multiplexers where alternate data sources are used for different instructions CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

R-Type/Load/Store Datapath How would this execute: add $s0, $s1, $s2; 100000 00000 10000 10010 10001 000000 funct shamt rd rt rs op CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

R-Type Execution 100000 00000 10000 00011 10001 000000 funct shamt rd rt rs op Reg #s for $s1 and $s2 are input to the register file's read register ports. Values from $s1 and $s2 are fetched and passed to ALU (ALUSrc set to 0 by Control). Low 16 bits from instruction are fed to the Sign-extend logic… irrelevant. CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

R-Type Execution 100000 00000 10000 00011 10001 000000 funct shamt rd rt rs op ALU computes sum of operands (ALU operation control set by Control). ALU output tranferred to MUX, set to pass through input 0 by Control. CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

R-Type Execution 100000 00000 10000 00011 10001 000000 funct shamt rd rt rs op Reg# for $s0 is input to register file write register port. ALU output transferred to register file Write data port. RegWrite control line set by Control. CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

R-Type/Load/Store Datapath How would this execute: lw $s0, 16($s1); 0000 0000 0010 0000 10001 10000 100011 16-bit number rt rs op QTP Alert!! CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Full Datapath How would this execute: beq $s0, $s1, Label0; QTP Alert!! CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Simplified ALU Design Here's a simplified ALU for 4-bit operands that illustrates the control interface we need: Effectively, this ALU has a 4-bit control mechanism for selecting the desired function. InvA InvB FnSel ALU Fn 00 AND 01 OR 10 add 1 sub 11 slt NOR CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

ALU Control ALU used for - Load/Store F = add - Branch F = subtract - R-type F depends on funct field InvA InvB FnSel ALU Fn 00 AND 01 OR 10 add 1 sub 11 slt NOR CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

ALU Control Assume 2-bit control signal ALUOp derived from opcode - Combinational logic derives ALU control opcode ALUOp Operation funct ALU function ALU control lw 00 load word XXXXXX add 0010 sw store word beq 01 branch equal subtract 0110 R-type 10 100000 100010 AND 100100 0000 OR 100101 0001 set-on-less-than 101010 0111 ALU Control CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

write for R-type and load The Main Control Unit Control signals derived from instruction R-type rs rt rd shamt funct 31:26 5:0 25:21 20:16 15:11 10:6 write for R-type and load Load/ Store 35 or 43 rs rt address 31:26 25:21 20:16 15:0 sign-extend and add 4 rs rt address 31:26 25:21 20:16 15:0 Branch opcode always read read, except for load CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Datapath With Control CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Datapath Control Signals RegDst selects instruction bits for write register # Branch 1 iff instruction is beq MemRead 1 iff memory location is to be read MemtoReg selects source for write data port ALUOp specifies instruction class to ALU control MemWrite 1 iff memory location is to be written ALUSrc selects source for 2nd operand to ALU RegWrite 1 iff register is to be written CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Main Control Truth Table The bottom portion of the table gives the outputs for each of the four opcodes. If we consider only the four opcodes shown in this table, then we can simplify the truth table by using don’t cares in the input portion. For example, we can detect an R-format instruction with the expression Op5 || Op2, since this is sufficient to distinguish the R-format instructions from lw, sw, and beq. We do not take advantage of this simplification, since the rest of the MIPS opcodes are used in a full implementation. CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Relevancies for R-Type Instruction CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Relevancies for Load Instruction CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Relevancies for beq Instruction CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Implementing Jumps 2 address Jump Jump uses word address 31:26 25:0 Jump uses word address Update PC with concatenation of - Top 4 bits of old PC - 26-bit jump address - 00 Need an extra control signal decoded from opcode CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Datapath With Jumps Added CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens

Performance Issues Longest delay determines clock period - Critical path: load instruction - Instruction memory  register file  ALU  data memory  register file Not feasible to vary period for different instructions Violates design principle - Making the common case fast We will improve performance by pipelining CS@VT August 2009 ©2006-09 McQuain, Feng & Ribbens