You are on page 1of 21

Definition - What does Primary Memory mean?

Primary memory is computer memory that a processor or computer accesses first or directly. It
allows a processor to access running execution applications and services that are temporarily
stored in a specific memory location.

Primary memory is also known as primary storage or main memory.

Techopedia explains Primary Memory


Primary memory is a computer system's volatile storage mechanism. It may be random access
memory (RAM), cache memory and data buses but is primarily associated with RAM.

As soon as a computer starts, primary memory stores all running applications, including the base
operating system (OS), user interface and any user installed and running software utility. A
program/application that is opened in primary memory interacts with the system processor to
perform all application specific tasks.

Primary memory is considered faster than secondary memory.

Primary Memory
Primary memory is computer memory that is accessed directly by the CPU. This includes several types of
memory, such as the processor cache and system ROM. However, in most cases, primary memory refers
to system RAM.

RAM, or random access memory, consists of one or more memory modules that temporarily store
data while a computer is running. RAM is volatile memory, meaning it is erased when the power is
turned off. Therefore, each time you start up your computer, the operating system must be loaded
from secondary memory (such as a hard drive) into the primary memory, or RAM. Similarly,
whenever you launch an application on your computer, it is loaded into RAM.

The operating system and applications are loaded into primary memory, since RAM can be
accessed much faster than storage devices. In fact, the data can be transferred between CPU and
RAM more than a hundred times faster than between the CPU and the hard drive. By loading data
into RAM, programs can run significantly faster and are much more responsive than if than
constantly accessed data from secondary memory.

NOTE: Primary memory may be called "primary storage" as well. However, this term is somewhat
more ambiguous since, depending on the context, primary storage may also refer to internal
storage devices, such as internal hard drives.

Secondary Memory
Definition - What does Secondary Memory mean?
Secondary memory is computer memory that is non-volatile and persistent in nature and is not
directly accessed by a computer/processor. It allows a user to store data that may be instantly and
easily retrieved, transported and used by applications and services.

Secondary memory is also known as secondary storage.

Techopedia explains Secondary Memory

Secondary memory consists of all permanent or persistent storage devices, such as read-only
memory (ROM), flash drives, hard disk drives (HDD), magnetic tapes and other types of
internal/external storage media. In computing operations, secondary memory is accessed only by
the primary or main memory and later transported to the processor.

Secondary memory is slower than primary memory but can store and retain data, even if the
computer is not connected to electrical power. It also has substantial storage capacities, ranging
from some MBs to several TBs of storage space within single memory.

Secondary Memory
Secondary memory refers to storage devices, such as hard drives and solid state drives. It may
also refer to removable storage media, such as USB flash drives, CDs, and DVDs.

Unlike primary memory, secondary memory is not accessed directly by the CPU. Instead, data
accessed from secondary memory is first loaded into RAM and is then sent to the processor. The
RAM plays an important intermediate role, since it provides much faster data access speeds than
secondary memory. By loading software programs and files into primary memory, computers can
process data much more quickly.

While secondary memory is much slower than primary memory, it typically offers far greater
storage capacity. For example, a computer may have a one terabyte hard drive, but only 16
gigabytes of RAM. That means the computer has roughly 64 times more secondary memory than
primary memory. Additionally, secondary memory is non-volatile, meaning it retains its data with or
without electrical power. RAM, on the other hand, is erased when a computer is shut down or
restarted. Therefore, secondary memory is used to store "permanent data," such as the operating
system, applications, and user files.

NOTE: Secondary memory may also be called "secondary storage." However, this term is a bit
more ambiguous, since internal storage devices are sometimes called "primary storage devices"
as well.

Definition - What does Random Access Memory (RAM) mean?

Random Access Memory (RAM) is a type of data storage used in computers that is generally
located on the motherboard. This type of memory is volatile and all information that was stored in
RAM is lost when the computer is turned off. Volatile memory is temporary memory while ROM
(read-only memory) is non-volatile and holds data permanently when the power is turned off.

The RAM chip may be individually mounted on the motherboard or in sets of several chips on a
small board connected to the motherboard. Older memory types were in the form of chips called
dual in-line package (DIP). Although DIP chips are still used today, the majority of memory is in the
form of a module, a narrow printed circuit board attached to a connector on the motherboard. The
three main memory circuit boards types containing chips are: RIMMs (Rambus in-line memory
modules), DIMMs (dual in-line memory modules) and SIMMs (single in-line memory modules).
Most motherboards today use DIMMs.

Techopedia explains Random Access Memory (RAM)

There are two main types of RAM: dynamic random access memory (DRAM), or Dynamic RAM,
and static random access memory (SRAM). The RAM in most personal computers (PCs) is
Dynamic RAM. All dynamic RAM chips on DIMMs, SIMMs or RIMMs have to refresh every few
milliseconds by rewriting the data to the module.

Static RAM (SRAM) is volatile memory and is often used in cache memory and registers because
it is a lot faster and does not require refreshing like Dynamic RAM. SRAM retains information and
is able to operate at higher speeds than DRAM. Because DRAM is a lot cheaper than SRAM, it's
common to see PC manufacturers use DRAM.

Dynamic RAM is memory that needs refreshing. The refreshing is done by the memory controller
which is part of the chipset on the motherboard. Static RAM (SRAM) does not need refreshing and
is used in memory cache on the central processing unit (CPU); it is called L1, L2 and L3 cache.
Original SRAM was stored on the motherboard; later SRAM was inside of the CPU housing or
stored on both the motherboard and inside of the CPU.

RAM
Stands for "Random Access Memory," and is pronounced like the male sheep. RAM is made up of
small memory chips that form a memory module. These modules are installed in the RAM slots on
the motherboard of your computer.

Every time you open a program, it gets loaded from the hard drive into the RAM. This is because
reading data from the RAM is much faster than reading data from the hard drive. Running
programs from the RAM of the computer allows them to function without any lag time. The more
RAM your computer has, the more data can be loaded from the hard drive into the RAM, which
can effectively speed up your computer. In fact, adding RAM can be more beneficial to your
computer's performance than upgrading the CPU.

