Assess and Mitigate Security Vulnerabilities
335
referred to as L1, L2, L3, and even L4 cache (with the L being short for level).
Many mod-
ern CPUs include up to three levels of on-chip cache, with some caches (usually L1 and/or
L2) dedicated to a single processor core, while L3 may be a shared cache between cores.
Some CPUs can involve L4 cache which may be located on the mainboard/motherboard
or on the GPU (graphics processing unit). Likewise, real memory often contains a cache
of information stored on magnetic media or SSD. This chain
continues down through the
memory/storage hierarchy to enable computers to improve performance by keeping data
that’s likely to be used next closer at hand (be it for CPU instructions, data fetches, file
access, or what have you).
Many peripherals also include onboard caches to reduce the storage burden they place on the
CPU and operating system. For example, many higher-end printers
include large RAM caches
so that the operating system can quickly spool an entire job to the printer. After that, the
processor can forget about the print job; it won’t be forced to wait for the printer to actually
produce the requested output, spoon-feeding it chunks of data one at a time. The printer can
preprocess information
from its onboard cache, thereby freeing the CPU and operating sys-
tem to work on other tasks. Many storage devices, such as hard disc drive (HDD), solid-state
drive (SSD), and some thumb drives contain caches to assist with improving read and write
speed. However, these caches must be flushed to the permanent or secondary storage area
before disconnection or power loss in order to avoid data loss of cache resident data.
dynamic vs.
Static ram
There are two main types of RAM: dynamic RAM and static RAM. Most computers con-
tain a combination of both types and use them for different purposes.
To store data, dynamic RAM uses a series of capacitors, tiny electrical devices that hold
a charge. These capacitors either hold a charge (representing a 1 bit in memory) or do
not hold a charge (representing a 0 bit). However, because capacitors
naturally lose their
charges over time, the CPU must spend time refreshing the contents of dynamic RAM to
ensure that 1 bits don’t unintentionally change to 0 bits, thereby altering memory contents.
Static RAM uses more sophisticated technology—a logical device known as a
flip-flop
,
which to all intents and purposes is simply an on/off switch that must be moved from one
position to another to change a 0 to 1 or vice versa.
More important, static memory main-
tains its contents unaltered as long as power is supplied and imposes no CPU overhead
for periodic refresh operations.
Dynamic RAM is cheaper than static RAM because capacitors are cheaper than flip-flops.
However, static RAM runs much faster than dynamic RAM. This creates a trade-off for
system designers, who combine static and dynamic RAM modules
to strike the right bal-
ance of cost versus performance.