Computer Organization. Structure of a Computer. Registers. Register Transfer. Register Files. Memories

Similar documents
Computer Organization

Block diagram view. Datapath = functional units + registers

EECS Components and Design Techniques for Digital Systems. Lec 20 RTL Design Optimization 11/6/2007

Name: ID# UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences EECS150 Fall 2001 Prof. Subramanian Midterm III

ECE260: Fundamentals of Computer Engineering

The MIPS Processor Datapath

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

Systems Architecture

Processor (I) - datapath & control. Hwansoo Han

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

Chapter 4. The Processor

Inf2C - Computer Systems Lecture Processor Design Single Cycle

Review: Abstract Implementation View

Chapter 4. The Processor

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

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

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

Major CPU Design Steps

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

CENG 3420 Lecture 06: Datapath

Introduction. Datapath Basics

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

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

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

CPU Organization (Design)

CPE 335 Computer Organization. Basic MIPS Architecture Part I

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

Ch 5: Designing a Single Cycle Datapath

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

ECE232: Hardware Organization and Design

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

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

Multi-cycle Approach. Single cycle CPU. Multi-cycle CPU. Requires state elements to hold intermediate values. one clock cycle or instruction

Chapter 4. The Processor

The Big Picture: Where are We Now? EEM 486: Computer Architecture. Lecture 3. Designing a Single Cycle Datapath

CPU Design Steps. EECC550 - Shaaban

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

Chapter 4. The Processor Designing the datapath

CS Computer Architecture Spring Week 10: Chapter

RISC Processor Design

Laboratory 5 Processor Datapath

Single Cycle Datapath

CPE 335. Basic MIPS Architecture Part II

Systems Architecture I

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

EE 3170 Microcontroller Applications

Chapter 4. The Processor

Processor: Multi- Cycle Datapath & Control

Computer Science 324 Computer Architecture Mount Holyoke College Fall Topic Notes: MIPS Instruction Set Architecture

Lecture 10: Simple Data Path

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

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

Topic #6. Processor Design

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

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

CS 61C: Great Ideas in Computer Architecture. MIPS CPU Datapath, Control Introduction

Chapter 5: The Processor: Datapath and Control

COMPUTER ORGANIZATION AND DESIGN

Inf2C - Computer Systems Lecture 12 Processor Design Multi-Cycle

General Purpose Processors

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

Single Cycle Datapath

The Processor: Datapath & Control

CpE242 Computer Architecture and Engineering Designing a Single Cycle Datapath

CS222: Processor Design

are Softw Instruction Set Architecture Microarchitecture are rdw

LECTURE 5. Single-Cycle Datapath and Control

Multiple Cycle Data Path

REGISTER TRANSFER LANGUAGE

RISC Design: Multi-Cycle Implementation

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

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA MIPS ISA. In a CPU. (vonneumann) Processor Organization

A Processor. Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University. See: P&H Chapter , 4.1-3

Chapter 5 Solutions: For More Practice

Topic Notes: MIPS Instruction Set Architecture

Computer Science and Engineering 331. Midterm Examination #1. Fall Name: Solutions S.S.#:

Initial Representation Finite State Diagram. Logic Representation Logic Equations

Math 230 Assembly Programming (AKA Computer Organization) Spring MIPS Intro

Math 230 Assembly Programming (AKA Computer Organization) Spring 2008

CC 311- Computer Architecture. The Processor - Control

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

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

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

BASIC COMPUTER ORGANIZATION. Operating System Concepts 8 th Edition

ﻪﺘﻓﺮﺸﻴﭘ ﺮﺗﻮﻴﭙﻣﺎﻛ يرﺎﻤﻌﻣ MIPS يرﺎﻤﻌﻣ data path and ontrol control

ECE170 Computer Architecture. Single Cycle Control. Review: 3b: Add & Subtract. Review: 3e: Store Operations. Review: 3d: Load Operations

Lecture 3: The Processor (Chapter 4 of textbook) Chapter 4.1

Final Project: MIPS-like Microprocessor

The overall datapath for RT, lw,sw beq instrucution

The Processor: Datapath & Control

EECE 417 Computer Systems Architecture

Controller Implementation--Part II

