Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)

Similar presentations


Presentation on theme: "Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)"— Presentation transcript:

1 Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)

2 2

3 3 Structure - Top Level computer peripherals network System interconnection Memory I/O CPU

4 Memory and Storage Systems n Primary Memory: Storing the data that are being currently handled by the CPU; generally known as “memory”; n Secondary Memory: Storing the results and the data for future use; generally known as “storage”; n Internal Process Memory: Placed either inside the CPU or near the CPU.

5 How Computer Memory Works 5

6 Memory Hierarchy register CPU cache Main Memory Secondary Storage Server (or INTERNET) larger capacity lower speed lower cost

7 Volatility 7 Memory can be split into two main categories: volatile and nonvolatile. u Volatile memory loses any data as soon as the system is turned off; it requires constant power to remain viable. Most types of RAM fall into this category. u Nonvolatile memory does not lose its data when the system or device is turned off. A number of types of memory fall into this category. The most familiar is ROM, but Flash memory storage devices such as Compact Flash or Smart Media cards are also forms of nonvolatile memory.

8 Main Memory Unit n The main memory is referred to as the internal memory of primary memory of the computer. It is also known as Random Access Memory (RAM).

9 Read Only Memory n ROM is the memory that stores the data permanently. n The data can be easily read from this type of memory but cannot be changed. n ROM is most commonly used in devices such as calculators, laser printers, etc. n ROM does not allow the random access of data, and allows sequential access of data.

10 Cache Memory n Cache memory is a small, fast and expensive memory that stores the copies of data that needs to be accessed frequently from the main memory. n Cache memory is neither main memory nor second memory. DDR's are Main memory and Disk is second

11 Cache Operation n CPU requests contents of memory location n Check cache for this data n If present, get from cache (fast) n If not present, read required block from main memory to cache n Then deliver from cache to CPU n Cache includes tags to identify which block of main memory is in each cache slot

12 Cache and Main Memory

13 Cache operation – overview n Processor does all memory operations with cache. n Miss -- If requested word is not in cache, a block of words containing the requested word is brought to cache, and then the processor request is completed. n Hit – If the requested word is in cache, read or write operation is performed directly in cache, without accessing main memory. n Block – minimum amount of data transferred between cache and main memory. Processor Cache Small, fast memory Main memory large, inexpensive (slow) words blocks

14 Cache Read Operation - Flowchart

15 Caching n A small, high speed memory close to the CPU u Each line of cache memory can be “occupied” or “empty” u “Occupied” lines map to a memory location u Hardware cache management mechanism (potentially with software hints) u Typically used for both programs and data n Choosing victim for replacement on cache miss u FIFO u Least Recently Used, u Random

16 Caching in contemporary processors

17

18 Cache Functions n I-cache: holds instructions n D-cache: holds data n Unified cache: holds both instructions and data n Split cache: system with separate I-cache and D-cache

19 Memory types RAMROM SRAMDRAM PROMEPROM VolatileNon-volatile Semiconductor

20 Memory types n DRAM - Dynamic RAM u Data leaks out u Needs to be refreshed thousands of times per second u Only needs one transistor u Slow and less costly n SRAM - static RAM u Values don’t leak u No need to refresh u Made from 4-6 transistors u Fairly expensive, but fast and low powered

21 PROM and EPROM n PROM u A variation of a ROM is a PROM (programmable read- only memory). u PROMs are manufactured as blank chips on which data can be written with a special device called a PROM programmer n EPROM u EPROM (erasable programmable read only memory) is more advanced form of PROM. u Can be programmed and then erased (typically erased with a UV [ultra-violet light] eraser. 21

22 Virtual Memory n If your computer lacks the random access memory (RAM) needed to run a program or operation, Windows uses virtual memory to compensate

23 What is … n Virtual memory as an alternate set of memory addresses. n Programs use these virtual addresses rather than real addresses to store instructions and data. n When the program is actually executed, the virtual addresses are converted into real memory addresses. n Eliminate a restriction that a computer works in memory which is small and be limited.

24 Virtual Memory n If you receive error messages that warn of low virtual memory, you need to either add more RAM or increase the size of your paging file so that you can run the programs on your computer. Windows usually manages the size automatically, but you can manually change the size of virtual memory if the default size is not enough for your needs.

25 Paging n Paging is a method of writing data to, and reading it from, secondary storage for use in main memory. n The OS copies a certain number of pages from your storage device to main memory. When a program needs a page that is not in main memory, the OS copies the required page into memory and copies another page back to the disk. n It also called operating system pages the data. n Each time a page is needed that is not currently in memory, a Page Fault occurs. n An invalid page fault occurs when the address of the page being requested is invalid. In this case, the application is usually aborted.

26 Memory Management unit( )

27 Why Have Virtual Addresses? n Virtual address can be larger than the logical address, allowing program units to be mapped to a much larger virtual address space n Example: PowerPC 601 u Logical address: 32 bits u Virtual address: 52 bits u Physical address: depends on how much memory

28 Terminology n Block: minimum unit of information present (or not) in a multilevel hierarchy (think book) n Hit: data found in upper level (on desk) n Miss: data not found in upper level u Lower level accessed to find block (go to shelves) n Hit rate: fraction of memory accesses found on upper levels u Used to measure performance n Miss rate: fraction of memory accesses not found on upper levels (1 - hit rate)

29 Terminology… n Hit time: Time to access upper level of hierarchy (incl. Time to determine if it is there) – looking at desk n Miss penalty: Time take to replace block at upper level with block from lower level AND time to deliver block to processor – time to go to shelves and back n Impacts: OS design, how code is compiled, how applications are written

30 Summary Diagrams

31 31 Motherboard Processor SIMM / DIMM Sockets PCI Card Slots Parallel/Serial IDE Connectors PS/2 connectors USB 2.0 Sound

32 32 n IDE (Integrated Drive Electronics) n DIMM (Dual in-line memory Module) n BIOS (Basic Input/Output System) n CMOS (Complementary Metal Oxide Semiconductor) n SATA (Serial Advanced Technology Attachment) n PCI (Peripheral Component Interconnect) n VGA (Video Graphics Array) n USB (Universal Serial Bus) Abbreviations of Important terms.


Download ppt "Lecture 2 (Memory) Dr. Muhammad Ayaz Computer Organization and Assembly Language. (CSC-210)"

Similar presentations


Ads by Google