Caches I. CSE 351 Spring Instructor: Ruth Anderson

Size: px
Start display at page:

Download "Caches I. CSE 351 Spring Instructor: Ruth Anderson"

Transcription

1 L16: Cches I Cches I CSE 351 Spring 2017 Instructor: Ruth Anderson Teching Assistnts: Dyln Johnson Kevin Bi Linxing Preston Jing Cody Ohlsen Yufng Sun Joshu Curtis

2 L16: Cches I Administrivi Homework 3, due next Fridy (5/5) Midterm, Mondy (5/8) Lb 3, due Thursdy (5/11) 2

3 L16: Cches I Rodmp C: cr *c = mlloc(sizeof(cr)); c->miles = 100; c->gls = 17; flot mpg = get_mpg(c); free(c); Assembly lnguge: Mchine code: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp %rbp Jv: Cr c = new Cr(); c.setmiles(100); c.setgls(17); flot mpg = c.getmpg(); OS: Memory & dt Integers & flots x86 ssembly Procedures & stcks Executbles Arrys & structs Memory & cches Processes Virtul memory Memory lloction Jv vs. C Computer system: 3

4 L16: Cches I How does execution time grow with SIZE? int rry[size]; int sum = 0; for (int i = 0; i < ; i++) { for (int j = 0; j < SIZE; j++) { sum += rry[j]; } } Time Plot SIZE 4

5 Time L16: Cches I Actul Dt SIZE 5

6 L16: Cches I Mking memory ccesses fst! Cche bsics Principle of loclity Memory hierrchies Cche orgniztion Progrm optimiztions tht consider cches 6

7 Performnce L16: Cches I Processor-Memory Gp first Intel CPU with cche on chip 1998 Pentium III hs two cche levels on chip Moore s Lw Processor-Memory Performnce Gp (grows 50%/yer) µproc 55%/yer (2X/1.5yr) DRAM 7%/yer (2X/10yrs) Yer 7

8 L16: Cches I Problem: Processor-Memory Bottleneck Processor performnce doubled bout every 18 months CPU Reg Bus ltency / bndwidth evolved much slower Min Memory Core 2 Duo: Cn process t lest 256 Bytes/cycle Core 2 Duo: Bndwidth 2 Bytes/cycle Ltency cycles (30-60ns) cycle: single mchine step (fixed-time) Problem: lots of witing on memory 8

9 L16: Cches I Problem: Processor-Memory Bottleneck Processor performnce doubled bout every 18 months CPU Reg Cche Bus ltency / bndwidth evolved much slower Min Memory Core 2 Duo: Cn process t lest 256 Bytes/cycle Core 2 Duo: Bndwidth 2 Bytes/cycle Ltency cycles (30-60ns) cycle: single mchine step (fixed-time) Solution: cches 9

10 L16: Cches I Cche Pronuncition: csh We bbrevite this s $ English: A hidden storge spce for provisions, wepons, nd/or tresures Computer: Memory with short ccess time used for the storge of frequently or recently used instructions (i-cche/i$) or dt (d-cche/d$) More generlly: Used to optimize dt trnsfers between ny system elements with different chrcteristics (network interfce cche, I/O cche, etc.) 10

11 L16: Cches I Generl Cche Mechnics Cche Smller, fster, more expensive memory. Cches subset of the blocks (.k.. lines) Dt is copied in block-sized trnsfer units Memory Lrger, slower, cheper memory. Viewed s prtitioned into blocks or lines 11

12 L16: Cches I Generl Cche Concepts: Hit Request: 14 Dt in block b is needed Cche Block b is in cche: Hit! Dt is returned to CPU Memory

13 L16: Cches I Generl Cche Concepts: Miss Cche Request: Dt in block b is needed Block b is not in cche: Miss! 12 Request: 12 Block b is fetched from memory Memory Block b is stored in cche Plcement policy: determines where b goes Replcement policy: determines which block gets evicted (victim) Dt is returned to CPU 13

14 L16: Cches I Why Cches Work Loclity: Progrms tend to use dt nd instructions with ddresses ner or equl to those they hve used recently 14

15 L16: Cches I Why Cches Work Loclity: Progrms tend to use dt nd instructions with ddresses ner or equl to those they hve used recently Temporl loclity: Recently referenced items re likely to be referenced gin in the ner future block 15

16 L16: Cches I Why Cches Work Loclity: Progrms tend to use dt nd instructions with ddresses ner or equl to those they hve used recently Temporl loclity: Recently referenced items re likely to be referenced gin in the ner future Sptil loclity: Items with nerby ddresses tend to be referenced close together in time block block How do cches tke dvntge of this? 16

17 L16: Cches I Exmple: Any Loclity? sum = 0; for (i = 0; i < n; i++) { sum += [i]; } return sum; Dt: Temporl: Sptil: Instructions: Temporl: Sptil: 17

18 L16: Cches I Exmple: Any Loclity? sum = 0; for (i = 0; i < n; i++) { sum += [i]; } return sum; Dt: Temporl: Sptil: Instructions: Temporl: Sptil: sum referenced in ech itertion rry [] ccessed in stride-1 pttern cycle through loop repetedly reference instructions in sequence 18

19 L16: Cches I Loclity Exmple #1 int sum_rry_rows(int [M][N]) { int i, j, sum = 0; for (i = 0; i < M; i++) for (j = 0; j < N; j++) sum += [i][j]; } return sum; 19

