instructor: yuzhuang hu [email protected]. memory hierarchy

19
Instructor: Yuzhuang Hu [email protected]

Upload: erik-rice

Post on 28-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Instructor: Yuzhuang [email protected]

Page 2: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Memory Hierarchy

Page 3: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Some QuestionsWhen you make a program, you may assign a value of

100 to memory location with address 4. When you make another program, address 4 may store value 200. How can we run these two program at the same time?

Many users are using a computer at the same time. Each user has an illusion that he is owning the whole computer. Assume each user is allocated 4GB memory address space. What if we have 1000 users? Do we need 4GB*1000 = 4TB memory?

Page 4: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Physical Memory

Physical memory is the amount of DRAM actually installed in your computer.

Physical address space is determined by the address lines of your computer.

Page and page frame. A page contains 1k to 8k bytes.

Page 5: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 6: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 7: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Fetch an instruction

Access for the directory entry.

Access for the page table entry.

Access for the operand or instruction.

Page 8: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 9: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

Overall picture

Page 10: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

How to run a programThe machine code of a program is in the file system.

To run a program, the operating system creates a process with its own virtual address space.

The program is then loaded into this space.

The operating system then instructs the CPU to fetch the first instruction of this program.

The instruction will go through the secondary memory to higher levels of the memory hierarchy.

The portion of the address space in use will remain in the main memory.

Page 11: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 12: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

I/O Interface UnitsPeripherals are often eletro-mechanical devices whose

manner of operation is different from that of the CPU and memory.

The data-transfer rate of peripherals is usually different from the clock rate of the CPU.

Data codes and formats in peripherals differ from the word format in the CPU.

The operating modes of peripherals differ from each other.

Page 13: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

I/O bus and interface

Page 14: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 15: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 16: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 17: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 18: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy
Page 19: Instructor: Yuzhuang Hu yhu1@cs.sfu.ca. Memory Hierarchy

THANKS!