To check how much RAM a Windows computer has, open the "System" Control Panel. This can be
done by right-clicking "My Computer" and selecting "Properties..." To view how much RAM is
installed in a Macintosh computer, select "About This Mac" from the Apple Menu.
Virtual Memory (VM)
Definition - What does Virtual Memory (VM) mean?

Virtual memory (VM) is a feature developed for the kernel of an operating system (OS) that
simulates additional main memory such as RAM (random access memory) or disc storage. This
technique involves the manipulation and management of memory by allowing the loading and
execution of larger programs or multiple programs simultaneously. It also allows each program to
operate as if it had infinite memory, and is often considered more cost effective than purchasing
additional RAM.

Virtual memory permits software to use additional memory by utilizing the hard disc drive (HDD)
as temporary storage. Most central processing units (CPUs) provide memory management units
(MMUs) that support virtual memory. The MMU supports the page tables that are used to
transform the real and virtual addresses located in memory and on the HDD.

An OS that uses virtual memory frees up space by transferring data from the HDD which is not
immediately required. When the data is needed, it is copied back to the HDD. When all RAM is
being used, VM swaps data to the HDD and then back again. Thus, VM allows a larger total
system memory; however, complicated code writing is required.

Techopedia explains Virtual Memory (VM)

In the 1940s and 1950s, prior to VM, large programs implemented logic to manage primary and
secondary storage. The process was called overlaying. When a program was bigger than memory
storage, the procedure allowed parts of the program that were not continuously used to be treated
as an overlay. Each individual overlay would overwrite current overlay in memory. The
programming for overlaying was extensive. One of the main reasons for creating VM was not for
additional primary memory but for ease of programming. By 1969 the effectiveness of virtual
memory was realized; and it became widely implemented.

VM literally attempts to use more RAM, or disc storage memory, than actually exists. This process
allows the CPU to handle larger and multiple programs simultaneously. VM is an ordinary
operating system (OS) and hardware program that utilizes an HDD by temporally storing and
controlling memory. The process of manipulating and managing memory allows each application
to function as if it had nearly infinite memory. The temporary memory storage is managed by a
memory management unit (MMU), also known as a paged memory management unit (PMMU).

Real memory is divided into small sections called pages. The pages are generally 4 kilobytes in
size. When all RAM or disc memory is used, any page not used is written to virtual memory in
what is called a swap file. When the swap file is needed, it is then translated back to real
memory, a process called page swapping.

One of the few drawbacks of using VM is that there can be excessive page swapping, especially if
a user has numerous open applications. This can cause programs to drastically slow down as the
CPU spends much time writing to the HDD. The significant reduction in performance is called
thrashing.
Cache Memory
Definition - What does Cache Memory mean?

Cache memory is a small-sized type of volatile computer memory that provides high-speed data
access to a processor and stores frequently used computer programs, applications and data. It
stores and retains data only until a computer is powered up.

Techopedia explains Cache Memory

Cache memory is the fastest memory in a computer. It is typically integrated on the motherboard
and directly embedded on the processor or main random access memory (RAM).

Cache memory provides faster data storage and access by storing an instance of programs and
data routinely accessed by the processor. Thus, when a processor requests data that already has
an instance in the cache memory, it does not need to go to the main memory or the hard disk to
fetch the data.

Cache memory can be primary or secondary cache memory, where primary cache memory is
directly integrated or closest to the processor. In addition to hardware-based cache, cache
memory also can be a disk cache, where a reserved portion on a disk stores and provide access
to frequently accessed data/applications from the disk.

Bus
While the wheels on the bus may go "round and round," data on a computer's bus goes up and
down. Each bus inside a computer consists of set of wires that allow data to be passed back and
forth. Most computers have several buses that transmit data to different parts of the machine.
Each bus has a certain size, measured in bits (such as 32-bit or 64-bit), that determines how much
data can travel across the bus at one time. Buses also have a certain speed, measured in
megahertz, which determines how fast the data can travel.

The computer's primary bus is called the frontside bus and connects the CPU to the rest of the
components on the motherboard. Expansion buses, such as PCI and AGP, allow data to move to
and from expansion cards, including video cards and other I/O devices. While there are several
buses inside a computer, the speed of the frontside bus is the most important, as it determines
how fast data can move in and out of the processor.

CD-ROM
Stands for "Compact Disc Read-Only Memory." A CD-ROM is a CD that can be read by a
computer with an optical drive. The "ROM" part of the term means the data on the disc is "read-
only," or cannot be altered or erased. Because of this feature and their large capacity, CD-ROMs
are a great media format for retail software. The first CD-ROMs could hold about 600 MB of data,
but now they can hold up to 700 MB. CD-ROMs share the same technology as audio CDs, but
they are formatted differently, allowing them to store many types of data.
Registers

Registers are groups of flip-flops, where each flip-flop is capable of storing one bit of information.
An n-bit register is a group of n flip-flops. The basic function of a register is to hold information in a
digital system and make it available to the logic elements for the computing process. Registers
consist of a finite number of flip-flops. Since each flip-flop is capable of storing either a "0" or a "1",
there is a finite number of 0-1 combinations that can be stored into a register. Each of those
combinations is known as state or content of the register. With flip-flops we can store data bitwise
but usually data does not appear as single bits. Instead it is common to store data words of n bit
with typical word lengths of 4, 8, 16, 32 or 64 bit. Thus, several flip-flops are combined to form a
register to store whole data words. Registers are synchronous circuits thus all flip-flops are
controlled by a common clock line. As registers are often used to collect serial data they are also
called accumulators. There exist several types of registers as there are -

