Unit 4
Unit 4
Only program and data currently needed by the processor reside in main memory.
The Main Memory communicate directly with CPU and with Auxiliary Memory Devices through an I/O
Processor.
Cache is used to increase the speed of processing by making current programs and data available to
CPU.
Auxiliary Memory has Large storage capacity, Relatively Inexpensive, Low access speed compared to
main memory.
Cache Memory has Very small, Relatively expensive, very high access speed.
Decrease cost/bit
Decrease frequency of accesses to slow memory
It has bidirectional data bus that allow transfer of data from Memory to CPU during Read or From CPU
to Memory during write operation.
High Impedance state behaves like an open circuit.
Each word is of eight bit.
It requires 7-bit address.
When the chip is selected, the two binary states in R/W specify the two operations of Read or Write.
CS2 bar indicates this input is enabled when it is equal to 0.
● ROM
ROM does not loss its contents when the power is turned OFF. So, ROM is called Non volatile memory.
The microprocessor can only read from this memory.
It is programmable once.
Types of ROM are:
PROM
EPROM
EEPROM
Masked ROM
The two chip select inputs must be CS1=1 and CS2=0 for the unit to operate.
Otherwise the data bus is in High Impedance State.
When the chip is enabled by the two select inputs, the byte selected by the address lines appears on the
data bus.
It maintains large storage media but can not offer the erase feature.
Write Data once and Read many times.
It has poly silicon wires arranged in a matrix.
These wires can be functionally viewed as diodes or fuses.
● Associative Memory
Search Process:
Choose a sequence of addresses
Read the content of memory at each address
Compare the information with searched items.
A memory unit accessed by content is called an Associative Memory or CAM(Content Addressable
Memory)
● Floppy disk
A disk drive with removable disk is called a Floppy Disk.
It is made of plastic coated magnetic material.
Type of Floppy:
5 ¼ Inch: Capable of storing between between 100k and 1.2 MB of Data.
3 ½ Inch: Small size, Larger storage capacity,Common size is 1.44 MB
It has Slower access than Hard Disk
❑ It has Less storage capacity ,Less Expensive and Portable .
● Hard Disks
Bits are stored in magnetized surface along concentric circles are called Tracks.
Tracks are divided into sections called Sectors.
Some unit use a single Read/Write head for each disk Surface.
Some unit use a separate Read/Write heads for each track in each surface.
A disk system is addressed by address bits that specify the Disk number,Disk surface,Sector number and
the Track within the sector.
How To Read/Write?
First Read/Write heads are positioned in the specified Track.
The system has to wait until the disk reaches the specified sector under Read/Write head.
Information transfer is very fast once sector has been reached.
Storage capacity of disk depends on bits per inch of track and Track per inch of surface.
● Flash Memory
It is Variation of EEPROM.
Flash memory is a non-volatile memory chip used for storage and for transferring data between a
personal computer (PC) and digital devices.
It has the ability to be electronically reprogrammed and erased.
Flash memory is often used in systems that frequently rewrite data, such as USB flash devices or SD
cards.
It is often found in USB flash drives, MP3 players, digital cameras and solid-state drives.
A flash memory chip is composed of NOR or NAND gates.
EEPROM and Flash memory have many differences, with one being their reading, writing, and erasure
procedures of stored data.
EEPROM can read, write, and erase data at the byte level while Flash memory can also read and write
at the byte level, but can only erase data at the block level.
Access Time: Time Required to reach a storage location in memory and obtain its content.
Transfer Time: Time required to transfer data to or from the device.
Transfer Rate: No of words/characters that device can transfer per second.
The transformation of data from main memory to cache memory is referred to as a mapping process.
Types of Mapping:
1) Associative Mapping
2) Direct Mapping
3) Set-associative Mapping
If there is miss, the CPU reads the word from main memory and the word is transferred to cache.
1) Associative Mapping
The associative mapping stores both the address and data of the memory word.
This permits any location in cache to store any word from main memory.
15 bits address is shown as a five digit octal number.
CPU Address of 15 bits is placed in Argument Register.
Then associative memory is searched for a matching address.
If the address is found, the 12 bit data is read and sent to CPU.
If no match occur, The main memory is accessed for the word.
2) Direct Mapping
Main memory needs an address that includes both TAG and INDEX bits.
Cache Memory needs an address of index bits.
Each word in cache consists of the data word and its associated tag.
When the CPU generates a memory request, the index field is used as a address to access the cache.
The tag field of the CPU address is compared with the tag in the word read from the cache.
If the two tags match, there is a HIT and the desired data is in cache.
If the two tags do not match, there is a MISS and desired word is read from main memory and then
stored in the cache with new tag.
Disadvantage:
Two or more words with same index but different tags are accessed repeatedly.
Each word of cache can store two or more words of memory under the same index.
Each data word is stored together with its tag.
Each index refers to two data words and their Associated tags.
Each tag require six bits and each data word has 12 bits.
So, the word length is 2*(6+12)=36 bits.
The size of the cache memory is 512*36.
The word at addresses 01000 and 02000 of Main Memory are stored in cache memory at index address
000.
Similarly, the words at addresses 02777 and 00777 are stored in cache at address 777.
When the CPU generates a memory request, the index value of the address is used to access the cache.
The tag field of the CPU address is then compared with both tags in the cache.
When a miss occurs and cache is full then, it is necessary to replace one of the tag data items with a new
value.
Prepared By: Department of Computer Engineering Page 9
Subject Name: Computer Organization & Architecture Unit No: IV Subject Code: 4350701
Address field of instruction code is 20 bits and physical memory is 15 bits. So, a table is needed to map
a virtual address of 20 bits to a physical address of 15 bits.