You are on page 1of 9

Computer Organization

Module3
Memory unit design with special emphasis on implementation of CPU-memory interfacing. [2L] Memory organization, static and dynamic memory, memory hierarchy, associative memory. [3L] Cache memory, Virtual memory. Data path design for read/write access. [5L]

Primary Memory (Main Memory)


Primary memory is used for input/output operations, manipulation of text and calculation operations, logic/ comparison operation, storage and retrieval operations. Primary memory is made of semiconductor device. Primary memory is faster than secondary memory. Storage capacity of primary memory is smaller. Primary memory is expensive than secondary memory. Primary memory consumes less power. Primary memory stores programs along with data, which are to be executed.

Secondary Memory (Auxiliary Memory)


Secondary memory used for storage and back-up operation. The access time is considerably greater for secondary memory than for primary memory. Secondary memory is made of magnetic or optical device. Secondary memory is slower than primary memory. Storage capacity of secondary memory is larger. Secondary memory is cheaper than secondary memory. Secondary memory stores operating system, data files, compilers, assemblers, application programs etc. RAM (Random Access Memory) RAM is a semiconductor memory that stores binary information temporarily during the operation of the computer. It is called Random Access Memory because any of the locations on a chip can be randomly selected and used to directly store and retrieve data and instructions. RAM is a volatile memory, i.e. it depends on a steady power supply and all the contents are destroyed if the power is turned off. CPU can write into or read from this memory. There are two types of RAM Static RAM and Dynamic RAM. ROM (Read Only Memory) ROM is semiconductor memory that stores binary information permanently. The information can be read from this memory but it does not accept any input data or instructions from the users; i.e. it cannot be altered. ROM is a nonvolatile memory; it retains stored information even if the power is turned off. The contents of ROM are permanent or semi-permanent. In embedded computers, which frequently do not have disk drives, all of the required software may be stored in ROM. Software stored in ROM is often called firmware, because it is notionally more like hardware than software. There are three types of ROM: PROM, EPROM and EEPROM. Suman Halder, Assistant Professor of CSE Department, CIEM Page 88

Computer Organization

Table: Differences between ROM and RAM Properties ROM Volatile Non-volatile Memory Read/write operation Only read operation Data erase Memory location access SRAM (Static RAM) Storing data cannot be erased Any Memory location access in random manner

RAM Volatile Memory Read and write both operation Storing data can be erased Any Memory location also access in random manner

It is a type of computer memory that retains its contents as long as power is supplied. It does not need constant refreshment like Dynamic RAM chips. A Static RAM chip can only store about one fourth of the information that a Dynamic RAM of the same complexity can hold. Static RAM, with access times of 15 to 30 nanoseconds, is much faster than Dynamic RAM, at 60 nanoseconds or more. It is often used in caches; however Static RAM is 4-5 times as expensive as Dynamic RAM.

Diagram of a Static Memory Cell based on a flip-flop Each cell of a Static RAM is implemented using a flip-flop which is implemented using several MOSFET transistors. External power is required to operate the transistors. As long as the external power is applied the static memory cell retains the data. The circuit of a single flip-flop based cell which can store a binary 0 or 1 is shown in above figure. DRAM (Dynamic RAM) A common type of computer memory that needs to be refreshed every millisecond, during that time they cannot be read by the processor. DRAM chips are small, simple, cheap, and easy to make and hold four time as much information as a Static RAM chip of similar complexity. However, they are slower than Static RAM.

Suman Halder, Assistant Professor of CSE Department, CIEM

Page 89

Computer Organization
Differences between SRAM and DRAM:
1. Standard DRAM does not have a fast-enough access time (the fastest is currently about 70 ns) , While the SRAM is faster so the DRAM is used as the main memory in the computers and the SRAM is used in the cache memory of the computers. 2. Because the DRAM capacitor loses its charge over time, and needs to have its charge refreshed at regular intervals. Thus, dynamic memories are accompanied by controller circuits to rewrite the bit and refresh the stored charge on a regular basis. But the SRAM does not need such a controller. 3. The SRAM requires four to six transistors while the DRAM is much simpler, it can be implemented with three or one transistor. So more memory cells can be put in a single chip. And the total size of the DRAM is larger than the size of SRAM. 4. Neither SRAMs nor DRAMs retain information when power is removed (volatile); but with battery back-up, SRAMs can store important configuration information when main power is removed because they don't require refreshing. 5. The power consumed per bit of DRAM is less than power consumed per bit for SRAM. The power dissipated per bit of DRAM is less than 0.05mW while the SRAM consumes 0.2mW. 6. The DRAM is less expensive per bit than SRAM. 7. The SRAM has the property of being "bi-stable" in other words, as long as a current is applied to it, it can retain its on/off state. 8. DRAM does not have a fast-enough access time (the fastest is currently about 70 ns) while the SRAM is faster so it is used as cache memory to reduce the accessing to the DRAM (main memory). Table: Differences between SRAM and DRAM Properties SRAM Access time Faster than DRAM, 15 to 30 nanoseconds. Cost SRAM 4 to 5 times more expensive than DRAM Refreshment Refreshment not required. Storing capacity SRAM can store of information that a DRAM of the same complexity can hold.