Computer Hardware Engineering

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

R-type Instructions. Experiment Introduction. 4.2 Instruction Set Architecture Types of Instructions

ECE468 Computer Organization and Architecture. Designing a Single Cycle Datapath

Outline. EEL-4713 Computer Architecture Designing a Single Cycle Datapath

Transcription:

Computer Organization Structure of a Computer Computer design as an application of digital logic design procedures Computer = processing unit + memory system Processing unit = control + Control = finite state machine Inputs = machine, conditions Outputs = register transfer control signals, ALU operation codes Instruction interpretation =,, execute Data = functional units + registers Functional units = ALU, multipliers, dividers, etc. Registers = program counter, shifters, storage registers CS 150 - Spring 2004 Lec 11: Computer Org I - 1 Block diagram view central processing unit (CPU) Control unit and interpretation FSM Processor control signals conditions address read/write Data Path CS 150 - Spring 2004 Lec 11: Computer Org I - 2 Memory System execution unit functional units and registers Registers Register Transfer Selectively loaded E or LD input Output enable OE input Multiple registers group 4 or 8 in parallel LD D7 D6 D5 D4 D3 D2 D1 D0 CLK OE Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0 OE asserted causes FF state to be connected to output pins; otherwise they are left unconnected (high impedance) LD asserted during a lo-to-hi clock transition loads new into FFs Point-to-point connection Dedicated wires MUX MUX MUX MUX Muxes on inputs of each register rs rt rd R4 Common input from multiplexer Load enables for each register rs rt rd R4 Control signals for multiplexer MUX Common bus with output enables Output enables and load enables for each register rs rt rd R4 BUS CS 150 - Spring 2004 Lec 11: Computer Org I - 3 CS 150 - Spring 2004 Lec 11: Computer Org I - 4 Register Files Memories Collections of registers in one package Two-dimensional array of FFs Address used as index to a particular word Separate read and write addresses so can do both at same time 4 by 4 register file D-FFs Organized as four words of four bits each Write-enable (load) Read-enable (output enable) CS 150 - Spring 2004 Lec 11: Computer Org I - 5 RE RB RA WE WB WA D3 D2 D1 D0 Q3 Q2 Q1 Q0 Larger Collections of Storage Elements Implemented not as FFs but as much more efficient latches High-density memories use 1-5 switches (transitors) per bit Static RAM 1024 words each 4 bits wide Once written, memory holds forever (not true for denser dynamic RAM) Address lines to select word (10 lines for 1024 words) Read enable RD Same as output enable Often called chip select WR A9 Permits connection of many A8 A7 chips into larger array A6 Write enable (same as load enable) A5 A4 Bi-directional lines A3 A2 output when reading, input when writing A2 A1 A0 CS 150 - Spring 2004 Lec 11: Computer Org I - 6 IO3 IO2 IO1 IO0

Instruction Sequencing Example an to add the contents of two registers (Rx and Ry) and place result in a third register (Rz) Step 1: Get the ADD from memory into an register Step 2: Decode Instruction in IR has the code of an ADD Register indices used to generate output enables for registers Rx and Ry Register index used to generate load signal for register Rz Step 3: execute Enable Rx and Ry output and direct to ALU Setup ALU to perform ADD operation Direct result to Rz so that it can be loaded into register CS 150 - Spring 2004 Lec 11: Computer Org I - 7 Instruction Types Data Manipulation Add, subtract Increment, decrement Multiply Shift, rotate Immediate operands Data Staging Load/store to/from memory Register-to-register move Control Conditional/unconditional branches in program flow Subroutine call and return CS 150 - Spring 2004 Lec 11: Computer Org I - 8 Elements of the Control Unit (aka Instruction Unit) Instruction Execution Standard FSM Elements State register ext-state logic Output logic (/control signaling) Moore or synchronous Mealy machine to avoid loops unbroken by FF Plus Additional Control" Registers Instruction register (IR) Program counter (PC) Inputs/Outputs Outputs control elements of Inputs from used to alter flow of program (test if zero) CS 150 - Spring 2004 Lec 11: Computer Org I - 9 Control State Diagram (for each diagram) Reset Fetch Init Decode Execute Instructions partitioned into three classes Branch Load/store Register-to-register Different sequence through diagram for each type Branch Taken Branch Branch ot Taken CS 150 - Spring 2004 Lec 11: Computer Org I - 10 Fetch Instr. Load/ Store Incr. PC Reset Initialize Machine XEQ Instr. Registerto-Register Data Path (Hierarchy) Data Path (ALU) Arithmetic circuits constructed in hierarchical and Cin iterative fashion each bit in is Ain functionally identical FA Sum Bin 4-bit, 8-bit, -bit, 32-bit s Cout Ain Sum HA Bin Cout HA Cin ALU Block Diagram Input: and operation to perform Output: result of operation and status information Operation A B S CS 150 - Spring 2004 Lec 11: Computer Org I - 11 CS 150 - Spring 2004 Lec 11: Computer Org I - 12

