460 likes | 545 Views
CS 2 Main Memory and Backing Store. Memory address (1). Memory is “place’ to store digital signals (0 1). 0100 1000. Memory address (2). 0100 1000. 0111 1100. 0110 1010. …. …. 0000 1010. Memory can allowed Read / Write. Memory. Address = location. 0000 0000. 0000 0001. 0000 0010.
E N D
Memory address (1) Memory is “place’ to store digital signals (0 1) 0100 1000
Memory address (2) 0100 1000 0111 1100 0110 1010 …. …... 0000 1010 Memory can allowed Read / Write Memory Address = location 0000 0000 0000 0001 0000 0010 To R/W data, you must know where it is? 1111 1111
Memory address (3) 2 Address line.. What is the MEORY SIZE? 0 0 1 0000 0000 4 0 1 0000 0001 2 0000 0010 1 0 3 …. …. 1 1 ?? 1111 1111 How about 3 Address line?
Memory Size (1) 0 1 BIT 0 0 0 0 0 0 0 0 WORD? 8 BITs 1 BYTE =
Memory Size (2) ONE WORD Depends on Computer Type Table of word sizes
Memory Size (3) 1 kilobyte (1KB) = 210bytes =1024bytes 1 megabyte (1MB) = 210 KB = 220bytes 1 gigabyte (1GB) = 210 MB = 230bytes 1 Tbyte (1TB) = 210 GB = 240bytes Questions ...
CS 2.2 Exercise
Exercise 1 1. How many bits are there in 1 Mbytes? Soln: 1Mbytes = 1 x 1024 x 1024 bytes = 1048576 x 8 bits = 8388608 bits
Exercise 1 2. A Computer has 4K words of main storage. Each word comprises 24 bits. How many bytes are there in the whole memory? How address lines are required? Soln: # of bytes in whole memory = 4K x 3 bytes 12 KB # of address lines required: Since 2n 12KB , 213 = 8192 and 214 = 16384 n = 14
Exercise 1 3. A 40 Mbytes memory chip is _______ times a 512 Kbytes chip. Soln: 40MB 512 KB = 40 x 1024 KB 512 KB = 80 A 40 Mbytes memory chip is 80 times a 512 Kbytes chip.
Exercise 1 4. If the addresses of the locations of a computer are from 0 to 20000, how many address bits are required for addresssing? Soln: # of address lines required: Since 2n 20001, and 215 = 32768 n = 15
Storage ─ stores programs and data Storage Unit Main Memory Backing Store Store large amounts of data, programs and information permanentlyeven when the computer is turned off. Random Access Memory (RAM) Read Only Memory (ROM)
RAM Random Access Memory (RAM) ─ temporarily stores programs and data that are to be executed or processed by the CPU Any area of RAM can be accessed directly and immediately by the CPU.
RAM • Virtual memory • Part of the Hard disk for extending RAM • Capacity of RAM is fixed • Data not frequently used are moved to the hard disk to make room for new data • Swapping • Moving data between RAM and Hard disk • Done by the computer automatically • Transparent to user
RAM • Too much Swapping • Reduce performance of computer, or • Lead to system crash • To reduce Swapping • Increase the size of RAM
ROM Read-Only Memory (ROM) - stores the essential software of the computer system. ‘Read-only’ means ROM can be read but not changed.
ROM The contents of ROM are preset by the ROM manufacturer, and can’t be changed by users. BIOS is an example of ROM..
CMOS • Complementary Metal-Oxide Semiconductor • Contents can be changed • Non-volatile • Stores configuration about a computer, including • Capacity of the hard disk • Types of existing ports, keyboard and monitor • Current time and date • CMOS does not store programs
Cache • Small amount of high speed memory • Designed to supply CPU with the most frequently requested data and instruction • First locate in cache first, then RAM
Backing Store Why should we have secondary storage? • Large storage capacity • Permanent storage • Lower cost Secondary storage provides permanent storage for large amounts of programs and data that need not be immediately accessed by the CPU.
Magnetic Tape (1) Magnetic Tape • used for backup data in computers • sequential access
Magnetic Tape (2) File store on magnetic tape Tape File consists on Header, Data blocks and Inter Blocks Gap (IBG) SLOWER! Sequential Access To retrieve a record, you must read all record first.
Magnetic Disk (1) Magnetic Disk Hard disk drive Floppy disk Removable hard disk
Magnetic Disk (2) Magnetic Disk File
CD-ROM (1) Optical Disk Drive CD Writer CD-ROM Drive It can be used to read data from and write data to optical disks such as CD-R and CD-RW. Compact disk read-only memory Direct access (fast) Data is read-only.
CD-ROM (2) Information is stored by using a laser beam to burn holes on a thin coating of metal. Optical Disk Usage Encyclopedias Another laser beam is used to read the hole patterns. Film (VCD)
DVD • Digital Versatile Disk • DVDR, DVDRW, DVD-RAM • 4.7GB storage • DL (Dual / Double Layer) • 8.5GB storage
Semi-conducting Media(Flash memory cards) • Uses semi-conductor to record data. • High speed in transferring data, small in size, portable and no mechanical movement. • Becomes popular. • E.g.: CF, MS, SD, MMC, xD, T-flash, etc. Web site of SanDisk
Removable Disks • Provide both the storage capacity and fact access time of hard disk and the probability of floppy disks. • Examples: • Iomega’s ZIP (100MB) • JAZ (1-2 GB) • Imation’s Superdisk (120MB)
Buffer Disk/ Tape CPU • Buffer is needed. • Usually is RAM or Cache. Speed of CPU is MUCH Faster than any Backing Store
Comparison between different backing store Expensive Cheap
Speed of CPU Capacity of RAM Speed of hard disk Free space of hard disk Width of bus system Speed of peripherals Capability of Video cards Cache memory Factors affect the performance of computer
CS 2.4 Exercise
Exercise 2 • Which of the following are the units of data organisation for a magnetic disk? • Cylinder • File • Record • Sector • Track
Exercise 2 2. Which of the following storage media is non-erasable? • Random access memory • Magnetic tape • Hard disk • Read only memory • Floppy disk
Exercise 2 3. A secondary storage device is used because (1) it provides non-volatile storage; (2) it can store a large amount of data; (3) it runs at a great speed.