DRAM Slower than SRAM, 60 nanoseconds or more Cheap than SRAM Refreshment required in every millisecond. DRAM holds four time as much information as a SRAM chip of similar complexity.

SDRAM (Synchronous Dynamic RAM) This is a type of enhanced memory that allows data to be transferred at any point in the systems clock cycle rather than just at certain point. This makes for dramatically faster overall memory performance. NVRAM (Non-Volatile RAM) A high speed static RAM and EEPROM are packed into a single IC to form a nonvolatile RAM. When power is gone the entire contents of the memory are quickly transferred automatically in parallel in the EE-PROM and stored data from EE-PROM are transferred back into RAM when the power is turned on and can be read from RAM. The advantage of NVRAM is that a battery Suman Halder, Assistant Professor of CSE Department, CIEM Page 90

Computer Organization
backup is not needed to save the working data in the event of power failure. Example of NVRAM is Intel 2004. PROM (Programmable Read Only Memory) This memory has nichrome or polysilicon wires arranged in a matrix; these wires can be functionally viewed as diodes or fuses. This memory can be programmed by the user for converting critical and lengthy operations into micro programs that are fused into a chip. Once they are in a hardware form, they can be executed at a very high speed. Once operations have been written into a PROM chip, they cannot be altered. Permanent program, data or any other kinds of information can be store in a PROM. An example of PROM is 74S287. EPROM (Erasable Programmable Read Only Memory) EPROM is a memory chip that maintains its contents without electrical power. It can be erased and reprogrammed by removing a protective cover and exposing the chip to high intensity short wave ultraviolet light for some time before it can accept any new contents. The technique of erasing contents is not easy; EPROM IC has to be removed from computer for exposure to the ultraviolet light. EPROMs are used to store programs which are permanent but need updating. EPROMs are cheap and reliable. EPROM uses MOS technology. They store 1 as charge and 0 as no charge on the insulated floating-gate of the transistor. The ultraviolet light causes to leak off the charge. Thus the data are erased and allows user to reprogram the EPROM. For programming it requires high voltage 30V or higher but for read operation it needed only 5V. EEPROM (Electrically Erasable Programmable Read Only Memory) A memory chip that maintains its contents without electrical power and whose contents can be erased and reprogrammed with special electrical pulses either within the computer or from external source. It is also known as EAPROM (Electrically Alterable PROM). The chip can be erasing in shorter time compared to EPROM. The technique of erasing contents is easy; EPROM IC need not be removed from computer for erasing. Example of EEPROM is Intel 2816A Flash Memory A special form of nonvolatile EEPROM that can erase at signal levels normally found inside the PC, so that you can reprogram the contents with whatever you like without pulling the chips out of your computer. Also once flash memory has been programmed, you can remove the expansion board it is mounted on and plug it to another computer if you wish. Hard Disk Seagate introduced the first hard disk for PCs in 1979, which held 5 MB of data. The Hard Disk holds the operating system, which boots the system, stores the different multi-megabyte application and files that we rely on, and even provides virtual memory for systems lean on RAM. Hard disk performance also has a profound effect on overall system performance. Hard Disk also called as Hard Drive or Hard Disk drive or Fixed Disk drive. Suman Halder, Assistant Professor of CSE Department, CIEM Page 91

Computer Organization

