CS 300 – Lecture 21 Intro to Computer Architecture / Assembly Language Virtual Memory.

Slides:



Advertisements
Similar presentations
1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Advertisements

Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Lecture 5: MIPS Instruction Set
Lecture 20: 11/12/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Lecture 9: MIPS Instruction Set
Lecture 12 Reduce Miss Penalty and Hit Time
1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
Lecture 6: MIPS Instruction Set Today’s topic –Control instructions –Procedure call/return 1.
10/9: Lecture Topics Starting a Program Exercise 3.2 from H+P Review of Assembly Language RISC vs. CISC.
The University of Adelaide, School of Computer Science
Computer Organization CS224
Systems Architecture Lecture 5: MIPS Instruction Set
1 Today’s lecture  Last lecture we started talking about control flow in MIPS (branches)  Finish up control-flow (branches) in MIPS —if/then —loops —case/switch.
Computer Architecture CSCE 350
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 4 Assembly Language Programming 2.
1 Review Chpt 2 and 3 Five components of a computer Input Output Memory Arithmetic & Logic Unit (ALU) Control Two types of information Data and instruction.
COMP3221: Microprocessors and Embedded Systems Lecture 2: Instruction Set Architecture (ISA) Lecturer: Hui Wu Session.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Intro to Computer Architecture
1 Lecture 5: MIPS Examples Today’s topics:  the compilation process  full example – sort in C Reminder: 2 nd assignment will be posted later today.
CS 300 – Lecture 20 Intro to Computer Architecture / Assembly Language Caches.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
1 Lecture 2: MIPS Instruction Set Today’s topic:  MIPS instructions Reminder: sign up for the mailing list cs3810 Reminder: set up your CADE accounts.
Computer System Overview
CS 300 – Lecture 19 Intro to Computer Architecture / Assembly Language C Coding & The Simulator Caches.
CS 300 – Lecture 23 Intro to Computer Architecture / Assembly Language Virtual Memory Pipelining.
1 Lecture 15: Recap Today’s topics:  Recap for mid-term Reminders:  no class Thursday  office hours on Monday (10am-4pm)  mid-term Tuesday (arrive.
1 COMP 206: Computer Architecture and Implementation Montek Singh Wed, Nov 9, 2005 Topic: Caches (contd.)
Reducing Cache Misses 5.1 Introduction 5.2 The ABCs of Caches 5.3 Reducing Cache Misses 5.4 Reducing Cache Miss Penalty 5.5 Reducing Hit Time 5.6 Main.
CS 300 – Lecture 6 Intro to Computer Architecture / Assembly Language Instructions.
Signed Numbers CS208. Signed Numbers Until now we've been concentrating on unsigned numbers. In real life we also need to be able represent signed numbers.
11/10/2005Comp 120 Fall November 10 8 classes to go! questions to me –Topics you would like covered –Things you don’t understand –Suggestions.
Cache Memories Effectiveness of cache is based on a property of computer programs called locality of reference Most of programs time is spent in loops.
9/29: Lecture Topics Memory –Addressing (naming) –Address space sizing Data transfer instructions –load/store on arrays on arrays with variable indices.
Systems I Locality and Caching
Lecture 7: MIPS Instruction Set Today’s topic –Procedure call/return –Large constants Reminders –Homework #2 posted, due 9/17/
CDA 3101 Fall 2012 Introduction to Computer Organization Instruction Set Architecture MIPS Instruction Format 04 Sept 2013.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Lecture 4: MIPS Instruction Set Reminders: –Homework #1 posted: due next Wed. –Midterm #1 scheduled Friday September 26 th, 2014 Location: TODD 430 –Midterm.
Lecture 4: MIPS Instruction Set
 Lecture 2 Processor Organization  Control needs to have the  Ability to fetch instructions from memory  Logic and means to control instruction sequencing.
Nov. 15, 2000Systems Architecture II1 Machine Organization (CS 570) Lecture 8: Memory Hierarchy Design * Jeremy R. Johnson Wed. Nov. 15, 2000 *This lecture.
COMPUTER ORGANIZATION LECTURE 3: ISA YASSER MOHAMMAD.
1 Lecture 6: Assembly Programs Today’s topics:  Large constants  The compilation process  A full example  Intro to the MARS simulator.
High Performance Computing1 High Performance Computing (CS 680) Lecture 2a: Overview of High Performance Processors * Jeremy R. Johnson *This lecture was.
Memory Hierarchy— Five Ways to Reduce Miss Penalty.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
CSE 351 Section 9 3/1/12.
CS 230: Computer Organization and Assembly Language
ECE232: Hardware Organization and Design
Lecture 6: Assembly Programs
CS161 – Design and Architecture of Computer
Lecture 7: MARS, Computer Arithmetic
Multilevel Memories (Improving performance using alittle “cash”)
Lecture 4: MIPS Instruction Set
A Level Computing Component 2
CSCI206 - Computer Organization & Programming
Instructions - Type and Format
Lecture 4: MIPS Instruction Set
CS170 Computer Organization and Architecture I
Systems Architecture Lecture 5: MIPS Instruction Set
CSCE Fall 2013 Prof. Jennifer L. Welch.
MIPS Functions.
CSCE Fall 2012 Prof. Jennifer L. Welch.
COMS 361 Computer Organization
Introduction to Microprocessor Programming
CPU Structure CPU must:
9/27: Lecture Topics Memory Data transfer instructions
Presentation transcript:

CS 300 – Lecture 21 Intro to Computer Architecture / Assembly Language Virtual Memory

Next Homework Sorry – it's not ready yet. It will be in the wiki Friday. The first part will be due the Thursday after break. The second will be due a week later. There will be one more homework after that.

Test Recap Binary Numbers! Aaaaaargh! Binary numbers WILL BE BACK on the final! I pity the fool that can't think in binary!

Binary Convert the following decimal numbers to 8 bit signed binary numbers Add the following 8 bit signed binary numbers; indicate any overflows (but still give a result) Signed: / * / 4 IEEE Float: Convert the number -8.5 to IEEE floating point (32 bits)

Bit Fiddling Write a MIPS code sequence which takes an IEEE float in $a0 and places the exponent only, converted to an integer between -128 and 127, in register $v0.

More MIPS *x = *(x+1)+2

Short Answer If p points to a 64 bit floating point numbers, to increment p you add _______ (T / F) If you divide by 2 using a right shift, the result is rounded up if the number is odd. To divide a signed integer by 2 using a right shift, you shift in _______ bits. When you use a lw instruction, the memory address referenced must end in _________ (T / F) A “lw” instruction may access any word in the MIPS memory. (T / F) A “j” instruction can jump to any instruction in the MIPS memory

Short Answer If p points to an 8-bit character, a ______ instruction fetches the character from memory. (T / F) A function is free to change the value of $t1 without saving it on the stack (T / F) In C, the expression a[i] is the same as *(a+i) Fast arithmetic on large integers is important today since computers commonly run ___________________________ software. (T / F) Writing large assembly language programs is likely to cause brain damage.

Bugz f: add $a0, $a1, $a0 lw $a0, 4($a0) jal put_str jr $ra g: lw $t0, 0($s0) add $s1, $s1, $t0 addi $s0, $s0, 1 addi $s2, $s2, -1 bne $zero, $s2, g

Bugz h: addi $sp, $sp, -4 sw $ra, 0($s0) # Oops - $sp jal f1 addi $a0, $v1, 1 jal f2 la $ra, 0($sp) # Oops - lw jr $ra

Mipsorama int f(char **a, int *b, int c) { int sum = 0; int i; while (c != 0) { i = *b; while (i != 0) { put_str(*a); sum++; i--}; b++; a++; c--; return(sum);

Back to Caches … Things to know: * A cache is smaller but faster than the system being cached. * Shape of the cache determines whether addresses conflict - direct mapped, associative, set (partial) associative * Replacement policies (LRU) * Multi-level cache systems

Dual Caches One possible cache design is to separate instruction caching from data caching. There are major differences in the access patterns for instructions & data (I & D) * No writes to instructions (simplifies cache design) * Instructions are more sequential – pre-loading is a big issue. A less associative design is possible * A data cache has to worry about regular access patterns (much array code)

Cache Coherence This is a problem when more than one party is using a cache. If two processors use a common memory, their on- chip caches can lose coherence. How to deal with this? * Write-through (cache is never out of synch with memory) instead of write-back (avoid writing dirty cache words until replacement). * Invalidation signals: When processor A writes into memory, it must invalidate the corresponding word in processor B's cache (or update it)

Current Cache Design Stuff * Segregated (I/D) L1 cache – small and very fast * On-chip large L2 cache (in the mB range) * Off-chip L3 cache in high end systems * Set associative designs predominate – 8 way is common.

Overview of Pentium Caching * Pentium I: 8KB each L1 I and D cache * Pentium Pro: 256KB L2 cache added * Pentium II: 16KB L1 I/D cache, 512KB L2 cache * Pentium IV: up to 1MB L2 cache – cache access time to L1 is just 2 clocks but cache is smaller. L2 cache runs about 10 clocks. * Pentium D: up to 4MB L2 cache

The Three C's There are three reasons that cache misses occur: * Compulsory: data was not used previously so can't be in the cache * Capacity: the word could have been in the cache but it was too full * Conflict: the cache is big enough but the shape of the cache precludes keeping the data available

Cache and the Programmer Most code doesn't care about the cache… Some algorithms are "cache friendly" (quicksort) Numeric code is a serious problem! Array access patterns can lead to very poor cache behavior. Explicit prefetching of data can achieve significant speedup Compilers for RISC are explicit cache managers