Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin.

Similar presentations


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

1 Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin

2 2

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

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

5 How Computer Memory Works

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

7 Volatility Memory can be split into two main categories: volatile and nonvolatile. 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. 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 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 ROM is the memory that stores the data permanently.
The data can be easily read from this type of memory but cannot be changed. ROM is most commonly used in devices such as calculators, laser printers, etc. ROM does not allow the random access of data, and allows sequential access of data.

10 Cache Memory 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. Cache memory is neither main memory nor second memory. DDR's are Main memory and Disk is second

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

12 Cache and Main Memory

13 Cache operation – overview
Processor does all memory operations with cache. 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. Hit – If the requested word is in cache, read or write operation is performed directly in cache, without accessing main memory. Block – minimum amount of data transferred between cache and main memory. Processor words Cache Small, fast memory blocks Main memory large, inexpensive (slow)

14 Cache Read Operation - Flowchart

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

16 Caching in contemporary processors

17

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

19 Semiconductor Memory types Volatile Non-volatile RAM ROM SRAM DRAM PROM EPROM

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

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

22 Virtual Memory 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… Virtual memory as an alternate set of memory addresses.
Programs use these virtual addresses rather than real addresses to store instructions and data. When the program is actually executed, the virtual addresses are converted into real memory addresses. Eliminate a restriction that a computer works in memory which is small and be limited.

24 Virtual Memory 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 Paging is a method of writing data to, and reading it from, secondary storage for use in main memory. 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. It also called operating system pages the data. Each time a page is needed that is not currently in memory, a page fault occurs. 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?
Virtual address can be larger than the logical address, allowing program units to be mapped to a much larger virtual address space Example: PowerPC 601 Logical address: 32 bits Virtual address: 52 bits Physical address: depends on how much memory

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

29 Terminology… Hit time: Time to access upper level of hierarchy (incl. Time to determine if it is there) – looking at desk 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 Impacts: OS design, how code is compiled, how applications are written

30 Summary Diagrams

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

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


Download ppt "Lecture 2 (Memory) Computer Organization and Assembly Language. (CSC-210) Dr. Mohammad Ammad uddin."

Similar presentations


Ads by Google