Shift Registers
Information often comes bitwise i.e. one bit at every clock pulse. Shift registers are used to store
such data. A shift register has one serial input. Every clock pulse one bit is loaded from serial in
into the first flip-flop of the register while all the actual flip-flop contents are shifted to the next flip-
flop, dropping the last bit. Shift registers may feature a serial output so that the last bit that gets
shifted out of the register can be processed further. It is thus possible to build up a chain of shift
registers by connecting each serial out to another shift register's serial in, effectively creating a
single big shift register. It is also possible to create a Cyclic register (see next paragraph) by
connecting the serial out to the same register's serial in. Shift register circuits may also feature
additional parallel-in functionality that allows manipulation of individual bits. If the output of all flip-
flops (and therefore the registers complete content) are read from the lines Q1 to Qn the register
is used as Serial In Parallel Out (SIPO). A typical purpose for such a SIPO register is to collect
data that is delivered bitwise and that is needed in n-bit data words (e.g. to convert the signals
from serial ports of a computer: the line transports 1 bit a time, the computer uses 8, 16 or 32 bit
data words). Shifting bits are important for mathematical operations: if the output of the whole
register is interpreted as a binary number, shifting by one bit corresponds to multiplying or dividing
by 2 (depends on which flip-flop is interpreted as MSB).there are 4 types of shift registers-Serial
In-parallel Out (SIPO), Serial In-Serial Out(SISO),Parallel In-Serial Out(PISO),Parallel In-Parallel
Out(PIPO).

Cyclic Registers
Sometimes it is necessary to recycle the same values again and again. Thus the bit that usually
would get dropped is fed to the register input again to receive a cyclic serial register.

Parallel In-Serial Out


As there is a need for serial parallel conversion the inverse operation is equally required. It is
done by a Parallel in Serial Out register (PISO) that allows loading data as whole data words
and serial shifting. For this operation it needs two control lines: one to trigger the shifting and one
to control when a new data word is loaded to the register. It is prepared by clearing all the status of
the flip-flops output by using a clear function i.e. each flip-flop is equals to 0 then shifting it by
taking a single bit of the given input that input is shifts the present bits in the flip-flop to the next
flip-flop.

Barrel Shifters
A barrel shifter is a digital circuit that can shift a data word by a specified number of bits in one
clock cycle. It can be implemented as a sequence of multiplexers (mux.), and in such an
implementation the output of one mux is connected to the input of the next mux in a way that
depends on the shift distance. For example, take a 4-bit barrel shifter, with inputs A, B, C and D.
The shifter can cycle the order of the bits ABCD as DABC, CDAB, or BCDA; in this case, no bits
are lost. That is, it can shift all of the outputs up to three positions to the right (and thus make any
cyclic combination of A, B, C and D). The barrel shifter has a variety of applications, including
being a useful component in microprocessors (alongside the ALU).

A common usage of a barrel shifter is in the hardware implementation of floating-point arithmetic.


For a floating-point add or subtract operation, the significant of the two numbers must be aligned,
which requires shifting the smaller number to the right, increasing its exponent, until it matches the
exponent of the larger number. This is done by subtracting the exponents, and using the barrel
shifter to shift the smaller number to the right by the difference, in one cycle. If a simple shifter
were used, shifting by n bit positions would require n clock cycles.

Cascade Shifters

Counters

A counter is a sequential circuit that counts. That means it proceeds through a pre-defined
sequence of states where the state of the circuit is determined by the states of all its flip flops. As
every state of the circuit can be given a number we can say that a counter produces a sequence
of numbers. A commonly used approach is to interpret a circuits state as dual number, so if flip-flop
A,B and C are all 0 the counters state is 0. if A is 1, B is 0 and C is 1 the counters state is 101 = 5
and so on. The most basic counters will simply increment by 1 with every clock pulse, so after
state 100 it will go to 101; the next pulse will let it switch to 110 etc. It is possible to design
counters with any needed counting sequence. Even though asynchronous sequential circuits are
not subject of this course the asynchronous counter is presented here exceptionally to give a slight
impression on how

Basically counters are of two types:

1. Asynchronous or ripple counter

2. synchronous counter

Asynchronous counter
For these counters an external clock signal is applied to one flip-flop, and then the output of the
preceding flip-flop is connected to the clock of the next flip-flop.

Synchronous counter
In synchronous counter all the flip flops receive the external clock pulse simultaneously. Ring
counter and Johnson counter are the examples of synchronous counters. in synchronous circuits,
the external clock applied to all the flip flops is in synchronization with the circuit.

Sequential circuits
Combinational vs. Sequential circuits - slide 1
We've been looking at combinational circuits so far. The outputs of any of the circuits were
determined by the combination of the inputs. We couldn't have 'loops' with these circuits. By loops,
we refer to the condition of having the output of a circuit connected to its input (usually indirectly.)

Sequential circuits have loops - these enable circuits to receive feedback. You may have learned
about feedback in other science classes. A simple example of a system dependent on feedback is
a thermostat. It controls the temperature by receiving feedback in the form of a temperature
reading. A diagram of this system is:

|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
| ^
read temperature = too high => lower temperature--|
^ |
^ = too low => raise temperature--|
^ |
|<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
This system has loops. The output of the temperature changing functions affects the input of the
temperature-checking function. Its output affects the operation of the temperature changing
function(s).

Now, we can't just use the type of circuit system we've been using. The reason for this is that in
the circuit-systems we've looked at, we have no control over when the inputs are read. Before we
make an action based on an input value, we want to make sure that that input value is correct (or
valid.) How can the value be invalid? If the function (or circuit-system) that computes it hasn't
finished its execution yet, the value won't have the correct value yet (E.g., with the adder circuit the
result would be disastrous if we computed the second bit before knowing whether there would be
a carry from the first bit.)

With sequential circuits, we add the control of a clock. By using a clock (which is nothing more
than an alternating sequence of 0's and 1's), we can ensure that certain events occur in the
correct order.

Slide 2 - FLIP-FLOP
This slide shows the implementation of an S-R flip-flop. You can use a truth table to better
understand how this circuit works. However, in addition to the input values of S & R, you also need
to consider the value 'stored' in the flip-flop. (It is physically stored on that bottom looping wire.) In
other words, you can determine the 'next state' (which corresponds to the output of a
combinational function) by looking at the values of S, R, and the current state. Here's the
associated truth table:

S | R | state | output
----------------------
0 | 0 | 0 | 0 - the output = S OR ((NOT R) AND state)
0 | 0 | 1 | 1 - NOT R AND state => 1, so the output is 1
0 | 1 | 0 | 0 - the input to the AND gate, R, is inverted. 0 AND 0 => 0
0|1| 1 | 0
1|0| 0 | 1
1|0| 1 | 1
1 | 1 | 0 | x - these 2 states are officially undefined, b/c you don't want
1 | 1 | 1 | x set and reset at the same time!
Just like with decoders and adders (in lecture 11), you should try to think of flip flops on a higher
level than their gate implementation. A flip-flop stores a bit. That stored bit can always be read (on
the output line.) Depending on the particular type of flip-flop, the semantics of storing the bit will
vary. Slide 6 talks about different types of flip-flops.

