Stack. Heap. Static. Code

Similar documents
CS61C : Machine Structures

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

CS3350B Computer Architecture Winter 2015

CS61C : Machine Structures

UC Berkeley CS61C : Machine Structures

CS61C Review of Cache/VM/TLB. Lecture 26. April 30, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)

CS 31: Intro to Systems Digital Logic

Clever Signed Adder/Subtractor. Five Components of a Computer. The CPU. Stages of the Datapath (1/5) Stages of the Datapath : Overview

Learning Outcomes. Spiral 3-3. Sorting: Software Implementation REVIEW

CS61C : Machine Structures

Truth Table! Review! Use this table and techniques we learned to transform from 1 to another! ! Gate Diagram! Today!

Lecture 6: Signed Numbers & Arithmetic Circuits. BCD (Binary Coded Decimal) Points Addressed in this Lecture

Levels in memory hierarchy

UC Berkeley CS61C : Machine Structures

The MIPS Processor Datapath

CISC 662 Graduate Computer Architecture Lecture 5 - Pipeline. Pipelining. Pipelining the Idea. Similar to assembly line in a factory:

UC Berkeley CS61C : Machine Structures

Review. N-bit adder-subtractor done using N 1- bit adders with XOR gates on input. Lecture #19 Designing a Single-Cycle CPU

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 27: Single- Cycle CPU Datapath Design

Review 1/2 MIPS assembly language instructions mapped to numbers in 3 formats. CS61C Negative Numbers and Logical Operations R I J.

Chapter 2: Memory Hierarchy Design, part 1 - Introducation. Advanced Computer Architecture Mehran Rezaei


UC Berkeley CS61C : Machine Structures

LECTURE 5. Single-Cycle Datapath and Control

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

ECE331: Hardware Organization and Design

Computer Hardware Engineering

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

CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 28: Single- Cycle CPU Datapath Control Part 1

Review. Manage memory to disk? Treat as cache. Lecture #26 Virtual Memory II & I/O Intro

CS/COE0447: Computer Organization

CS/COE0447: Computer Organization

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

Lecture #17: CPU Design II Control

CS61C C/Assembler Operators and Operands Lecture 2 January 22, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)

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

CS61C - Machine Structures. Lecture 17 - Caches, Part I. October 25, 2000 David Patterson

CS61C : Machine Structures

ECE260: Fundamentals of Computer Engineering

2B 52 AB CA 3E A1 +29 A B C. CS120 Fall 2018 Final Prep and super secret quiz 9

Computer Architecture. Lecture 6.1: Fundamentals of

Review : Pipelining. Memory Hierarchy

14:332:331. Lecture 1

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

Building a Virtual Computer

CS61C Machine Structures. Lecture 1 Introduction. 8/27/2006 John Wawrzynek (Warzneck)

ECE331: Hardware Organization and Design

CS222: Processor Design

CS 351 Exam 2 Mon. 11/2/2015

UCB CS61C : Machine Structures

Memory Hierarchies. Instructor: Dmitri A. Gusev. Fall Lecture 10, October 8, CS 502: Computers and Communications Technology

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

CS61C : Machine Structures

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

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

CISC 662 Graduate Computer Architecture Lecture 5 - Pipeline Pipelining

EC 413 Computer Organization - Fall 2017 Problem Set 3 Problem Set 3 Solution

Introduction. Datapath Basics

CS61C : Machine Structures

MIPS Assembly Programming

Page 1, 5/4/99 8:22 PM

CS61C : Machine Structures

! CS61C : Machine Structures. Lecture 22 Caches I. !!Instructor Paul Pearce! ITʼS NOW LEGAL TO JAILBREAK YOUR PHONE!

CS61C : Machine Structures

CS61C Machine Structures. Lecture 1 Introduction. 8/25/2003 Brian Harvey. John Wawrzynek (Warznek) www-inst.eecs.berkeley.

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

ECE 313 Computer Organization FINAL EXAM December 14, This exam is open book and open notes. You have 2 hours.

CS430 - Computer Architecture William J. Taffe Fall 2002 using slides from. CS61C - Machine Structures Dave Patterson Fall 2000

CISC 662 Graduate Computer Architecture. Lecture 4 - ISA

Topic #6. Processor Design

CS 152 Computer Architecture and Engineering Lecture 1 Single Cycle Design

CS252 S05. Main memory management. Memory hardware. The scale of things. Memory hardware (cont.) Bottleneck

EN164: Design of Computing Systems Lecture 09: Processor / ISA 2

CS61C : Machine Structures

UCB CS61C : Machine Structures

Systems Architecture

Computer Hardware Engineering

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