Hard disk is a storage device that uses a set of thin, flat, rotating, magnetically coated circular objects made of metal or glass called platters to store data or programs. A central spindle supports the platters. A small gap separates each platter from its neighbors, which allows a read-write head mounted on an actuator arm to fit between the platters. A typical hard disk platter rotates at 3600 rpm, and the read/write heads (the electromagnetic device used to read and write to and from magnetic media) float on a cushion of air from 10 to 25 millionths of inch thick so that the heads never come into contact with the recording surface. The whole unit is hermetically sealed to prevent airborne contaminants from entering and interfering with these close tolerances. The speed of storing information of hard Disk is called average access time. Average access time measurement in millisecond. Hard disk drives usually have more than one platter and there are two heads for each platter of the hard drive (one on the top and one on the bottom). The heads read and write the data on the platter. A tiny dust particle could cause a head crash. Hard disk is very vulnerable to vibrations: a minor bump can make the head crash into disks surface. The damage usually cannot be repaired, causing data loss and hard disk damage. When the data is read from or written on a portion of a track of disk, the read/write head moves to the desired track from its current position. After reaching the desired track, there is a rotational delay in bringing the specified portion of the track beneath the head. The rotational delay is called latency. The time required in the movement of the head, is known as seek time. The access time for a data is the sum of seek time and latency. Usually manufacturers specify the average access time; since the actual seek time varies based upon where the heads are and where the next bit of data is located. A hard disk is composed of certain basic components: Rigid disks with magnetic media for data storage. Read/write heads, usually one per surface Head movement mechanics. A computer interface/controller. Electronic interface between the heads and the computer interface One or more cables between the drive and computer. CHS: Cylinder-head-sector, also known as CHS, is a method of giving addresses to data on a hard drive.

Suman Halder, Assistant Professor of CSE Department, CIEM

Page 92