This slide also introduces 'timing diagrams.' Timing diagrams are used to better understand the
operation of sequential functions. They are to sequential circuits what truth tables are to
combinational circuits. They show the values of inputs over time and the resulting output. When
the 'line' is raised, it corresponds to a value of 1; when it is flat, it corresponds to a value of 0. They
are read from left to right, like a time-line. The sequence of each input value is given: in this case,
S & R. The output can be computed based on the values of the inputs. In the first diagram, 'out'
has value 0 until set has the value of 1. Set 'sets' the value of the output to 1. It stays at 1, until
reset has value 1. Reset 'resets' the value stored in the flip-flop to 0 (and thus the output is 1.)

A clock is just an alternating sequence of 0's and 1's that has a set frequency. Clocks are used to
control the sequence of events. Usually, the clock (wire) and the input it controls are combined
with an AND gate. The input will only be activated if the clock has value 1. A clocked flip-flop is
shown on this slide. It works exactly the same except that SET and RESET only 'work' if the clock
has value 1. Looking at the timing diagram, the first time R has value=1, it has no effect, because
the clock has value 1.

Slide 3 - Register
A register is just a sequence of flip flops. In TOY, we had 16-bit registers. A series of 16 flip-flops
can be used to form one of these registers. The clock (and the extra control of a load line) is used
to ensure that new values are loaded only when they are supposed to be. Here's how it works. If
LOAD has value 0, all the AND gates have output 0, so neither S nor R (on any of the flip-flops)
has value=1. The register is unchanged, which is what we want. If LOAD has value 1 and a bit, x,
has value 1, then the AND gate connected to the S input of its flip-flop will have output 1. So, SET
will be activated, and a 1 will be stored in that register. Alternatively, if bit x has value 0, the AND
gate corresponding to its RESET input will have value 1, and a 0 will be stored in that flip-flop.

All the values will be set in parallel.

The slide mentions several applications for registers.

Slide 4 - Memory (bits)


To implement memory, we need to have a control to handling reading in addition to writing. We
also want to be able to control which flip flop we read. The SELECT control selects the desired flip-
flop using a decoder. By connecting the SELECT lines to the input of the decoder, we can control
which flip-flop we read.

This slide demonstrates how computers are built up with components such as decoders and flip-
flops. Each time we create a new 'system,' we can think of it abstractly, as a 'black box.' As long as
we know how many inputs and outputs a circuit has and understand the function it performs, we
can represent this component of the computer more abstractly. The Memory Bit 'black box' on the
right of this slide is a good example of this.

Think back to what we've already learned to appreciate the power of this abstraction. It hides a lot
of complexity. The Memory Bit consists of a Decoder and Flip-Flops. Decoders and Flip-Flops are
built up of the primitive gates, like AND/OR/NOT, and these gates are built from transistors.
Attempting to draw this Memory Bit system out of transistors alone would be extremely tedious,
and it's likely that we would make a mistake. The idea of abstraction is central to the architecture
of computers (and computer science in general.)

Slide 5 - Memory (words)


To build memory, memory-bits can be combined, much like we did for registers. Don't worry too
much about the actual implementation. Just try to understand the overall idea: look at the drawing
of memory in the lower right-hand corner of the slide. Memory has as its inputs an address (addr),
input bits (in), and a read/write bit (R/W). The read/write bit controls whether we are reading or
writing to memory. The address specifies which memory cell we want to access. If we're writing,
the input bits will overwrite whatever was previously stored at the location addressed by the addr
bits. If we're reading, the output bits will get the value of whatever is stored at the addressed
memory cell.

Slide 6 - Other kinds of flip-flops


A D-type flip-flop uses an S-R flip-flop for its implementation. The input D controls what is written
to the flip-flop. If the clock is active (value=1), then the flip-flop will get D's value (0 or 1). A timing
diagram is given for a 0-1-1 sequence of D values.

This slide also talks about edge-triggered flip-flops. Edge-triggered flip-flops are more controlled.
Adding a clock to a flip-flop increased the amount of control by maintaining the property that the
value of the flip-flop can only change if the clock has value 1. The value stored in an edge-
triggered flip-flop can only be changed on the edge (either the rising or falling edge) of the clock
'tick.' (We think of a clock tick as its 1-values.)

Other combinations and implementations are also possible. In a master-slave flip-flop, a bit is
stored when the clock has value 1 and then 0. So, it is stored only on a 'falling' edge. A timing
diagram illustrates this.

Slide 7 - Counter
By changing together master-slave flip-flops, a counter can be created. The output of each flip-flop
is the input into the next flip-flop. Later flip-flops have longer periods because of the delay and the
fact that the flip-flops are edge-triggered. The timing diagram for this is turned sideways (to fit on
the slide, I presume.) Rotate your book 90 degrees clockwise to read it correctly. The top line is
the clock. Interpret the next lines as a binary number, read from bottom to top (the top line
corresponds to the least significant bit, and the bottom line correspond to the most significant bit).
Each clock pulse increments the binary number by one. So the circuit counts clock ticks.
Slide 8 - High-level view of computer
This is a big jump upwards in terms of level of abstraction. The clock is critical to the operation of
the computer.

Programmable read-only memory (PROM)


Programmable read-only memory (PROM) is read-only memory (ROM ) that can be modified once
by a user. PROM is a way of allowing a user to tailor a microcode program using a special
machine called a PROM programmer. This machine supplies an electrical current to specific cells
in the ROM that effectively blows a fuse in them. The process is known as burning the PROM.
Since this process leaves no margin for error, most ROM chips designed to be modified by users
use erasable programmable read-only memory (EPROM ) or electrically erasable programmable
read-only memory (EEPROM ).

EPROM (erasable programmable read-only memory) is programmable read-only memory