Data Path (ALU + Registers) Data Path (Bit-slice) Accumulator Special register One of the inputs to ALU Output of ALU stored back in accumulator One-address s Operation and address of one operand Other operand and destination is accumulator register < op Mem[addr] Single address s ( implicit operand) Multiple registers Part of used to choose register operands REG Bit-slice concept: iterate to build n-bit wide s CO ALU R0 rs rt rd from memory 1 bit wide CI CO ALU R0 rs rt rd from memory ALU R0 rs rt rd from memory 2 bits wide CI CS 150 - Spring 2004 Lec 11: Computer Org I - 13 CS 150 - Spring 2004 Lec 11: Computer Org I - 14 Instruction Path Data Path (Memory Interface) Program Counter Keeps track of program execution Address of next to read from memory May have auto-increment feature or use ALU Instruction Register Current Includes ALU operation and address of operand Also holds target of jump Immediate operands Relationship to Data Path PC may be incremented through ALU Contents of IR may also be required as input to ALU CS 150 - Spring 2004 Lec 11: Computer Org I - 15 Memory Separate and memory (Harvard architecture) Two address busses, two busses Single combined memory (Princeton architecture) Single address bus, single bus Separate memory ALU output goes to memory input Register input from memory output Data memory address from register Instruction register from memory output Instruction memory address from program counter Single memory Address from PC or IR Memory output to and registers Memory input from ALU output CS 150 - Spring 2004 Lec 11: Computer Org I - Block Diagram of Processor Block Diagram of Processor Register Transfer View of Princeton Architecture Which register outputs are connected to which register inputs Arrows represent -flow, other are control signals from control FSM MAR may be a simple multiplexer rather than separate register MBR is split in two (REG and IR) Load control for each register Control FSM REG 8 load store rd wr Data Memory (-bit words) addr MAR Register transfer view of Harvard architecture Which register outputs are connected to which register inputs Arrows represent -flow, other are control signals from control FSM Two MARs (PC and IR) Two MBRs (REG and IR) Load control for each register Control FSM REG load store rd wr Data Memory (-bit words) addr IR PC IR PC Inst Memory (8-bit words) addr CS 150 - Spring 2004 Lec 11: Computer Org I - 17 CS 150 - Spring 2004 Lec 11: Computer Org I - 18

A simplified Processor Data- and Memory Processor Control Princeton architecture Register file Instruction register PC incremented through ALU Modeled after MIPS rt000 (used in 61C textbook by Patterson & Hennessy) Really a 32 bit machine We ll do a bit version memory has only 255 words with a display on the last one CS 150 - Spring 2004 Lec 11: Computer Org I - 19 Synchronous Mealy machine Multiple cycles per CS 150 - Spring 2004 Lec 11: Computer Org I - 20 Processor Instructions Three principal types ( bits in each ) type op rs rt rd funct R(egister) 3 3 3 3 4 I(mmediate) 3 3 3 7 J(ump) 3 13 Some of the s R I J add 0 rs rt rd 0 rd = rs + rt sub 0 rs rt rd 1 rd = rs - rt and 0 rs rt rd 2 rd = rs & rt or 0 rs rt rd 3 rd = rs rt slt 0 rs rt rd 4 rd = (rs < rt) lw 1 rs rt offset rt = mem[rs + offset] sw 2 rs rt offset mem[rs + offset] = rt beq 3 rs rt offset pc = pc + offset, if (rs == rt) addi 4 rs rt offset rt = rs + offset j 5 target address pc = target address halt 7 - stop execution until reset CS 150 - Spring 2004 Lec 11: Computer Org I - 21 Instruction: r3 = r1 + r2 R 0 rs=r1 rt=r2 rd=r3 funct=0 1. Instruction Move address from PC to memory address bus Assert memory read Move from memory bus into IR Configure ALU to add 1 to PC Configure PC to store new value from ALUout 2. Instruction Op-code bits of IR are input to control FSM Rest of IR bits encode the operand addresses (rs and rt) These go to register file CS 150 - Spring 2004 Lec 11: Computer Org I - 22 Instruction: r3 = r1 + r2 R 0 rs=r1 rt=r2 rd=r3 funct=0 3. Instruction execute Set up ALU inputs Configure ALU to perform ADD operation Configure register file to store ALU result (rd) Step 1 CS 150 - Spring 2004 Lec 11: Computer Org I - 23 CS 150 - Spring 2004 Lec 11: Computer Org I - 24