Topic Notes: MIPS Instruction Set Architecture

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

Instruction Set Architecture

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

Processor (I) - datapath & control. Hwansoo Han

Lecture 01: Basic Structure of Computers

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Fundamentals of Computer Systems

Lctures 33: Cache Memory - I. Some of the slides are adopted from David Patterson (UCB)

ECE232: Hardware Organization and Design

IC220 SlideSet #2: Instructions (Chapter 2)

Chapter 1. Computer Abstractions and Technology. Lesson 3: Understanding Performance

Pipelining. CSC Friday, November 6, 2015

CS61C : Machine Structures

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

CS/COE 0447 Example Problems for Exam 2 Fall 2010

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches

CSF Cache Introduction. [Adapted from Computer Organization and Design, Patterson & Hennessy, 2005]

CPE300: Digital System Architecture and Design. Fall 2011 MW 17:30-18:45 CBC C316

The Processor Memory Hierarchy

14:332:331. Week 13 Basics of Cache

Transcription:

CS6C Virtual Wrap-Up Processor Datapath Lecture pril 9, 999 Dave Patterson (http.cs.berkeley.edu/~patterson) www-inst.eecs.berkeley.edu/~cs6c/schedule.html Outline Review Virtual Introduce Datapath Top-Down asic Components and HW uilding locks dministrivia, Computers in the News Designing an rithmetic Logic Unit (LU) -bit LU 3-bit LU Conclusion cs 6C L datapath. cs 6C L datapath. Review / Virtual allows protected sharing of memory between processes with less swapping to disk, less fragmentation than always swap or base/bound 3 Problems: ) Not enough memory: Spatial Locality means small Working Set of pages OK ) TL to reduce performance cost of VM 3) Need more compact representation to reduce memory size cost of simple -level page table, especially for 64-bit address (See CS 6) cs 6C L datapath.3 Review /: Paging/Virtual User : Virtual Stack Heap Static Code cs 6C L datapath.4 Physical 64 M Table Table User : Virtual Stack Heap Static Code

Reduce Table Space: Multilevel Table Super No. Number Offset bits bits bits Super s map bytes (4 M) Each Super Table Entry in Super Table points to a separate (normal) Table which maps 4M into 4 4K ( ) pages 64 M -level Table Physical (Normal) Tables Super Table Virtual Stack Heap Static Save space by avoiding normal Table when no entry in Super Table cs 6C L datapath.5 cs 6C L datapath.6 Code natomy: 5 components of any Computer Lectures - Lectures 7-9 Computer Processor (active) Control ( brain ) Datapath ( brawn ) (passive) (where programs, data live when running) Devices Input Output Keyboard, Mouse Disk (where programs, data live when not running) Display, Printer Deriving the Datapath for a MIPS Processor Start with instruction subset in 3 instruction classes to derive datapath -reference: lw, sw rithmetic-logical: add, sub, and, or ranch: beq This subset illustrates shows most of the difficult steps in executing instructions cs 6C L datapath.7 cs 6C L datapath.8

Up to 5 Steps in Executing MIPS Subset ll instructions have common first two steps: ) Fetch Instruction and Increment PC ([PC]; PC = PC 4) ) Read or Registers (lw reads reg) Up to 5 Steps in Executing MIPS Subset 3rd step depends on instruction class 3) for -reference: Calculate ddress (ddress = Reg[rs]Imm) 3) for rithmetic-logical: Calculate Result (Result = Reg[rs] op Reg[rt], op is,-,&, ) 3) for ranch: Compare (equal = (Reg[rs] == Reg[rt])) cs 6C L datapath.9 cs 6C L datapath. Up to 5 Steps in Executing MIPS Subset 4th step depends on instruction class 4 ) for lw: Fetch Data in (Data = [ddress]) 4 ) for sw: [ddress] = Reg[rt] 4 ) for rithmetic-logical: Write Result (Reg[rd] = Result) 4) for ranch: Compare (if (Equal) PC = PC Imm) 5th step only for lw; rest are done What is needed for Datapath from 5 steps PC 3 Registers Unit to perform,-, &, Called an rithmetic-logic Unit, or LU for Instructions, Data Some miscellaneous registers to hold results between steps: ddress, Data, Equal 5) for lw: Write Result (Reg[rt] = Data) cs 6C L datapath. cs 6C L datapath.