20 L16: Cches I Loclity Exmple #1 int sum_rry_rows(int [M][N]) { int i, j, sum = 0; } for (i = 0; i < M; i++) for (j = 0; j < N; j++) sum += [i][j]; return sum; Lyout in Memory [3] [3] Note: 76 is just one possible strting ddress of rry [3] M = 3, N=4 [3] [3] [3] Access Pttern: stride =? 1) 2) 3) 4) [3] 5) 6) 7) 8) [3] 9) 10) 11) 12) [3] 20

21 L16: Cches I Loclity Exmple #2 int sum_rry_cols(int [M][N]) { int i, j, sum = 0; for (j = 0; j < N; j++) for (i = 0; i < M; i++) sum += [i][j]; } return sum; 21

22 L16: Cches I Loclity Exmple #2 int sum_rry_cols(int [M][N]) { int i, j, sum = 0; } for (j = 0; j < N; j++) for (i = 0; i < M; i++) sum += [i][j]; return sum; Lyout in Memory [3] [3] [3] M = 3, N=4 [3] [3] [3] Access Pttern: stride =? 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) [3] 11) [3] 12) [3] 22

23 L16: Cches I Loclity Exmple #3 int sum_rry_3d(int [M][N][L]) { int i, j, k, sum = 0; } for (i = 0; i < N; i++) for (j = 0; j < L; j++) for (k = 0; k < M; k++) sum += [k][i][j]; return sum; Wht is wrong with this code? How cn it be fixed? [3] [3] [3] [3] [3] [3] [3] [3] [3] m = 0 m = 2 m = 1 23

24 L16: Cches I Loclity Exmple #3 int sum_rry_3d(int [M][N][L]) { int i, j, k, sum = 0; } for (i = 0; i < N; i++) for (j = 0; j < L; j++) for (k = 0; k < M; k++) sum += [k][i][j]; return sum; Wht is wrong with this code? How cn it be fixed? Lyout in Memory (M =?, N = 3, L = 4) [3] [3] [3] [3] [3] [3]

25 L16: Cches I Cche Performnce Metrics Huge difference between cche hit nd cche miss Could be 100x speed difference between ccessing cche nd min memory (mesured in clock cycles) Miss Rte (MR) Frction of memory references not found in cche (misses / ccesses) = 1 - Hit Rte Hit Time (HT) Time to deliver block in the cche to the processor Includes time to determine whether the block is in the cche Miss Penlty (MP) Additionl time required becuse of miss 25

26 L16: Cches I Cche Performnce Two things hurt the performnce of cche: Miss rte nd miss penlty Averge Memory Access Time (AMAT): verge time to ccess memory considering both hits nd misses AMAT = Hit time + Miss rte Miss penlty (bbrevited AMAT = HT + MR MP) AMAT= HR*HT + MR(HT + MP) = HT(HR+MR) + MR*MP = HT(1) + MR*MP 99% hit rte twice s good s 97% hit rte! Assume HT of 1 clock cycle nd MP of 100 clock cycles 97%: AMAT = 99%: AMAT = 26

27 L16: Cches I Question ps= pico second = Processor specs: 200 ps clock, MP of 50 clock cycles, MR of 0.02 misses/instruction, nd HT of 1 clock cycle AMAT = Which improvement would be best for AMAT? A. 190 ps clock B. Miss penlty of 40 clock cycles C. MR of misses/instruction 27

28 L16: Cches I Cn we hve more thn one cche? Why would we wnt to do tht? Avoid going to memory! Typicl performnce numbers: Miss Rte L1 MR = 3-10% L2 MR = Quite smll (e.g. < 1%), depending on prmeters, etc. Hit Time L1 HT = 4 clock cycles L2 HT = 10 clock cycles Miss Penlty P = cycles for missing in L2 & going to min memory Trend: incresing! 28

29 L16: Cches I Memory Hierrchies Some fundmentl nd enduring properties of hrdwre nd softwre systems: Fster storge technologies lmost lwys cost more per byte nd hve lower cpcity The gps between memory technology speeds re widening True for: registers cche, cche DRAM, DRAM disk, etc. Well-written progrms tend to exhibit good loclity These properties complement ech other beutifully They suggest n pproch for orgnizing memory nd storge systems known s memory hierrchy 29

30 L16: Cches I An Exmple Memory Hierrchy <1 ns 5-10 s registers Smller, fster, costlier per byte 5-10 ns 1 ns on-chip L1 cche (SRAM) off-chip L2 cche (SRAM) 1-2 min Lrger, slower, cheper per byte 100 ns 150,000 ns 10,000,000 ns (10 ms) SSD Disk min memory (DRAM) locl secondry storge (locl disks) min 31 dys 66 months = 5.5 yers ms remote secondry storge (distributed file systems, web servers) 1-15 yers 30

31 L16: Cches I An Exmple Memory Hierrchy Smller, fster, costlier per byte registers on-chip L1 cche (SRAM) off-chip L2 cche (SRAM) CPU registers hold words retrieved from L1 cche L1 cche holds cche lines retrieved from L2 cche L2 cche holds cche lines retrieved from min memory Lrger, slower, cheper per byte min memory (DRAM) locl secondry storge (locl disks) remote secondry storge (distributed file systems, web servers) Min memory holds disk blocks retrieved from locl disks Locl disks hold files retrieved from disks on remote network servers 31

