ECE232: Hardware Organization and Design

Similar documents
COMPUTER ORGANIZATION AND DESIGN. The Hardware/Software Interface. Chapter 4. The Processor: A Based on P&H

Processor (I) - datapath & control. Hwansoo Han

Chapter 4. The Processor

Systems Architecture

Chapter 4. The Processor

The Processor: Datapath and Control. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

The Processor (1) Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Chapter 4. The Processor. Computer Architecture and IC Design Lab

Chapter 4. The Processor. Instruction count Determined by ISA and compiler. We will examine two MIPS implementations

Chapter 4. The Processor Designing the datapath

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Chapter 4. Instruction Execution. Introduction. CPU Overview. Multiplexers. Chapter 4 The Processor 1. The Processor.

COMPUTER ORGANIZATION AND DESIGN. 5 th Edition. The Hardware/Software Interface. Chapter 4. The Processor

Lecture Topics. Announcements. Today: Single-Cycle Processors (P&H ) Next: continued. Milestone #3 (due 2/9) Milestone #4 (due 2/23)

ELEC 5200/6200 Computer Architecture and Design Spring 2017 Lecture 4: Datapath and Control

The Processor. Z. Jerry Shi Department of Computer Science and Engineering University of Connecticut. CSE3666: Introduction to Computer Architecture

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Single Cycle Datapath

Single Cycle Datapath

Chapter 4. The Processor

Introduction. Datapath Basics

TDT4255 Computer Design. Lecture 4. Magnus Jahre. TDT4255 Computer Design

Chapter 4. The Processor

LECTURE 5. Single-Cycle Datapath and Control

COMPUTER ORGANIZATION AND DESIGN

Systems Architecture I

Adding Support for jal to Single Cycle Datapath (For More Practice Exercise 5.20)

EECS150 - Digital Design Lecture 10- CPU Microarchitecture. Processor Microarchitecture Introduction

ECE260: Fundamentals of Computer Engineering

The MIPS Processor Datapath

Review: Abstract Implementation View

EECS150 - Digital Design Lecture 9- CPU Microarchitecture. Watson: Jeopardy-playing Computer

Chapter 4 The Processor 1. Chapter 4A. The Processor

COMPUTER ORGANIZATION AND DESIGN The Hardware/Software Interface. 5 th. Edition. Chapter 4. The Processor

ENGN1640: Design of Computing Systems Topic 04: Single-Cycle Processor Design

Laboratory 5 Processor Datapath

Processor: Multi- Cycle Datapath & Control

Introduction. Chapter 4. Instruction Execution. CPU Overview. University of the District of Columbia 30 September, Chapter 4 The Processor 1

CENG 3420 Lecture 06: Datapath

CPU Organization (Design)

Lecture 10: Simple Data Path

Full Datapath. CSCI 402: Computer Architectures. The Processor (2) 3/21/19. Fengguang Song Department of Computer & Information Science IUPUI

Single Cycle CPU Design. Mehran Rezaei

CC 311- Computer Architecture. The Processor - Control

COMPUTER ORGANIZATION AND DESIGN

CPE 335 Computer Organization. Basic MIPS Architecture Part I

COMP303 - Computer Architecture Lecture 8. Designing a Single Cycle Datapath

ECE369. Chapter 5 ECE369

Data paths for MIPS instructions

The Processor: Datapath & Control

CSEN 601: Computer System Architecture Summer 2014

CENG 3420 Computer Organization and Design. Lecture 06: MIPS Processor - I. Bei Yu

Lecture 4: Review of MIPS. Instruction formats, impl. of control and datapath, pipelined impl.

CS3350B Computer Architecture Quiz 3 March 15, 2018

LECTURE 3: THE PROCESSOR

ENE 334 Microprocessors

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

Laboratory Single-Cycle MIPS CPU Design (3): 16-bits version One clock cycle per instruction

Design of the MIPS Processor

COMP303 Computer Architecture Lecture 9. Single Cycle Control

Lecture 8: Control COS / ELE 375. Computer Architecture and Organization. Princeton University Fall Prof. David August

Computer and Information Sciences College / Computer Science Department The Processor: Datapath and Control

ECE 486/586. Computer Architecture. Lecture # 7

