0% found this document useful (0 votes)
64 views6 pages

Computer Organization Answer

1) The document contains answers to questions about computer organization and memory systems. 2) Key terms discussed include cache, main memory, hit ratio, write-through and write-back caching policies, and virtual memory. 3) Virtual memory allows a computer to use disk storage like memory in order to run programs larger than the physical RAM by swapping data between disk and memory. It is called "virtual" because it makes more memory addressable than what is physically installed.

Uploaded by

samir pramanik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views6 pages

Computer Organization Answer

1) The document contains answers to questions about computer organization and memory systems. 2) Key terms discussed include cache, main memory, hit ratio, write-through and write-back caching policies, and virtual memory. 3) Virtual memory allows a computer to use disk storage like memory in order to run programs larger than the physical RAM by swapping data between disk and memory. It is called "virtual" because it makes more memory addressable than what is physically installed.

Uploaded by

samir pramanik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Group A (answers)

Subject: Computer Organization (PCC-CS302)

1. Which of the following is the fastest means of memory access for CPU?
b) Cache
2. The memory implemented using the semiconductor chips is
b) Main
3. If M denotes the number of memory locations and N denotes the word size, then an
expression that denotes the storage capacity is ______________
a) M*N
4. Size of the ________ memory mainly depends on the size of the address bus
a) Main
5. What is the formula for Hit Ratio?
-> To calculate a hit ratio, divide the number of cache hits with the sum of the
number of cache hits, and the number of cache misses .

7. When power is switched off which memory loses its data?


->Cache and main memory will lose their contents when the power is off .

9. In ____________ mapping, the data can be mapped anywhere in the Cache


->a) Associative

10. Dirty bit is used to show


c. Page that is modified after being loaded in the cache memory

Group B
1. Write the difference between SRAM and DRAM.
2. A cache has 64KB capacity. 128 Byte lines and is 4 way set associative. The CPU
generates 32 bits address for accessing data in the memory.

-> a) Cache Size = 64KB = 216 Bytes


Line Size = 128 Bytes

Number of Lines = 216 / 128 = 29 = 512

As cache is 4-way set associative.

Number of sets = 512/4 = 128

b)

c)bits are required for tag = 512

3. =>
H(hit ratio)= 0.9 , TC(time cache) = 80ns , M(time memory) = 150ns
Now access time :
=H*TC+(1-H)(TC+TM) nsec
= 95 nsec

4.Write the difference between associative and direct cache mapping


5.Explain write through and write back policy.
-> write through :
Using the write-through policy, data is written to the cache and the backing
store location at the same time. The significance here is not the order in which
it happens or whether it happens in parallel. The significance is that I/O
completion is only confirmed once the data has been written to both places.

Advantage: Ensures fast retrieval while making sure the data is in the
backing store and is not lost in case the cache is disrupted.

Disadvantage: Writing data will experience latency as you have to write to


two places every time.

Write back :
Using the write-back policy, data is written to the cache and Then I/O
completion is confirmed. The data is then typically also written to the backing
store in the background but the completion confirmation is not blocked on that.

Advantage: Low latency and high throughput for write-intensive applications.


Disadvantage: There is data availability risk because the cache could fail
(and so suffer from data loss) before the data is persisted to the backing store.
This result in the data being lost.

6.Explain spatial locality of reference and temporal locality of reference.


=>
Spatial locality:
This type of optimization assumes that if a memory location has been accessed it is

highly likely that a nearby/consecutive memory location will be accessed as well and

hence we bring in the nearby memory references too in a nearby memory location for

faster access.For example, traversal of a one-dimensional array in any instruction set

will benefit from this optimization. Using these optimizations we can greatly improve

upon the efficiency of the programs and can be implemented on hardware level or on

software level.

Temporal locality
This type of optimization includes bringing in the frequently accessed memory

references to a nearby memory location for a short duration of time so that the future

accesses are much faster.

For example, if in an instruction set we have a variable declared that is being accessed

very frequently we bring in that variable in a memory register which is the nearest in

memory hierarchy for faster access.

7. What is virtual memory. Why is it called virtual?

=> Virtual memory is a memory management technique where secondary


memory can be used as if it were a part of the main memory. Virtual memory
is a common technique used in a computer's operating system (OS).
Virtual memory uses both hardware and software to enable a computer to
compensate for physical memory shortages, temporarily transferring data
from random access memory (RAM) to disk storage. Mapping chunks of
memory to disk files enables a computer to treat secondary memory as
though it were main memory.

Today, most personal computers (PCs) come with at least 8 GB (gigabytes) of


RAM. But, sometimes, this is not enough to run several programs at one time.
This is where virtual memory comes in. Virtual memory frees up RAM by
swapping data that has not been used recently over to a storage device, such
as a hard drive or solid-state drive (SSD).

Virtual memory is important for improving system performance, multitasking


and using large programs. However, users should not overly rely on virtual
memory, since it is considerably slower than RAM. If the OS has to swap data
between virtual memory and RAM too often, the computer will begin to slow
down -- this is called thrashing.

Virtual memory was developed at a time when physical memory -- also


referenced as RAM -- was expensive. Computers have a finite amount of
RAM, so memory will eventually run out when multiple programs run at the
same time. A system using virtual memory uses a section of the hard drive to
emulate RAM. With virtual memory, a system can load larger or multiple
programs running at the same time, enabling each one to operate as if it has
more space, without having to purchase more RAM.
* It’s called virtual because a computer can address more

memory than the amount physically installed on the system. This extra memory is

actually called virtual memory and it is a section of a hard disk that's set up to emulate

the computer's RAM.

You might also like