Putting Together a Datapath for MIPS ddress Data In Data Out Data Out Instruction PC Registers LU ddress Data Out Data In How can have separate Instruction and Data? Data Step Step Step 3 (Step 4) Separate Caches for Instructions and for Data dministrivia Project 5: Due 4/4: design and implement a cache (in software) and plug into instruction simulator Next Readings: 5. (skip logic, clocking), 5., 4.5 (pages 3-36), 4.6 (pages 5-53, 64; skim 54-57), 4.7 (pages 65-68, 73; skim 69-7) How many lectures to cover:? 9th homework: Due Friday 4/6 7PM Exercises 7.35, 4.4 cs 6C L datapath.3 cs 6C L datapath.4 dministrivia: Courses for Telebears Take courses from great teachers! Top Faculty / Course (may teach soon) CS 5 logic design Katz 6. F9 CS 5 computer HW Patterson 6.7 S95 CS 64 compilers Rowe 6. S98 CS 69 SW engin. rewer 6. S98 CS 74 combinatorics Sinclair 6. F97 CS 86 data bases Wang 6. S98 EE 3 IC Devices Hu 6. S97 EE4 Digital IC Design Rabaey 6.3 S97 Computer (Technology) in the News Milestone on the Road to Ultrafast Computers, N.Y. Times, pril 6, 999 tunneling magnetic junction random access memory (tmj-ram) by IM researchers new kind of memory that could fundamentally alter computer design early in the next century... combine the best features of computer disks... and memory chips... (No hierarchy: fast as cache, dense as disk) a crucial step toward new class of materials and microelectronics-- "spintronics --based on ability to detect and control spins of electrons in ferromagnetic materials hkn.eecs/toplevel/coursesurveys.html cs 6C L datapath.5 cs 6C L datapath.6

Contructing the Datapath Components Instruction and Data are just caches, as seen before PC, 3 Registers built from hardware called registers which each store word Leaves LU for MIPS subset (For full MIPS instruction set, need multiply, divide: do that later) First describe Hardware uilding locks Hardware uilding locks (for LU) ND Gate Symbol Definition C C Inverter Symbol Definition C C OR Gate Symbol Definition C C Multiplexor Symbol Definition D D C C cs 6C L datapath.7 cs 6C L datapath.8 rithmetic Logic Unit (LU) What about ddition? MIPS LU is 3 bits wide Start with -bit LU, then connect 3 -bit LUs to form a 3-bit LU Since hardware building block includes an ND gate and an OR gate, and since ND and OR are two of the operations of the -bit LU, start here: C Definition C and or Example inary ddition: a: Carries b: Sum: Thus for any bit of addition: The inputs are a i, b i, i The outputs are Sum i, CarryOut i Note: i = CarryOut i cs 6C L datapath.9 cs 6C L datapath.

-it dder Symbol CarryOut Sum Full dder Definition CarryOut Sum Constructing Hardware to Match Definition Given any table of binary inputs for a binary output, programs can automatically connect a minimal number of ND gates, OR gates, and Inverters to produce the desired function Such programs generically called Computer ided Design, or CD cs 6C L datapath. cs 6C L datapath.3 Example: HW gates for CarryOut dd -bit dder to -bit LU Values of Inputs when CarryOut is : Gates for Sum left as exercise to Reader Gates for CarryOut signal: CarryOut CarryOut Definition C and or Now connect 3 -bit LUs together C cs 6C L datapath.4 cs 6C L datapath.5

3-bit LU Connect CarryOut i to i Connect 3 -bit LUs together Connect to all 3 bits of LU Does 3-bit nd, Or, dd cs 6C L datapath.6 3 3 What about subtract?... C C C3 s comp. shortcut: Negation (Lecture 7) Invert every to and every to, then add to the result Sum of number and its inverted rep. ( one s complement ) must be... two... two = - ten Let x mean the inverted representation of x Then x x = - x x = x = -x Example: -4 to 4 to -4 x : two x : two : two () : two : two cs 6C L datapath.7 How Do Subtract? Suppose added input to -bit LU that gave the one s complement of What happens if set to in 3- bit LU? Sum = Then if select inverted (), Sum is = ( ) = (-) = - Therefore can do subtract as well as nd, Or, dd if modify -bit LU cs 6C L datapath.8 -bit LU with Subtract Support invert cs 6C L datapath.9 CarryOut C Definition invert C and and or or

3-bit LU 3-bit LU made from ND gates, OR gates, Inverters, Multiplexors Performs 3- bit ND, OR, ddition, Subtract ( s complement) cs 6C L datapath.3 3 3 invert...... C C C3 nd in Conclusion.. / Virtual shares physical memory between several processes via paging Datapath components visible in the instruction set: PC, Registers,, LU Hardware building blocks: nd gate, Or gate, Inverter, Multiplexor uild dder via bstraction: decompose into -bit LUs Seen how a computers adds, subtracts Next: How a computer Multiplies, Divides cs 6C L datapath.3