Chapter 5: The Processor: Datapath and Control

CSE 378 Midterm 2/12/10 Sample Solution

Fundamentals of Computer Systems

CSCI 402: Computer Architectures. Fengguang Song Department of Computer & Information Science IUPUI. Today s Content

Processor. Han Wang CS3410, Spring 2012 Computer Science Cornell University. See P&H Chapter , 4.1 4

Unsigned Binary Integers

Unsigned Binary Integers

361 datapath.1. Computer Architecture EECS 361 Lecture 8: Designing a Single Cycle Datapath

Lecture 5: The Processor

Design of Digital Circuits 2017 Srdjan Capkun Onur Mutlu (Guest starring: Frank K. Gürkaynak and Aanjhan Ranganathan)

RISC Processor Design

LECTURE 6. Multi-Cycle Datapath and Control

CSE 2021 COMPUTER ORGANIZATION

ECE260: Fundamentals of Computer Engineering

Computer Organization and Structure

EECS 151/251A Fall 2017 Digital Design and Integrated Circuits. Instructor: John Wawrzynek and Nicholas Weaver. Lecture 13 EE141

THE HONG KONG UNIVERSITY OF SCIENCE & TECHNOLOGY Computer Organization (COMP 2611) Spring Semester, 2014 Final Examination

Mark Redekopp and Gandhi Puvvada, All rights reserved. EE 357 Unit 15. Single-Cycle CPU Datapath and Control

Grading: 3 pts each part. If answer is correct but uses more instructions, 1 pt off. Wrong answer 3pts off.

Topic #6. Processor Design

CPE 335. Basic MIPS Architecture Part II

Computer Science 141 Computing Hardware

are Softw Instruction Set Architecture Microarchitecture are rdw

Lecture 5 and 6. ICS 152 Computer Systems Architecture. Prof. Juan Luis Aragón

The Processor: Datapath & Control

CS3350B Computer Architecture Winter 2015

CS Computer Architecture Spring Week 10: Chapter

CS 61C: Great Ideas in Computer Architecture Datapath. Instructors: John Wawrzynek & Vladimir Stojanovic

Computer Architecture

CO Computer Architecture and Programming Languages CAPL. Lecture 18 & 19

CS222: Processor Design

ECE232: Hardware Organization and Design. Computer Organization - Previously covered

Laboratory Single-Cycle MIPS CPU Design (4): 16-bits version One clock cycle per instruction

ECE331: Hardware Organization and Design

MIPS-Lite Single-Cycle Control

Lecture 7 Pipelining. Peng Liu.

Major CPU Design Steps

Transcription:

ECE232: Hardware Organization and Design Lecture 14: One Cycle MIPs Datapath Adapted from Computer Organization and Design, Patterson & Hennessy, UCB

R-Format Instructions Read two register operands Perform arithmetic/logical operation Write register result rd rs * rt * = { add, sub, AND, OR, slt } 0 rs rt rd shamt funct 31:26 25:21 20:16 15:11 10:6 5:0 ECE331: One Cycle MIPs Datapath 2

Load/Store Instructions Read register operands Calculate address using 16-bit offset Use ALU, but sign-extend offset Load (35): Read memory and update register Store (43): Write register value to memory lw rt, offset(rs) sw rt, offset(rs) 35 or 43 rs rt address 31:26 25:21 20:16 15:0 ECE331: One Cycle MIPs Datapath 3

Branch Instructions Read register operands Compare operands Use ALU, subtract and check Zero output Calculate target address Sign-extend displacement Shift left 2 places (word displacement) Add to PC + 4 Already calculated by instruction fetch 4 rs rt address 31:26 25:21 20:16 15:0 beq rs, rt, address ECE331: One Cycle MIPs Datapath 4

Branch Instructions Just re-routes wires Sign-bit wire replicated ECE331: One Cycle MIPs Datapath 5

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 Instruction Fetch Decode, Inc PC and Read Registers ALU Operation, Branch address Data Memory operation Write Back ECE331: One Cycle MIPs Datapath 6

R-Type/Load/Store Datapath ECE331: One Cycle MIPs Datapath 7

Full Datapath ECE331: One Cycle MIPs Datapath 8