Step 2 Step 3 CS 150 - Spring 2004 Lec 11: Computer Org I - 25 to controller CS 150 - Spring 2004 Lec 11: Computer Org I - 26 Register-Transfer-Level Description Register-Transfer-Level Description Control Transfer btwn registers by asserting appropriate control signals Register transfer notation: work from register to register Instruction : mabus PC; move PC to memory address bus (PCmaE, ALUmaE) memory read; assert memory read signal (mr, RegBmdE) IR memory; load IR from memory bus (IRld) op add send PC into A input, 1 into B input, add (srca, srcb0, scrb1, op) PC ALUout load result of incrementing in ALU into PC (PCld, PCsel) Instruction : IR to controller values of A and B read from register file (rs, rt) Instruction execution: op add send rega into A input, regb into B input, add (srca, srcb0, scrb1, op) rd ALUout store result of add into destination register (regwrite, wrdatasel, wrregsel) CS 150 - Spring 2004 Lec 11: Computer Org I - 27 How many states are needed to accomplish these transfers? Data dependencies (where do values that are needed come from?) Resource conflicts (ALU, busses, etc.) In our case, it takes three cycles One for each step All operation within a cycle occur between rising edges of the clock How do we set all of the control signals to be output by the state machine? Depends on the type of machine (Mealy, Moore, synchronous Mealy) CS 150 - Spring 2004 Lec 11: Computer Org I - 28 Review of FSM Timing FSM Controller for CPU (skeletal Moore FSM) First pass at deriving the state diagram (Moore machine) These will be further refined into sub-states reset execute step 1 step 2 step 3 IR mem[pc]; PC PC + 1; A rs B rt rd A + B to configure the - to do this here, LW SW ADD J execution when do we set the control signals? CS 150 - Spring 2004 Lec 11: Computer Org I - 29 CS 150 - Spring 2004 Lec 11: Computer Org I - 30

FSM Controller for CPU (reset and ) FSM Controller for CPU () Assume Moore machine Outputs associated with states rather than arcs Reset state and sequence On reset (go to Fetch state) Start ing s reset PC will set itself to zero mabus PC; memory read; IR memory bus; PC PC + 1; Fetch Operation Decode State ext state branch based on operation code in Read two operands out of register file What if the doesn t have two operands? branch based on value of Inst[15:13] and Inst[3:0] add Decode CS 150 - Spring 2004 Lec 11: Computer Org I - 31 CS 150 - Spring 2004 Lec 11: Computer Org I - 32 FSM Controller for CPU (Instruction Execution) FSM Controller for CPU (Add Instruction) For add Configure ALU and store result in register rd A + B Other s may require multiple cycles add execution Putting it all together and closing the loop the famous execute cycle reset Fetch Decode add execution CS 150 - Spring 2004 Lec 11: Computer Org I - 33 CS 150 - Spring 2004 Lec 11: Computer Org I - 34 FSM Controller for CPU ow we need to repeat this for all the s of our processor Fetch and states stay the same Different execution states for each Some may require multiple states if available register transfer s require sequencing of steps CS 150 - Spring 2004 Lec 11: Computer Org I - 35