32 L16: Cches I An Exmple Memory Hierrchy Smller, fster, costlier per byte registers on-chip L1 cche (SRAM) off-chip L2 cche (SRAM) explicitly progrm-controlled (e.g. refer to exctly %rx, %rbx) progrm sees memory ; hrdwre mnges cching trnsprently Lrger, slower, cheper per byte min memory (DRAM) locl secondry storge (locl disks) remote secondry storge (distributed file systems, web servers) 32

33 L16: Cches I Memory Hierrchies Fundmentl ide of memory hierrchy: For ech level k, the fster, smller device t level k serves s cche for the lrger, slower device t level k+1 Why do memory hierrchies work? Becuse of loclity, progrms tend to ccess the dt t level k more often thn they ccess the dt t level k+1 Thus, the storge t level k+1 cn be slower, nd thus lrger nd cheper per bit Big Ide: The memory hierrchy cretes lrge pool of storge tht costs s much s the chep storge ner the bottom, but tht serves dt to progrms t the rte of the fst storge ner the top 33

34 L16: Cches I Intel Core i7 Cche Hierrchy Processor pckge Core 0 Regs Core 3 Regs Block size: 64 bytes for ll cches L1 d-cche L1 i-cche L1 d-cche L1 i-cche L1 i-cche nd d-cche: 32 KiB, 8-wy, Access: 4 cycles L2 unified cche L2 unified cche L2 unified cche: 256 KiB, 8-wy, Access: 11 cycles L3 unified cche (shred by ll cores) L3 unified cche: 8 MiB, 16-wy, Access: cycles Min memory 34

35 L16: Cches I Summry Memory Hierrchy Successively higher levels contin most used dt from lower levels Exploits temporl nd sptil loclity Cches re intermedite storge levels used to optimize dt trnsfers between ny system elements with different chrcteristics Cche Performnce Idel cse: found in cche (hit) Bd cse: not found in cche (miss), serch in next level Averge Memory Access Time (AMAT) = HT + MR MP Hurt by Miss Rte nd Miss Penlty 35

Caches I. CSE 351 Autumn Instructor: Justin Hsia

Caches I. CSE 351 Autumn Instructor: Justin Hsia L01: Intro, L01: L16: Combintionl Introduction Cches I Logic CSE369, CSE351, Autumn 2016 Cches I CSE 351 Autumn 2016 Instructor: Justin Hsi Teching Assistnts: Chris M Hunter Zhn John Kltenbch Kevin Bi

More information

Caches I. CSE 351 Autumn 2018

Caches I. CSE 351 Autumn 2018 Cches I CSE 351 Autumn 2018 Instructors: Mx Willsey Luis Ceze Teching Assistnts: Britt Henderson Luks Joswik Josie Lee Wei Lin Dniel Snitkovsky Luis Veg Kory Wtson Ivy Yu Alt text: I looked t some of the

More information

Caches I. CSE 351 Autumn Instructor: Justin Hsia

Caches I. CSE 351 Autumn Instructor: Justin Hsia L16: Cches I Cches I CSE 351 Autumn 2017 Instructor: Justin Hsi Teching Assistnts: Lucs Wotton Michel Zhng Prker DeWilde Ryn Wong Sm Gehmn Sm Wolfson Svnn Yee Vinny Plnippn Alt text: I looked t some of

More information

Roadmap. Java: Assembly language: OS: Machine code: Computer system:

Roadmap. Java: Assembly language: OS: Machine code: Computer system: Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp %rbp 0111010000011000

More information

Computer Systems CSE 410 Autumn Memory Organiza:on and Caches

Computer Systems CSE 410 Autumn Memory Organiza:on and Caches Computer Systems CSE 410 Autumn 2013 10 Memory Organiza:on and Caches 06 April 2012 Memory Organiza?on 1 Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c);

More information

Virtual Memory I. CSE 351 Spring Instructor: Ruth Anderson

Virtual Memory I. CSE 351 Spring Instructor: Ruth Anderson Virtual Memory I CSE 35 Spring 27 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Midterms Graded If you did

More information

Data III & Integers I

Data III & Integers I Data III & Integers I CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Everyone has VM

More information

Compiler-Assisted Cache Replacement

Compiler-Assisted Cache Replacement LCPC 3 Formulting The Prolem of Compiler-Assisted Cche Replcement Hongo Yng LCPC 3 Agend Bckground: Memory hierrchy, ISA with cche hints Prolem definition: How should compiler give cche hint to minimize

More information

Problem: Processor- Memory Bo<leneck