(programmable ROM) that can be erased and re-used. Erasure is caused by shining an intense
ultraviolet light through a window that is designed into the memory chip. (Although ordinary room
lighting does not contain enough ultraviolet light to cause erasure, bright sunlight can cause
erasure. For this reason, the window is usually covered with a label when not installed in the
computer.)

A different approach to a modifiable ROM is electrically erasable programmable read-only memory


(EEPROM).

Is your memory like an elephant's... or is it more like a sieve? You often hear people comparing
themselves to one of those things, but you almost never hear someone say their memory is like a
computer. That's partly because human brains and computer memories have very different
purposes and operate in quite different ways. But it also reflects the fact that where we humans
often struggle to remember names, faces, and even the day of the week, computer memories are
the closest thing we have to memory perfection. How exactly do these "remarkable rememberers"
actually work? Let's take a closer look!

Photo: A computer memory chip like this is an example of an integrated circuit. That means it's a
miniaturized collection of thousands of electronic parts (usually called components) created on a
tiny chip of silicon about the size of a pinkie nail. This one is a 256-megabyte (256 MB) flash
memory chip from a USB memory stick.

What is memory?

The basic purpose of memoryhuman or machineis to keep a record of information for a period
of time. One of the really noticeable things about human memory is that it's extremely good at
forgetting. That sounds like a major defect until you consider that we can only pay attention to so
many things at once. In other words, forgetting is most likely a clever tactic humans have evolved
that helps us to focus on the things that are immediately relevant and important in the endless
clutter of our everyday livesa way of concentrating on what really matters. Forgetting is like
turning out old junk from your closet to make room for new stuff.
Computers don't remember or forget things the way that human brains do. Computers work in
binary (explained more fully in the box below): they either know something or they don'tand
once they've learned, barring some sort of catastrophic failure, they generally don't forget.
Humans are different. We can recognize things ("I've seen that face before somewhere") or feel
certain that we know something ("I remember learning the German word for cherry when I was at
school") without necessarily being able to recollect them. Unlike computers, humans can forget...
remember... forget... remember... making memory seem more like art or magic than science or
technology. When clever people master tricks that allow them to memorize thousands of pieces of
information, they're celebrated like great magicianseven though what they've achieved is far
less impressive than anything a five-dollar, USB flash memory stick could do!

A typical computer has:

Level 1 and level 2 caches

Normal system RAM

Virtual memory

A hard disk

Why so many? The answer to this question can teach you a lot about memory!

Fast, powerful CPUs need quick and easy access to large amounts of data in order to maximize
their performance. If the CPU cannot get to the data it needs, it literally stops and waits for it.
Modern CPUs running at speeds of about 1 gigahertz can consume massive amounts of data --
potentially billions of bytes per second. The problem that computer designers face is that memory
that can keep up with a 1-gigahertz CPU is extremely expensive -- much more expensive than
anyone can afford in large quantities.

Computer designers have solved the cost problem by "tiering" memory -- using expensive
memory in small quantities and then backing it up with larger quantities of less expensive memory.

The cheapest form of read/write memory in wide use today is the hard disk. Hard disks provide
large quantities of inexpensive, permanent storage. You can buy hard disk space for pennies per
megabyte, but it can take a good bit of time (approaching a second) to read a megabyte off a hard
disk. Because storage space on a hard disk is so cheap and plentiful, it forms the final stage of a
CPUs memory hierarchy, called virtual memory.

The next level of the hierarchy is RAM. We discuss RAM in detail in How RAM Works, but several
points about RAM are important here.

The bit size of a CPU tells you how many bytes of information it can access from RAM at the
same time. For example, a 16-bit CPU can process 2 bytes at a time (1 byte = 8 bits, so 16 bits =
2 bytes), and a 64-bit CPU can process 8 bytes at a time.

Megahertz (MHz) is a measure of a CPU's processing speed, or clock cycle, in millions per
second. So, a 32-bit 800-MHz Pentium III can potentially process 4 bytes simultaneously, 800
million times per second (possibly more based on pipelining)! The goal of the memory system is to
meet those requirements.
A computer's system RAM alone is not fast enough to match the speed of the CPU. That is why
you need a cache (discussed later). However, the faster RAM is, the better. Most chips today
operate with a cycle rate of 50 to 70 nanoseconds. The read/write speed is typically a function of
the type of RAM used, such as DRAM, SDRAM, and RAMBUS. We will talk about these various
types of memory later.

First, let's talk about system RAM.

Random access memory (RAM) is the best known form of computer memory. RAM is considered
"random access" because you can access any memory cell directly if you know the row and
column that intersect at that cell.

The opposite of RAM is serial access memory (SAM). SAM stores data as a series of memory
cells that can only be accessed sequentially (like a cassette tape). If the data is not in the current
location, each memory cell is checked until the needed data is found. SAM works very well for
memory buffers, where the data is normally stored in the order in which it will be used (a good
example is the texture buffer memory on a video card). RAM data, on the other hand, can be
accessed in any order.

Similar to a microprocessor, a memory chip is an integrated circuit (IC) made of millions of


transistors and capacitors. In the most common form of computer memory, dynamic random
access memory (DRAM), a transistor and a capacitor are paired to create a memory cell, which
represents a single bit of data. The capacitor holds the bit of information -- a 0 or a 1 (see How
Bits and Bytes Work for information on bits). The transistor acts as a switch that lets the control
circuitry on the memory chip read the capacitor or change its state.

A capacitor is like a small bucket that is able to store electrons. To store a 1 in the memory cell, the
bucket is filled with electrons. To store a 0, it is emptied. The problem with the capacitor's bucket is
that it has a leak. In a matter of a few milliseconds a full bucket becomes empty. Therefore, for
dynamic memory to work, either the CPU or the memory controller has to come along and
recharge all of the capacitors holding a 1 before they discharge. To do this, the mem ory controller
reads the memory and then writes it right back. This refresh operation happens automatically
thousands of times per second.

The capacitor in a dynamic RAM memory cell is like a leaky bucket. It needs to be refreshed
periodically or it will discharge to 0. This refresh operation is where dynamic RAM gets its name.
Dynamic RAM has to be dynamically refreshed all of the time or it forgets what it is holding. The
downside of all of this refreshing is that it takes time and slows down the memory.

In this article, you'll learn all about what RAM is, what kind you should buy and how to install it.
See the next page to learn more about dynamic RAM and memory cells.

The two types of memory

One thing human brains and computers do have in common is different types of memory. Human
memory is actually split into a short-term "working" memory (of things we've recently seen, heard,
or processed with our brains) and a long-term memory (of facts we've learned, events we've
experienced, things we know how to do, and so on, which we generally need to remember for
much longer). A typical computer has two different kinds of memory as well.

There's a built-in main memory (sometimes called internal memory), made up of silicon chips
(integrated circuits). It can store and retrieve data (computerized information) very quickly, so it's
used to help the computer process whatever it's currently working on. Generally, internal memory
is volatile, which means it forgets its contents as soon as the power is switched off. That's why
computers also have what's called auxiliary memory (or storage) as well, which remembers
things even when the power is disconnected. In a typical PC or laptop, auxiliary memory is
generally provided by a hard drive or a flash memory. Auxiliary memory is also called external
memory because in older, larger computers, it was typically housed in a completely separate
machine connected to the main computer box by a cable. In a similar way, modern PCs often have
plug-in auxiliary storage in the form of USB flash memory sticks, SD memory cards (which plug
into things like digital cameras), plug in hard-drives, CD/DVD ROMs and rewriters and so on.

In practice, the distinction between main memory and auxiliary memory can get a little blurred.
Computers have a limited amount of main memory (typically somewhere between 512MB and
4GB on a modern computer). The more they have, the more quickly they can process information,
and the faster they get things done. If a computer needs to store more space than its main
memory has room for, it can temporarily move less important things from the main memory onto its
hard drive in what's called a virtual memory to free up some space. When this happens, you'll
hear the hard drive clicking away at very high speed as the computer reads and writes data back
and forth between its virtual memory and its real (main) memory. Because hard drives take more
time to access than memory chips, using virtual memory is a much slower process than using
main memoryand it really slows your computer down. That's essentially why computers with
more memory work faster.

Internal memory

RAM and ROM


The chips that make up a computer's internal memory come in two broad flavors known as RAM
(random access memory) and ROM (read-only memory). RAM chips remember things only
while a computer is powered on, so they're used for storing whatever a computer is working on in
the very short term. ROM chips, on the other hand, remember things whether or not the power is
on. They're preprogrammed with information in the factory and used to store things like the
computer's BIOS (the basic input/output system that operates fundamental things like the
computer's screen and keyboard). RAM and ROM are not the most helpful names in the world, as
we'll shortly find out, so don't worry if they sound baffling. Just remember this key point: the main
memory inside a computer is based on two kinds of chip: a temporary, volatile kind that
remembers only while the power is on (RAM) and a permanent, nonvolatile kind that remembers
whether the power is on or off (ROM).

Photo: Most memory chips are two dimensional, with the transistors (electronic switches) that
store information laid out in a flat grid. By contrast, in this 3D stack memory, the transistors are
arranged vertically, as well as horizontally, so more information can be packed into a smaller
space. Photo courtesy of NASA Langley Research Center (NASA-LRC).
Random and sequential access
This is where things can get slightly confusing. RAM has the name random access because (in
theory) it's just as quick for the computer to read or write information from any one part of a RAM
memory chip as from any other. (Incidentally, that applies just as much to most ROM chips, which
you could say are examples of nonvolatile, RAM chips!) Hard drives are also, broadly speaking,
random-access devices, because it takes roughly the same time to read information from any
point on the drive.

Not all kinds of computer memory is random access, however. It used to be common for
computers to store information on separate machines, known as tape drives, using long spools of
magnetic tape (like giant-sized versions of the music cassettes in old-fashioned Sony Walkman
cassette players). If the computer wanted to access information, it had to spool backward or
forward through the tape until it reached exactly the point it wantedjust like you had to wind back
and forth through a tape for ages to find the track you wanted to play. If the tape was right at the
beginning but the information the computer wanted was at the very end, there was quite a delay
waiting for the tape to spool forward to the right point. If the tape just happened to be in the right
place, the computer could access the information it wanted pretty much instantly. Tapes are an
example of sequential access: information is stored in sequence and how long it takes to read or
write a piece of information depends where the tape happens to be in relation to the read-write
head (the magnet that reads and writes information from the tape) at any given moment.

Picture: Left: Random access: A hard drive can read or write any piece of information in more or
less the same amount of time, just by scanning its read-write head back and forth over the
spinning platter. Right: Sequential access: A tape drive has to spool the tape backward or forward
until it's at the right position before it can read or write information.

DRAM and SRAM


RAM comes in two main varieties called DRAM (dynamic RAM) and SRAM (static RAM). DRAM
is the less expensive of the two and has a higher density (packs more data into a smaller space)
than SRAM, so it's used for most of the internal memory you find in PCs, games consoles, and so
on. SRAM is faster and uses less power than DRAM and, given its greater cost and lower density,
is more likely to be used in the smaller, temporary, "working memories" (caches) that form part of a
computer's internal or external memories. It's also widely used in portable gadgets such as
cellphones, where minimizing power consumption (and maximizing battery life) is extremely
important.

The differences between DRAM and SRAM arise from the way they're built out of basic electronic
components. Both types of RAM are volatile, but DRAM is also dynamic (it needs power to be
zapped through it occasionally to keep its memory fresh) where SRAM is static (it doesn't need
"refreshing" in the same way). DRAM is more dense (stores more information in less space)
because it uses just one capacitor and one transistor to store each bit (binary digit) of information,
where SRAM needs several transistors for each bit.

ROM
Like RAM, ROM also comes in different varietiesand, just to confuse matters, not all of it is
strictly readonly. The flash-memory you find in USB memory sticks and digital camera memory
cards is actually a kind of ROM that retains information almost indefinitely, even when the power is
off (much like conventional ROM) but can still be reprogrammed relatively easily whenever
necessary (more like conventional RAM). Technically speaking, flash memory is a type of
EEPROM (electrically erasable programmable ROM), which means information can be stored or
wiped out relatively easily just by passing an electric current through the memory. Hmmm, you
might be thinking, doesn't all memory work that way... by passing electricity through it? Yes! But
the name is really a historic reference to the fact that erasable and reprogrammable ROM used to
work a different way. Back in the 1970s, the most common form of erasable and rewritable ROM
was EPROM (erasable programmable ROM). EPROM chips had to be erased by the relatively
laborious and inconvenient method of first removing them from their circuit and then blasting them
with powerful ultraviolet light. Imagine if you had to go through that longwinded process every time
you wanted to store a new set of photos on your digital camera memory card.

Gadgets such as cellphones, modems, and wireless routers often store their software not on ROM
(as you might expect) but on flash memory. That means you can easily update them with new
firmware (relatively permanent software stored in ROM), whenever an upgrade comes along, by a
process called "flashing." As you may have noticed if you've ever copied large amounts of
information to a flash memory, or upgraded your router's firmware, flash memory and
reprogrammable ROM works more slowly than conventional RAM memory and takes longer to
write to than to read.

Auxiliary memory

The most popular kinds of auxiliary memory used in modern PCs are hard drives and CD/DVD
ROMs. But in the long and fascinating history of computing, people have used all kinds of other
memory devices, most of which stored information by magnetizing things. Floppy drives (popular
from about the late-1970s to the mid-1990s) stored information on floppy disks. These were small,
thin circles of plastic, coated with magnetic material, spinning inside durable plastic cases, which
were gradually reduced in size from about 8 inches, through 5.25 inches, down to the final popular
size of about 3.5 inches. Zip drives were similar but stored much more information in a highly
compressed form inside chunky cartridges. In the 1970s and 1980s, microcomputers (the
forerunners of today's PCs) often stored information using cassette tapes, exactly like the ones
people used back then for playing music. You might be surprised to hear that big computer
departments still widely use tapes for backing up data today, largely because this method is so
simple and inexpensive. It doesn't matter that tapes work slowly and sequentially when you're
using them for backups, because generally you want to copy and restore your data in a very
systematic wayand time isn't necessarily that critical.

Going back even further in time, computers of the 1950s and 1960s recorded information on
magnetic cores (small rings made from ferromagnetic and ceramic material) while even earlier
machines stored information using relays (switches like those used in telephone circuits) and
vacuum tubes (a bit like miniature versions of the cathode-ray tubes used in old-style televisions).

Photo: Left: Memory as it used to be in 1954. This closet-sized magnetic core memory unit (left)
was made up of individual circuits (middle) containing tiny rings of magnetic material (ferrite),
known as cores (right), which could be magnetized or demagnetized to store or erase information.
Since any core could be read from or written to as easily as any other, this was a form of random
access memory. Photos courtesy of NASA Glenn Research Center (NASA-GRC).

How memories store information in binary


Photos, videos, text files, or sound, computers store and process all kinds of information in the
form of numbers, or digits. That's why they're sometimes called digital computers. Humans like to
work with numbers in the decimal (base 10) system (with ten different digits ranging from 0
through 9). Computers, on the other hand, work using an entirely different number system called
binary based on just two numbers, zero (0) and one (1). In the decimal system, the columns of
numbers correspond to ones, tens, hundreds, thousands, and so on as you step to the leftbut in
binary the same columns represent powers of two (two, four, eight, sixteen, thirty two, sixty four,
and so on). So the decimal number 55 becomes 110111 in binary, which is 32+16+4+2+1. You
need a lot more binary digits (also called bits) to store a number. With eight bits (also called a
byte), you can store any decimal number from 0255 (0000000011111111 in binary).

One reason people like decimal numbers is because we have 10 fingers. Computers don't have
10 fingers. What they have instead is thousands, millions, or even billions of electronic switches
called transistors. Transistors store binary numbers when electric currents passing through them
switch them on and off. Switching on a transistor stores a one; switching it off stores a zero. A
computer can store decimal numbers in its memory by switching off a whole series of transistors in
a binary pattern, rather like someone holding up a series of flags. The number 55 is like holding up
five flags and keeping one of them down in this pattern:

Artwork: 55 in decimal is equal to (132) + (116) + (08) + (14) + (12) + (11) = 110111 in
binary. A computer doesn't have any flags inside it, but it can store the number 55 with six
transistors switched on or off in the same pattern.

So storing numbers is easy. But how can you add, subtract, multiply, and divide using nothing but
electric currents? You have to use clever circuits called logic gates, which you can read all about in
our logic gates article.

EXTERNAL/ SECONDARY/ AUXILIARY MEMORY


SECONDARY memory is basically divided into two parts:-
1. MAGNETIC MEMORY
2. OPTICAL MEMORY

SECONDARY/AUXILIARY DEVICES:-
They are used to take the back-up(copy) of important files and DATA. The speed of the main
memory is comparable to that of C.P.U and the capacity on the main memory is also very small.
AUXILIARY DEVICES are slower to access as compared to main memory and are almost
inexpensive in comparison to the main memory. Its main function is to provide a large storage at
lower cost.

Lets first discuss about the MAGNETIC MEMORY. It is the memory and devices which use
storage by creation of magnetic field. it basically includes:-

1. HARD DISK

2. MAGNETIC TAPE

3. FLOPPY DISK
4.MAGNETICDISK

HARDDISK:-
The hard disk provides a storage to a large amount data. the storage and retrieval of data from
the hard disk is fast in comparison to other secondary storage devices. It may logically be thought
of as a collection of a large number of magnetic disk. These magnetic disk are placed one over
another to form a stack. One stack may consist of as many as 5-10disk.

Now a days hard disk is available with a storage capacity of about 40GB to 160GB or even more.
the data is written on the hard disk using a hard disk head. the head is placed over the track to
read and write the data. Now like floppy disk these are divided into several TRACKS and
SECTORS. The head which remains in a fixed position read and writes the data on the tracks.
there are two heads one on each side of the disk to read and write the data on the disk when it
spins. A hard disk comes with a set rotation speed varying from 5400 to 7200 rpm. Disk access
time is measured in milliseconds.

MAGNETIC TAPE:-
It is similar to the tape of the music cassette. It is long and have length between 2000-3000 feet.
It is made of plastic role and has Iron peroxide coating has no track or sector. Data is stored in
the form of record. The data and programs are written to the magnetic tape using a device called
heat. The tape is rolled over the spool (roller) through the tape head.

The storage capacity of the magnetic tapes is measured in bytes per inch.

The data is accessed sequentially. It means that if a data is stored in the 3rd record than we first
have to go to 1st record than 2nd and then 3rd.

Access time depends upon the record location. More the distance of the record greater is the
access time.

Horizontal writing up of the data.

Need of two spools and tape is rotated over it.

The data may be written or erased any number of time.

FLOPPY DISK:-
It is the best choice for low cost and high capacity data storage device. Primarily they were
available in two sizes 5.25 and 3.5 but later 3.5 took over the 5.25 and it got extinct from the
market. Sony was the first to introduce the 3.5 floppy disk.

They are made of the MAGNETIC OXIDE coated tape material. It may logically be thought of as a
magnetic disk. It is logically divided into several circles called sectors and tracks. they are highly
PORTABLE and this is the main reason for their popularity. They are slower to access than the
hard disk and have less storage capacity, which is the main drawback of it.

Reading and writing in it is also done with the help of the head. The floppy available today have a
storage capacity of 1.44MB of storage capacity. And data can be erased and write again on the
floppy up to a particular limit.
WORKING OF AN OPERATING SYSTEM
As discussed in my earlier post on operating system and graphics about- what is it and all the
basic information. Now in this post lets try to understand how an operating system works as this
knowledge will let us understand how the programs interact with OS and how an operating system
does controls the hardware. Since a computer has got no use without an OS so knowing about is
working is important.

An operating system creates the ability to:

serve a variety of purposes

interact with users in more complicated ways

keep up with needs that change over time

The operating systems are provided in the form of PORTABLE CODES. Portable means which
can easily be carried out and code means the coded language which needs sufficient knowledge
to decode it and understand. Now these OS are not provided in physical circuit but in portable
code because of the reason that whenever it needs modifications or up gradations it can be done
simply without scrapping the whole device.

At the simplest level, an operating system does two things:


1.) It manages the hardware and software resources of the system. In a desktop computer, these
resources include such things as the processor, memory, disk space, etc.

2.) It provides a stable, consistent way for applications to deal with the hardware without having to
know all the details of the hardware.