Computer Organization
Heads: Every hard drive consists of platters and read-write heads. If a drive has double sided four platters, then it has eight read-write heads, one on the top and bottom of each platter. The head value is the number of read-write heads in the drive. Tracks: Each platter is divided into thousands of tightly packed concentric circles, known as tracks, that can be read from or written to by that surfaces head. These tracks resemble the structure of annual rings of a tree. All the information stored on the hard disk is recorded in tracks. Starting from zero at the outer side of the platter, the number of tracks goes on increasing to the inner side. Each track can hold a large amount of data counting to thousands of bytes. Cylinders: The cylinder value is the number of tracks on one side of each platter. There are the same numbers of cylinders on each side of each platter. A cylinder is a vertical set of all of the tracks with the same number on each surface of a diskette or hard disk. Thus cylinder 0 is the set of tracks numbered 0, cylinder 1 is the set of tracks numbered 1, and so forth. For a diskette, cylinder 0 consists of track 0 on side 1and track 0 on side 2; cylinder 1 consists of track 1 on side 1 and track 1 on side 2; and so forth. When writing a file, the system fills all the tracks on a cylinder and then advanced the read-write heads to the next cylinder. Sectors: Each track is further divided down into smaller units called sectors. As sector is the basic unit of data storage on a hard disk. A single track typically can have thousands of sectors and each sector can hold more than 512 bytes of data. A few additional bytes are required for control structures and error detection and correction. Old drives used the same number of sectors on every track. But modern drives the outer tracks are storing more sectors than the inner tracks of the plotter. Sectors are often grouped together to form Clusters. Cluster: A cluster is a group of sectors. A cluster size is always a power of 2, such as 1, 2, 4 or 8 sectors. How many sectors together form a cluster depends upon the capacity of the disk. A hard disk typically has four sectors per cluster. On a disk device that uses one sector per cluster, there are sector and cluster the equal in size. As the capacity goes on increasing, so also increasing the maximum cluster number. According, we have 12 bit, 16 bit and 32 bit FAT. In a 12 bit FAT each entry is of 12 bits. Since each entry in FAT represents a cluster number, the maximum cluster number possible in a 12 bit FAT is 212 (4096). Similarly, in case of a 16 bit FAT the maximum cluster number is 216 (65536). Also, for a 32 bit FAT the maximum cluster number is 228 (268435456. Only 28 of the 32 bits are used in this FAT). A file begins on a cluster boundary and requires a minimum of one cluster even if the file occupies only one sector. Thus one can figure the number of bytes of data that will fit on disk by calculating: (# Cylinders) (# heads) (Number of sectors/track) (Number of bytes/sect) For example, a hard disk contains 3148 cylinders, 16 heads, 63 sectors/track and 512 bytes /sect.

Suman Halder, Assistant Professor of CSE Department, CIEM

Page 93

Computer Organization
Disk capacity = (3148 cyl) (16 heads) (63 sectors/track) (512 bytes/sect) which is 1,624,670,208 bytes, or around 1.6 Gig. Advantages of Hard Disk Very high storage capability. Hard disks are very reliable. Very fast access time compared to Floppy Disk or CDROM Read/write operation can be done easily. It has very long life Disadvantages of Hard Disk Expensive compared to Floppy Disk or CDROM Hard Disk is not removable. CD-ROM (Compact Disk ReadOnly Memory) The first optical data storage disk, developed by Philips, had 60 times the capacity of a 5.25-inch floppy disk. CD-ROMs are made up plastic (polycarbonate). The plastic disk is than coated with a very thin layer of aluminum, to make the surface reflective. Commercially available recordable CDs are coated with cyanine, phthalocyanine or azo dyes. The cyanine disks are green, phthalocyanine disks are yellow and azo disks are blue. Compact disks are 4.72 inches in diameter and 527 MB to 742 MB will be fit on it, depending on the number of sectors on the disk and the format used on it. The typical disk used in computerbased CD-ROM drive stores 630 MB using 333,000 sectors. A 60 minutes audio CD with 270,000 sectors and up to 99 tracks. There are different types of CDs. They are: Audio CD holds only music Video CD stores movie Photo CD Data CD containing different types of software CD-RW disc (Compact Disc: Re-Writable) A recordable CD can be erased and rerecorded many times. CD-RW discs can only be written in a CD-RW recorder, not in a normal CD-Recorder. We can reformat CD-RW and overwrite all existing contents with new contents by this drive. In general a CD-RW disk can be re-written about a thousand times. Advantages of CD-RW Use when you need to erase the data and re-write new information (for example, updating files). Use to make a practice CD or to test the contents of a CD before making a permanent one. More cost effective for near line data storage requirements than CD-R. CD-R Suman Halder, Assistant Professor of CSE Department, CIEM Page 94

Computer Organization
Those CDs are recordable only one time is called CD-R. The writing on CD-R is done on a special drive called CD-RW recorder or CD writer. This drive can also read a CD. Advantages of CD-R Good for permanent data storage. Less expensive per disc than CD-RW disc. Readable on virtually all CD-ROM and CD-R drives. Use when you do not need to erase the data. Physical format of CD is two types; Mode 1 is standard for writing computer data and text providing error detection code (EDC) and error correction code (ECC) Mode 2 provides for video and audio using CRC for error correction. There are two form types within a Mode 2 sectors. Form 1 contains static information. Form 2 contains time-dependent information. A normal CDROM track contains only Mode 1 data type sectors. With CDROM-XA track contains only Mode 2 sectors. The XA stands for extended architecture; the XA standard makes possible multimedia CDROM. Single-speed (1X) CDROM drives transferred data into the computer at 150 KB/second. If the drives spin twice as fast then data transfer will twice as fast as well. These double-speed (2X) drives transferred data into the computer at 300 KB/second. Others drives are follows quadspeed (4X, 600KB/second), six-speed (6X, 900KB/second), eight-speed (8X, 1200 KB/second), ten-speed (10X, 1500KB) so on. In modern technology 52X CDROM derives transferred 7800 KB/second. A CD can contain [(75 sectors per second) X (60 seconds per minute) X (number of minutes on CD)] sectors. The amount of data contained in the sector depends on what physical format it is recorded in; for "regular" CD-ROM data, you can fit 2,048 bytes (2 KB) of data into a sector. Advantages of CDROM It is more reliable It has long life It can be removed from the drive Very high storage capability Very low cost Disadvantage of CDROM Longer access time compared over a hard disk. Most CDROM are nor erasable, except CD-RW DVD (Digital Versatile Disk) DVD looks like CDROM, but DVD can store more than 26 times as much data as CDROM. DVD can store as much as 17 GB, depending on the disk you use. DVD-ROM is an optical disc technology that can read both CD-ROM and DVD-ROM discs and may be able to read CD-R and CD-RW discs. DVD-ROM drives are read-only, that is, you can use them to read CDs, but not to make CDs. There are two main differences between a hard disk and a diskette drive. Suman Halder, Assistant Professor of CSE Department, CIEM Page 95

Computer Organization
For hard disk, the read-write head rides just above the disk surface without ever touching it, whereas for diskette, the read-write head actually touches the surface. A hard disk device is constantly spinning, whereas a diskette device starts and stops for each read/write operation.

Suman Halder, Assistant Professor of CSE Department, CIEM

Page 96

You might also like