Problem: Processor- Memory Bo<leneck Storage Hierarchy Instructor: Sanjeev Se(a 1 Problem: Processor- Bo

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

CSE351: Memory, Data, & Addressing I

CSE351: Memory, Data, & Addressing I CSE351: Memory, Data, & Addressing I CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis http://xkcd.com/138/

More information

Lecture 15: Caches and Optimization Computer Architecture and Systems Programming ( )

Lecture 15: Caches and Optimization Computer Architecture and Systems Programming ( ) Systems Group Department of Computer Science ETH Zürich Lecture 15: Caches and Optimization Computer Architecture and Systems Programming (252-0061-00) Timothy Roscoe Herbstsemester 2012 Last time Program

More information

Caches Spring 2016 May 4: Caches 1

Caches Spring 2016 May 4: Caches 1 May 4: Caches 1 Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: Computer system: get_mpg: pushq movq... popq ret

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Memory Hierarchy. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Memory Hierarchy. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Memory Hierarchy Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Time (ns) The CPU-Memory Gap The gap widens between DRAM, disk, and CPU speeds

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

MIPS I/O and Interrupt

MIPS I/O and Interrupt MIPS I/O nd Interrupt Review Floting point instructions re crried out on seprte chip clled coprocessor 1 You hve to move dt to/from coprocessor 1 to do most common opertions such s printing, clling functions,

More information

+ Random-Access Memory (RAM)

+ Random-Access Memory (RAM) + Memory Subsystem + Random-Access Memory (RAM) Key features RAM is traditionally packaged as a chip. Basic storage unit is normally a cell (one bit per cell). Multiple RAM chips form a memory. RAM comes

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single

More information

L14: Structs and Alignment. Structs and Alignment. CSE 351 Spring Instructor: Ruth Anderson

L14: Structs and Alignment. Structs and Alignment. CSE 351 Spring Instructor: Ruth Anderson Structs and Alignment CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Lab 2 due TONIGHT

More information

Caches II. CSE 351 Spring Instructor: Ruth Anderson

Caches II. CSE 351 Spring Instructor: Ruth Anderson Caches II CSE 35 Spring 27 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Office Hours Changes check calendar!!

More information

Systems Programming and Computer Architecture ( ) Timothy Roscoe

Systems Programming and Computer Architecture ( ) Timothy Roscoe Systems Group Department of Computer Science ETH Zürich Systems Programming and Computer Architecture (252-0061-00) Timothy Roscoe Herbstsemester 2016 AS 2016 Caches 1 16: Caches Computer Architecture

More information

Problem: Processor Memory BoJleneck

Problem: Processor Memory BoJleneck Today Memory hierarchy, caches, locality Cache organiza:on Program op:miza:ons that consider caches CSE351 Inaugural Edi:on Spring 2010 1 Problem: Processor Memory BoJleneck Processor performance doubled

More information

Roadmap. Java: Assembly language: OS: Machine code: Computer system:

Roadmap. Java: Assembly language: OS: Machine code: Computer system: Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp %rbp 0111010000011000

More information

Stack Manipulation. Other Issues. How about larger constants? Frame Pointer. PowerPC. Alternative Architectures

Stack Manipulation. Other Issues. How about larger constants? Frame Pointer. PowerPC. Alternative Architectures Other Issues Stck Mnipultion support for procedures (Refer to section 3.6), stcks, frmes, recursion mnipulting strings nd pointers linkers, loders, memory lyout Interrupts, exceptions, system clls nd conventions

More information

Caches II CSE 351 Spring #include <yoda.h> int is_try(int do_flag) { return!(do_flag!do_flag); }

Caches II CSE 351 Spring #include <yoda.h> int is_try(int do_flag) { return!(do_flag!do_flag); } Caches II CSE 351 Spring 2018 #include int is_try(int do_flag) { return!(do_flag!do_flag); } Memory Hierarchies Some fundamental and enduring properties of hardware and software systems: Faster

More information

Java and C I. CSE 351 Spring Instructor: Ruth Anderson

Java and C I. CSE 351 Spring Instructor: Ruth Anderson Java and C I CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Homework 5 Due TONIGHT Wed

More information

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe CSCI 0 fel Ferreir d Silv rfsilv@isi.edu Slides dpted from: Mrk edekopp nd Dvid Kempe LOG STUCTUED MEGE TEES Series Summtion eview Let n = + + + + k $ = #%& #. Wht is n? n = k+ - Wht is log () + log ()

More information

Locality. CS429: Computer Organization and Architecture. Locality Example 2. Locality Example

Locality. CS429: Computer Organization and Architecture. Locality Example 2. Locality Example Locality CS429: Computer Organization and Architecture Dr Bill Young Department of Computer Sciences University of Texas at Austin Principle of Locality: Programs tend to reuse data and instructions near

More information

Java and C II. CSE 351 Spring Instructor: Ruth Anderson

Java and C II. CSE 351 Spring Instructor: Ruth Anderson Java and C II CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Lab 5 Due TONIGHT! Fri 6/2

More information

Assembly Programming IV

Assembly Programming IV Assembly Programming IV CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis 1 Administrivia Homework 2 due

More information

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers? Questions About Numbers Number Systems nd Arithmetic or Computers go to elementry school How do you represent negtive numbers? frctions? relly lrge numbers? relly smll numbers? How do you do rithmetic?

More information

Allocator Basics. Dynamic Memory Allocation in the Heap (malloc and free) Allocator Goals: malloc/free. Internal Fragmentation

Allocator Basics. Dynamic Memory Allocation in the Heap (malloc and free) Allocator Goals: malloc/free. Internal Fragmentation Alloctor Bsics Dynmic Memory Alloction in the Hep (mlloc nd free) Pges too corse-grined for llocting individul objects. Insted: flexible-sized, word-ligned blocks. Allocted block (4 words) Free block (3

More information

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single

More information

ECEN 468 Advanced Logic Design Lecture 36: RTL Optimization

ECEN 468 Advanced Logic Design Lecture 36: RTL Optimization ECEN 468 Advnced Logic Design Lecture 36: RTL Optimiztion ECEN 468 Lecture 36 RTL Design Optimiztions nd Trdeoffs 6.5 While creting dtpth during RTL design, there re severl optimiztions nd trdeoffs, involving

More information

Caches II. CSE 351 Autumn Instructor: Justin Hsia

Caches II. CSE 351 Autumn Instructor: Justin Hsia Caches II CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan Administrivia Homework

More information

The Distributed Data Access Schemes in Lambda Grid Networks

The Distributed Data Access Schemes in Lambda Grid Networks The Distributed Dt Access Schemes in Lmbd Grid Networks Ryot Usui, Hiroyuki Miygi, Yutk Arkw, Storu Okmoto, nd Noki Ymnk Grdute School of Science for Open nd Environmentl Systems, Keio University, Jpn

More information

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Instructor: Adm Sheffer. TA: Cosmin Pohot. 1pm Mondys, Wednesdys, nd Fridys. http://mth.cltech.edu/~2015-16/2term/m006/ Min ook: Introduction to Grph

More information

12-B FRACTIONS AND DECIMALS

12-B FRACTIONS AND DECIMALS -B Frctions nd Decimls. () If ll four integers were negtive, their product would be positive, nd so could not equl one of them. If ll four integers were positive, their product would be much greter thn

More information

Memory Hierarchy. Computer Systems Organization (Spring 2017) CSCI-UA 201, Section 3. Instructor: Joanna Klukowska

Memory Hierarchy. Computer Systems Organization (Spring 2017) CSCI-UA 201, Section 3. Instructor: Joanna Klukowska Memory Hierarchy Computer Systems Organization (Spring 2017) CSCI-UA 201, Section 3 Instructor: Joanna Klukowska Slides adapted from Randal E. Bryant and David R. O Hallaron (CMU) Mohamed Zahran (NYU)

More information

Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms Distriuted Systems Principles nd Prdigms Chpter 11 (version April 7, 2008) Mrten vn Steen Vrije Universiteit Amsterdm, Fculty of Science Dept. Mthemtics nd Computer Science Room R4.20. Tel: (020) 598 7784

More information

Memory Hierarchy. Cache Memory Organization and Access. General Cache Concept. Example Memory Hierarchy Smaller, faster,

Memory Hierarchy. Cache Memory Organization and Access. General Cache Concept. Example Memory Hierarchy Smaller, faster, Memory Hierarchy Computer Systems Organization (Spring 2017) CSCI-UA 201, Section 3 Cache Memory Organization and Access Instructor: Joanna Klukowska Slides adapted from Randal E. Bryant and David R. O

More information

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

In the last lecture, we discussed how valid tokens may be specified by regular expressions. LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.

More information

Cache Memories. From Bryant and O Hallaron, Computer Systems. A Programmer s Perspective. Chapter 6.

Cache Memories. From Bryant and O Hallaron, Computer Systems. A Programmer s Perspective. Chapter 6. Cache Memories From Bryant and O Hallaron, Computer Systems. A Programmer s Perspective. Chapter 6. Today Cache memory organization and operation Performance impact of caches The memory mountain Rearranging

More information

Creating Flexible Interfaces. Friday, 24 April 2015

Creating Flexible Interfaces. Friday, 24 April 2015 Creting Flexible Interfces 1 Requests, not Objects Domin objects re esy to find but they re not t the design center of your ppliction. Insted, they re trp for the unwry. Sequence digrms re vehicle for

More information

Memory hierarchies: caches and their impact on the running time

Memory hierarchies: caches and their impact on the running time Memory hierarchies: caches and their impact on the running time Irene Finocchi Dept. of Computer and Science Sapienza University of Rome A happy coincidence A fundamental property of hardware Different

More information

Cache memories are small, fast SRAM-based memories managed automatically in hardware. Hold frequently accessed blocks of main memory

Cache memories are small, fast SRAM-based memories managed automatically in hardware. Hold frequently accessed blocks of main memory Cache Memories Cache memories are small, fast SRAM-based memories managed automatically in hardware. Hold frequently accessed blocks of main memory CPU looks first for data in caches (e.g., L1, L2, and

More information

Lecture 12. Memory Design & Caches, part 2. Christos Kozyrakis Stanford University

Lecture 12. Memory Design & Caches, part 2. Christos Kozyrakis Stanford University Lecture 12 Memory Design & Caches, part 2 Christos Kozyrakis Stanford University http://eeclass.stanford.edu/ee108b 1 Announcements HW3 is due today PA2 is available on-line today Part 1 is due on 2/27

More information

Rational Numbers---Adding Fractions With Like Denominators.

Rational Numbers---Adding Fractions With Like Denominators. Rtionl Numbers---Adding Frctions With Like Denomintors. A. In Words: To dd frctions with like denomintors, dd the numertors nd write the sum over the sme denomintor. B. In Symbols: For frctions c nd b

More information

CPSC 213. Polymorphism. Introduction to Computer Systems. Readings for Next Two Lectures. Back to Procedure Calls

CPSC 213. Polymorphism. Introduction to Computer Systems. Readings for Next Two Lectures. Back to Procedure Calls Redings for Next Two Lectures Text CPSC 213 Switch Sttements, Understnding Pointers - 2nd ed: 3.6.7, 3.10-1st ed: 3.6.6, 3.11 Introduction to Computer Systems Unit 1f Dynmic Control Flow Polymorphism nd

More information

CS 240 Stage 3 Abstractions for Practical Systems

CS 240 Stage 3 Abstractions for Practical Systems CS 240 Stage 3 Abstractions for Practical Systems Caching and the memory hierarchy Operating systems and the process model Virtual memory Dynamic memory allocation Victory lap Memory Hierarchy: Cache Memory

More information

Memory, Data, & Addressing I

Memory, Data, & Addressing I Memory, Data, & Addressing I CSE 351 Autumn 2017 Instructor: Justin Hsia Teaching Assistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/953/

More information

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Adm Sheffer. Office hour: Tuesdys 4pm. dmsh@cltech.edu TA: Victor Kstkin. Office hour: Tuesdys 7pm. 1:00 Mondy, Wednesdy, nd Fridy. http://www.mth.cltech.edu/~2014-15/2term/m006/

More information

Course Administration

Course Administration /4/7 Spring 7 EE 363: Computer Orgniztion Arithmetic for Computers Numer Representtion & ALU Avinsh Kodi Deprtment of Electricl Engineering & Computer Science Ohio University, Athens, Ohio 457 E-mil: kodi@ohio.edu

More information

Cache Memory and Performance

Cache Memory and Performance Cache Memory and Performance Cache Performance 1 Many of the following slides are taken with permission from Complete Powerpoint Lecture Notes for Computer Systems: A Programmer's Perspective (CS:APP)

More information

Outline CS 412/413. Function calls. Stack layout. Tiling a call. Two translations

Outline CS 412/413. Function calls. Stack layout. Tiling a call. Two translations CS 412/413 Introduction to Compilers nd Trnsltors Cornell University Andrew Myers Outline Implementing function clls Implementing functions Optimizing wy the pointer Dynmiclly-llocted structures strings

More information

COMP 423 lecture 11 Jan. 28, 2008

COMP 423 lecture 11 Jan. 28, 2008 COMP 423 lecture 11 Jn. 28, 2008 Up to now, we hve looked t how some symols in n lphet occur more frequently thn others nd how we cn sve its y using code such tht the codewords for more frequently occuring

More information

CMSC 331 First Midterm Exam

CMSC 331 First Midterm Exam 0 00/ 1 20/ 2 05/ 3 15/ 4 15/ 5 15/ 6 20/ 7 30/ 8 30/ 150/ 331 First Midterm Exm 7 October 2003 CMC 331 First Midterm Exm Nme: mple Answers tudent ID#: You will hve seventy-five (75) minutes to complete

More information

Data Space Oriented Tiling

Data Space Oriented Tiling Dt Spce Oriented Tiling Mhmut Kndemir Deprtment of Computer Science nd Engineering The Pennsylvni Stte University University Prk, PA 16802, USA kndemir@cse.psu.edu Abstrct. An optimizing compiler cn ply

More information

Data III & Integers I

Data III & Integers I Data III & Integers I CSE 351 Autumn 2016 Instructor: Justin Hsia Teaching Assistants: Chris Ma Hunter Zahn John Kaltenbach Kevin Bi Sachin Mehta Suraj Bhat Thomas Neuman Waylon Huang Xi Liu Yufang Sun

More information

Structs and Alignment CSE 351 Spring

Structs and Alignment CSE 351 Spring Structs and Alignment CSE 351 Spring 2018 http://xkcd.com/1168/ Administrivia Homework 3 due Wednesday Lab 3 released, due next week Lab 2 and midterm will be graded this week [in that order] 2 Roadmap

More information

CS3350B Computer Architecture

CS3350B Computer Architecture CS3350B Computer Architecture Winter 2015 Lecture 3.1: Memory Hierarchy: What and Why? Marc Moreno Maza www.csd.uwo.ca/courses/cs3350b [Adapted from lectures on Computer Organization and Design, Patterson

More information

Virtual Memory I. CSE 351 Winter Instructor: Mark Wyse

Virtual Memory I. CSE 351 Winter Instructor: Mark Wyse http://rebrn.com/re/bad-chrome-6282/ Virtual Memory I CSE 35 Winter 28 Instructor: Mark Wyse Teaching Assistants: Kevin Bi Parker DeWilde Emily Furst Sarah House Waylon Huang Vinny Palaniappan Administrative

More information

Compilers Spring 2013 PRACTICE Midterm Exam

Compilers Spring 2013 PRACTICE Midterm Exam Compilers Spring 2013 PRACTICE Midterm Exm This is full length prctice midterm exm. If you wnt to tke it t exm pce, give yourself 7 minutes to tke the entire test. Just like the rel exm, ech question hs

More information

Roadmap. Java: Assembly language: OS: Machine code: Computer system:

Roadmap. Java: Assembly language: OS: Machine code: Computer system: Roadmap C: car *c = malloc(sizeof(car)); c->miles = 100; c->gals = 17; float mpg = get_mpg(c); free(c); Assembly language: Machine code: Computer system: get_mpg: pushq movq... popq ret %rbp %rsp, %rbp

More information

Data sharing in OpenMP

Data sharing in OpenMP Dt shring in OpenMP Polo Burgio polo.burgio@unimore.it Outline Expressing prllelism Understnding prllel threds Memory Dt mngement Dt cluses Synchroniztion Brriers, locks, criticl sections Work prtitioning

More information

Outline. Tiling, formally. Expression tile as rule. Statement tiles as rules. Function calls. CS 412 Introduction to Compilers

Outline. Tiling, formally. Expression tile as rule. Statement tiles as rules. Function calls. CS 412 Introduction to Compilers CS 412 Introduction to Compilers Andrew Myers Cornell University Lectur8 Finishing genertion 9 Mr 01 Outline Tiling s syntx-directed trnsltion Implementing function clls Implementing functions Optimizing

More information

)

) Chpter Five /SOLUTIONS Since the speed ws between nd mph during this five minute period, the fuel efficienc during this period is between 5 mpg nd 8 mpg. So the fuel used during this period is between

More information

Arrays. CSE 351 Autumn Instructor: Justin Hsia

Arrays. CSE 351 Autumn Instructor: Justin Hsia rrays CSE 351 utumn 2017 Instructor: Justin Hsia Teaching ssistants: Lucas Wotton Michael Zhang Parker DeWilde Ryan Wong Sam Gehman Sam Wolfson Savanna Yee Vinny Palaniappan http://xkcd.com/1270/ dministrivia

More information

Today s Lecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Recursive Example. Review: The C / C++ code. Recursive Example (Continued)

Today s Lecture. Basics of Logic Design: Boolean Algebra, Logic Gates. Recursive Example. Review: The C / C++ code. Recursive Example (Continued) Tod s Lecture Bsics of Logic Design: Boolen Alger, Logic Gtes Alvin R. Leeck CPS 4 Lecture 8 Homework #2 Due Ferur 3 Outline Review (sseml recursion) Building the uilding locks Logic Design Truth tles,

More information

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

CS 61C: Great Ideas in Computer Architecture. Direct Mapped Caches CS 61C: Great Ideas in Computer Architecture Direct Mapped Caches Instructor: Justin Hsia 7/05/2012 Summer 2012 Lecture #11 1 Review of Last Lecture Floating point (single and double precision) approximates

More information

Data Flow on a Queue Machine. Bruno R. Preiss. Copyright (c) 1987 by Bruno R. Preiss, P.Eng. All rights reserved.

Data Flow on a Queue Machine. Bruno R. Preiss. Copyright (c) 1987 by Bruno R. Preiss, P.Eng. All rights reserved. Dt Flow on Queue Mchine Bruno R. Preiss 2 Outline Genesis of dt-flow rchitectures Sttic vs. dynmic dt-flow rchitectures Pseudo-sttic dt-flow execution model Some dt-flow mchines Simple queue mchine Prioritized

More information

COMPUTER EDUCATION TECHNIQUES, INC. (MS_W2K3_SERVER ) SA:

COMPUTER EDUCATION TECHNIQUES, INC. (MS_W2K3_SERVER ) SA: In order to lern which questions hve een nswered correctly: 1. Print these pges. 2. Answer the questions. 3. Send this ssessment with the nswers vi:. FAX to (212) 967-3498. Or. Mil the nswers to the following

More information

Data III & Integers I

Data III & Integers I Data III & Integers I CSE 351 Autumn 2018 Instructor: Justin Hsia Teaching Assistants: Akshat Aggarwal An Wang Andrew Hu Brian Dai Britt Henderson James Shin Kevin Bi Kory Watson Riley Germundson Sophie

More information

OPERATION MANUAL. DIGIFORCE 9307 PROFINET Integration into TIA Portal

OPERATION MANUAL. DIGIFORCE 9307 PROFINET Integration into TIA Portal OPERATION MANUAL DIGIFORCE 9307 PROFINET Integrtion into TIA Portl Mnufcturer: 2018 burster präzisionsmesstechnik gmbh & co kg burster präzisionsmesstechnik gmbh & co kg Alle Rechte vorbehlten Tlstrße

More information

Caches III. CSE 351 Spring Instructor: Ruth Anderson

Caches III. CSE 351 Spring Instructor: Ruth Anderson Caches III CSE 351 Spring 2017 Instructor: Ruth Anderson Teaching Assistants: Dylan Johnson Kevin Bi Linxing Preston Jiang Cody Ohlsen Yufang Sun Joshua Curtis Administrivia Office Hours Changes check

More information

Arrays. CSE 351 Autumn Instructor: Justin Hsia

Arrays. CSE 351 Autumn Instructor: Justin Hsia rrays CSE 351 utumn 2016 Instructor: Justin Hsia Teaching ssistants: Chris Ma Hunter Zahn John Kaltenbach Kevin Bi Sachin Mehta Suraj Bhat Thomas Neuman Waylon Huang Xi Liu Yufang Sun http://xkcd.com/1513/

More information

CS241 Computer Organization Spring Principle of Locality

CS241 Computer Organization Spring Principle of Locality CS241 Computer Organization Spring 2015 Principle of Locality 4-21 2015 Outline! Optimization! Memory Hierarchy Locality temporal spatial Cache Readings: CSAPP2: Chapter 5, sections 5.1-5.6; 5.13 CSAPP2:

More information

Pin-down Cache: A Virtual Memory Management Technique for Zero-copy Communication

Pin-down Cache: A Virtual Memory Management Technique for Zero-copy Communication Pin-down Cche: A Virtul Memory Mngement Technique for Zero-copy Communiction Hiroshi Tezuk, Frncis 0 Cnoll, Atsushi Hori, nd Yutk Ishikw Rel World Computing Prtnership { tezuk, ocrroll, hori, ishikw) @rwcp.or.jp

More information

Digital Design. Chapter 1: Introduction. Digital Design. Copyright 2006 Frank Vahid

Digital Design. Chapter 1: Introduction. Digital Design. Copyright 2006 Frank Vahid Chpter : Introduction Copyright 6 Why Study?. Look under the hood of computers Solid understnding --> confidence, insight, even better progrmmer when wre of hrdwre resource issues Electronic devices becoming

More information

Unit 5 Vocabulary. A function is a special relationship where each input has a single output.

Unit 5 Vocabulary. A function is a special relationship where each input has a single output. MODULE 3 Terms Definition Picture/Exmple/Nottion 1 Function Nottion Function nottion is n efficient nd effective wy to write functions of ll types. This nottion llows you to identify the input vlue with

More information

Geometric transformations

Geometric transformations Geometric trnsformtions Computer Grphics Some slides re bsed on Shy Shlom slides from TAU mn n n m m T A,,,,,, 2 1 2 22 12 1 21 11 Rows become columns nd columns become rows nm n n m m A,,,,,, 1 1 2 22

More information

From Dependencies to Evaluation Strategies

From Dependencies to Evaluation Strategies From Dependencies to Evlution Strtegies Possile strtegies: 1 let the user define the evlution order 2 utomtic strtegy sed on the dependencies: use locl dependencies to determine which ttriutes to compute

More information

Cache Memories /18-213/15-513: Introduction to Computer Systems 12 th Lecture, October 5, Today s Instructor: Phil Gibbons

Cache Memories /18-213/15-513: Introduction to Computer Systems 12 th Lecture, October 5, Today s Instructor: Phil Gibbons Cache Memories 15-213/18-213/15-513: Introduction to Computer Systems 12 th Lecture, October 5, 2017 Today s Instructor: Phil Gibbons 1 Today Cache memory organization and operation Performance impact

More information

Cache Example, System Control Flow

Cache Example, System Control Flow Cache Example, System Control Flow CSE 351 Autumn 2016 Instructor: Justin Hsia Teaching Assistants: Chris Ma Hunter Zahn John Kaltenbach Kevin Bi Sachin Mehta Suraj Bhat Thomas Neuman Waylon Huang Xi Liu

More information

Stack. A list whose end points are pointed by top and bottom

Stack. A list whose end points are pointed by top and bottom 4. Stck Stck A list whose end points re pointed by top nd bottom Insertion nd deletion tke plce t the top (cf: Wht is the difference between Stck nd Arry?) Bottom is constnt, but top grows nd shrinks!

More information

CS 61C: Great Ideas in Computer Architecture. The Memory Hierarchy, Fully Associative Caches

CS 61C: Great Ideas in Computer Architecture. The Memory Hierarchy, Fully Associative Caches CS 61C: Great Ideas in Computer Architecture The Memory Hierarchy, Fully Associative Caches Instructor: Alan Christopher 7/09/2014 Summer 2014 -- Lecture #10 1 Review of Last Lecture Floating point (single

More information

COMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples

COMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples COMPUTER SCIENCE 123 Foundtions of Computer Science 6. Tuples Summry: This lecture introduces tuples in Hskell. Reference: Thompson Sections 5.1 2 R.L. While, 2000 3 Tuples Most dt comes with structure

More information

211: Computer Architecture Summer 2016

211: Computer Architecture Summer 2016 211: Computer Architecture Summer 2016 Liu Liu Topic: Assembly Programming Storage - Assembly Programming: Recap - Call-chain - Factorial - Storage: - RAM - Caching - Direct - Mapping Rutgers University

More information

Presentation Martin Randers

Presentation Martin Randers Presenttion Mrtin Rnders Outline Introduction Algorithms Implementtion nd experiments Memory consumption Summry Introduction Introduction Evolution of species cn e modelled in trees Trees consist of nodes

More information

EECS150 - Digital Design Lecture 23 - High-level Design and Optimization 3, Parallelism and Pipelining

EECS150 - Digital Design Lecture 23 - High-level Design and Optimization 3, Parallelism and Pipelining EECS150 - Digitl Design Lecture 23 - High-level Design nd Optimiztion 3, Prllelism nd Pipelining Nov 12, 2002 John Wwrzynek Fll 2002 EECS150 - Lec23-HL3 Pge 1 Prllelism Prllelism is the ct of doing more

More information

Overview. Network characteristics. Network architecture. Data dissemination. Network characteristics (cont d) Mobile computing and databases

Overview. Network characteristics. Network architecture. Data dissemination. Network characteristics (cont d) Mobile computing and databases Overview Mobile computing nd dtbses Generl issues in mobile dt mngement Dt dissemintion Dt consistency Loction dependent queries Interfces Detils of brodcst disks thlis klfigopoulos Network rchitecture

More information

Simrad ES80. Software Release Note Introduction

Simrad ES80. Software Release Note Introduction Simrd ES80 Softwre Relese 1.3.0 Introduction This document descries the chnges introduced with the new softwre version. Product: ES80 Softwre version: 1.3.0 This softwre controls ll functionlity in the

More information

Engineer To Engineer Note

Engineer To Engineer Note Engineer To Engineer Note EE-186 Technicl Notes on using Anlog Devices' DSP components nd development tools Contct our technicl support by phone: (800) ANALOG-D or e-mil: dsp.support@nlog.com Or visit

More information