The first task of an operating system to manage the hardware and software resources, is very
important as all the applications compete for the attention of the CENTRAL PROCESSING UNIT
(CPU) and demand for memory, storage and input/output (I/O) bandwidth for their own purpose.

The second task is important to provide a consistent application interface, and especially if more
than one computer is using that operating system, or even if the hardware making up the
computer is ever open to change or upgrade. For this APPLICATION PROGRAM INTERFACE
(API) helps the programmer to write the application for one computer and have confidence that it
will work on other as well no matter if it has different memory or storage capacities.

An operating system ensures that even if there is a specific unique computer, Applications
continues to run on that hardware and updates occur and this is achieved because operating
system has to manage the hardware and resources and not the applications. One of the major
challenge for developers is that OS is flexible enough to run on different computer equipment
manufactured by large vendors.
What Kinds Are There?
now since there are large number of operating system that support different machines like
domestic level, industrial level, scientific purpose and also depending on what applications they
support the operating systems can be classified as:-

1. Real-time operating system (RTOS):


It is used to control machinery, scientific instruments and industrial systems. The system is not
user friendly and its interface is very small with the user. A very important part of an RTOS is
managing the resources of the computer so that a particular operation executes in precisely the
same amount of time every time it occurs. Since it is provided with large amount of resources so
parts in it move so rapidly that it is very hard to control them.

