Page 46 - Computer_Science_F5
P. 46
accessible for a short period, just like The principle of cost-performance ratio
you keep your highlighted section open states that faster and smaller memories
for reference. are more expensive and consume more
power. Chapter One: Computer architecture
(b) The principle of spatial locality Imagine each book being a small,
FOR ONLINE READING ONLY
which states that a program is personalised booklet containing only the
likely to access data or instructions information you need right now. These
close to those it just accessed. booklets would be very fast to access
Assume you highlighted a section since they are right at your fingertips.
on computer memory hierarchy and However, creating and maintaining
realized you missed something about individual booklets for every piece of
cache memory. You wouldn’t close information would be very expensive
your book and search the entire library. and impractical. Slower and larger
You would probably just flip back a memories are cheaper and more energy-
few pages because the information you efficient. The big library shelves
need is likely close to what you were represent large, slower storage. It takes
just looking at. Similarly, if a computer time to find a specific book, but storing
program needs to access one piece of all the information in this way is more
information in memory, it might also
need the information stored right next to cost-effective.
it. So, the computer tries to keep such
neighbouring data close together for Computer architects use the principle
faster access, just like books on similar of cost-performance ratio to create
topics are shelved together in a library. a memory hierarchy. This hierarchy
consists of different levels of memory,
The principle of cost-performance each with its own speed, size, and cost:
ratio (a) Registers: These are the fastest
As you sit at the library desk, you may and most expensive memory units,
wish to instantly access all the books located within the CPU itself, like
in the library. The library would not be having a tiny personalized booklet
practical if every single book was right for the most frequently used
information.
next to your desk. A big room filled
with individual shelves for each book (b) Cache: This is a smaller, faster
would make it easier to access any memory closer to the processor, like
book instantly but it would come at a having a selection of relevant books
cost. This concept applies to computer on your desk for easy reference.
memory as well. We can design a system (c) Main Memory (RAM): This is the
where all data is readily available for the primary memory, like the library
processor, but it comes at a cost. shelves readily accessible to you.
37
Student’s Book Form Five
Computer Science Form 5.indd 37 23/07/2024 12:32