Defining Control op rs rt rd shamt funct 6 6 R-format instruction Control Logic To datapath ECE331: One Cycle MIPs Datapath 9

Defining Control Note that funct field only present in R-format instruction - funct controls ALU only To simplify control, define Main, ALU control separately using multiple levels will also increase speed important optimization technique ALUop inputs will be defined op funct Control Logic op Main Control ALUop ALU control ALUcon funct ECE331: One Cycle MIPs Datapath 10

ALU Control ALU used for Load/Store: Funct = add Branch: Funct = subtract R-type: Function depends on funct field ALU control Function 0000 AND 0001 OR 0010 add 0110 subtract 0111 set-on-less-than 1100 NOR ECE331: One Cycle MIPs Datapath 11

ALU Control Assume 2-bit 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 00 store word XXXXXX add 0010 beq 01 branch equal XXXXXX subtract 0110 R-type 10 add 100000 add 0010 subtract 100010 subtract 0110 AND 100100 AND 0000 OR 100101 OR 0001 set-on-lessthan 101010 set-on-lessthan 0111 ECE331: One Cycle MIPs Datapath 12

The Main Control Unit Control signals derived from instruction R-type Load/ Store Branch 0 rs rt rd shamt funct 31:26 25:21 20:16 15:11 10:6 5:0 35 or 43 rs rt address 31:26 25:21 20:16 15:0 4 rs rt address 31:26 25:21 20:16 15:0 opcode always read read, except for load write for R-type and load sign-extend and add ECE331: One Cycle MIPs Datapath 13

Datapath With Control op rs rt rd addr/ func ECE331: One Cycle MIPs Datapath 14

R-Type Instruction op rs rt rd func ECE331: One Cycle MIPs Datapath 15

Load Instruction op rs rt addr ECE331: One Cycle MIPs Datapath 16

Branch-on-Equal Instruction op rs rt addr ECE331: One Cycle MIPs Datapath 17

Implementing Jumps Jump 2 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 j address ECE331: One Cycle MIPs Datapath 18

Datapath With Jumps Added op ECE331: One Cycle MIPs Datapath 19

Datapath With Control op rs rt rd addr/ func ECE331: One Cycle MIPs Datapath 20

R-Format Instruction: add $t1, $t2, $t3 op rs rt rd addr/ func Memto- Reg Mem Mem Instruction RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUp0 R-format 1 0 0 1 0 0 0 1 0 ECE331: One Cycle MIPs Datapath 21

Load Instruction op rs rt rd addr/ func Instruction RegDst ALUSrc Memto- Reg Reg Write Mem Read Mem Write Branch ALUOp1 ALUp0 lw 0 1 1 1 1 0 0 0 0 ECE331: One Cycle MIPs Datapath 22

Branch-on-Equal Instruction op rs rt rd addr/ func Instruction RegDst ALUSrc Memto- Reg Reg Write Mem Read Mem Write Branch ALUOp1 ALUp0 beq x 0 x 0 0 0 1 0 1 ECE331: One Cycle MIPs Datapath 23

Simple combinational logic Memto- Reg Mem Mem Instruction RegDst ALUSrc Reg Write Read Write Branch ALUOp1 ALUp0 R-format 1 0 0 1 0 0 0 1 0 lw 0 1 1 1 1 0 0 0 0 sw X 1 X 0 0 1 0 0 0 beq X 0 X 0 0 0 1 0 1 I n p u t s O p 5 O p 4 O p 3 O p 2 O p 1 O p 0 R - f o r m a t I w s w b e q O u t p u t s R e g D s t A L U S r c M e m t o R e g R e g W r i t e M e m R e a d M e m W r i t e B r a n c h A L U O p 1 ECE331: One Cycle MIPs Datapath 24 A L U O p O

Summary Understanding the MIPs datapath requires effort You need to carefully read the text in addition to examining the lecture slides Processor built from primitive components ALU, memory, registers, muxes, etc The operation of these components is manipulated by control logic. The output of the control logic is different for every instruction. You should familiarize yourself with the control signals for each instruction For each instruction ask yourself which portions of the datapath should be used Then examine the control signals to prove to yourself that the correct signals are generated Presented architecture operates in a single clock cycle Multicycle pipelined datapath coming next! ECE331: One Cycle MIPs Datapath 25