2. Single-user, single task:-


As the name implies, this operating system is designed to manage the computer so that one user
can effectively do one thing at a time. The Palm OS for Palm handheld computers is a good
example of a modern single-user, single-task operating system.

3. Single-user, multi-tasking:-
multi-tasking means performing more than one task simultaneously with the other. Today most of
the desktops and laptops uses this type of operating system only. Microsofts Windows and
Apples MacOS platforms are both examples of operating systems that will let a single user have
several programs in operation at the same time. For this purpose parallel processing is being
taken into account. For example, its entirely possible for a Windows user to be writing a note in a
word processor while downloading a file from the Internet while printing the text of an e-mail
message.

4. Multi-user:-
A multi-user operating system allows many different users to take advantage of the computers
resources simultaneously. The operating system must make sure that the requirements of the
various users are balanced, and that each of the programs they are using has sufficient and
separate resources so that a problem with one user doesnt affect the entire community of users.
UNIX, VMS and mainframe operating systems, such as MVS, are examples of multi-user
operating systems.

HOW MULTI USER OPERATING SYSTEM IS DIFFERENT FROM SINGLE USER OPERATING
SYSTEM?
Its important to differentiate here between multi-user operating systems and single-user operating
systems that support networking. Windows 2000 and Novell Netware can each support hundreds
or thousands of networked users, but the operating systems themselves arent true multi-user
operating systems. The system administrator is the only user for Windows 2000 or Netware.
The network support and all of the remote user logins the network enables are, in the overall plan
of the operating system, a program being run by the administrative user.

Now when we switch on a computer, the first set of program that runs is kept in ROM (READ
ONLY MEMORY) and its function is to examine whether all the system hardware is working
properly or not and this operation is known as POST (POWER ON SELF TEST). Now once the
operation of post is successfully completed, the software loaded in ROM begins to activate the
computer disk drives. In modern computer when computer has to activate the hard drives it looks
out for the first piece of operating system the bootstrap loader.
The bootstrap loader is a small program that has a single function: It loads the operating system
into memory and allows it to begin operation. In simple the bootstrap loader sets small driver
programs and directly interface and controls the various hardware subsystems of the computer. It
sets up the divisions of memory that hold the operating system, user information and applications.

The operating systems tasks, in the most general sense, fall into six categories:

Processor management

Memory management

Device management

Storage management

Application interface

User interface

Now there are people who can argue me that an operating system has more than these six tasks
to deal with. But these six tasks define the core of nearly all operating systems.

You might also like