Narrator: In this lesson,
we're going to talk about random access memory,
simply called memory inside of your system,
and how we address that memory.
Now, first, before we talk about how to address memory,
we need to have a better understanding
of what memory is,
and what it does for us inside of our computer system.
Now, before, when we talked about processors,
we talked about the fact that the processor
does all the computations,
but it has to have a place to store data
and instructions
before it does those computations.
Inside of the processor itself,
it has a very high-speed memory,
known as a cache.
This cache is a very small amount of space,
but it is extremely fast.
Now, when you run out of cache space,
the next type of memory you have in your system
is what we call random access memory,
or system memory.
Now, this memory is still fast,
but not nearly as fast as that cache memory.
Now, what ends up happening is the processor
is going to use the cache memory first,
and as it uses the data from that cash memory,
new information is going to move from the system memory
into the cache.
And it keeps moving this as a pipeline process,
going from the system memory to the cache,
and then being processed and executed
using the CPU.
Now, in addition to this system memory,
we also have something known as storage.
And storage is things like hard drives,
USB drives, CD-ROMs, and DVDs,
and things like that.
These mass storage devices
will be able to hold a lot more data
than memory can,
but they are much slower.
So, if I want to load up a new PowerPoint on my system,
it's usually stored on my hard disc,
which is a mass storage device.
When I tell my computer,
I want to read that,
the processor is going to send a signal
over to the hard drive
and say, where is that data?
That data then moves from the hard drive
to the system memory.
And from the system memory,
small pieces of that
can then be brought into the cache
and then worked on by the processor.
This is how this all works together
inside of your system.
So, I want you to keep this in mind
when you think about the different places
that data is stored in the system.
We have mass storage devices,
which are more of a permanent storage area.
When you power-off the computer,
the data on those mass storage devices
will still remain.
But then we also have this temporary storage area
called RAM, or system memory,
and this is an area
that is considered non-persistent storage,
because when you power-off the computer,
everything in RAM is going to be lost.
So, as we're working with different files,
we're going to place them temporarily into RAM,
that way, we can work with them in a much faster manner,
and then when we're done with them,
they'll get saved back to the hard drive,
which is that permanent storage device.
So, when you think about system memory
or random access memory,
known as RAM,
this is a dynamic and constantly changing area,
and it operates really fast
in comparison to our mass storage devices,
like hard drives and CD-ROMs.
To give you an analogy of what this looks like
in the physical world,
think about your office.
In your office, you have a desk,
and in your desk, you only have so much space,
but when things are on top of your desk,
you can quickly get to them,
because they're already out in the open,
and you can reach out and touch them.
Now, in addition to the three or four files
you may have open on your desk,
you also have,
probably, hundreds of files
sitting in a filing cabinet.
Now, that filing cabinet
is more like your hard drive,
it's your mass storage device,
whereas your desktop is more like your RAM.
So, when things are in RAM,
they're easier to access,
quicker to access,
and you can work with them at that given time.
But when you're done with it,
you should then fold that file up,
put it away in the filing cabinet,
so that it's there when you need it in a week,
or two weeks, or a year from now,
and that frees up more space on your desktop
for you to pull out other files
and work with those.
That is exactly what RAM is used for,
it's this temporary space
that is constantly changing and evolving.
So, because our mass storage devices are so slow,
we often want to put more things into RAM,
but RAM is limited.
If we look at your hard disc,
you might have a 500-gigabyte,
or one-terabyte, or even four-terabyte mass storage device,
but when you look at your memory,
you might have eight gigabytes,
or 16 gigabytes,
or, if you're lucky,
maybe even 32 gigabytes of space.
This means, you have much,
much less RAM available than you do a hard disc.
So, what the memory does
is it acts as a disc cache.
This way, we can pull files from the disc
into memory, work on them,
and then replace them
back onto the mass storage device
when we're done.
This lets the RAM act as a faster temporary storage area
for those recently-used and commonly-used pieces of data,
from that hard disc,
to allow us to have quicker operations.
This is because RAM
is going to be able to seek out data really,
really fast,
whereas a traditional hard disc
has to actually spin a disc
until it finds the right part,
and then pull the data off of it,
and this is much slower.
We call this a mechanical system,
whereas when we use RAM,
we're using an electronic system
that can access any piece of that RAM
with near-instantaneous speed.
This is because RAM is what's considered
a solid state device,
and there's no excessive load times,
like you have with mechanical devices,
like a hard drive,
DVD, CD, or even Blu-ray disc.
This means that we can operate really fast
in terms of nanoseconds,
which is billions of a second,
while your hard disc and other magnetic media
is going to be considered very slow,
and operates in the thousands of a second,
known as milliseconds.
So, you can see there's a huge difference in speed here,
which is why we want to put our files into RAM
while we're working on it.
So, what you're going to find,
as a technician,
is that one of the most common things you're going to do,
in upgrading a system,
is actually upgrading the RAM,
and taking it from four gigabytes
to eight gigabytes,
or eight gigabytes to 16 gigabytes,
or 16 gigabytes to 32 gigabytes.
By increasing the amount of RAM,
you can seriously speed up your system,
because you're removing that barrier
of having to read and write as much data
from the hard drive,
by being able to have more files open,
and be able to do more work at any given time.
All right, now that we've covered
the basics of RAM,
and why we need to use this system memory,
instead of relying on our hard drive for everything,
it's important to talk about limitations with RAM,
based on its addressing.
Now, when the processor
needs to reach into the RAM and get something,
this is known as addressing the memory.
This is because inside of that RAM,
and that storage that it has,
each of that, has a different unique address,
and that's how we reference the piece of data
being stored in that particular piece of RAM.
Now, between the processor,
or CPU, and the memory,
we have something known as a memory controller,
and in between the memory controller
and the processor,
we have a bus.
Now, a bus is simply a pathway for us
to transfer data.
And that memory controller
is almost like a traffic cop,
directing traffic and telling the CPU and processor
how to access different parts of the memory.
Now, when you look at the bus,
there's actually two parts of the bus.
There's the pathway that's used for data,
and being able to send and receive information,
and then there's an address pathway as well
that helps us to determine where in the memory
that data is located.
So, when you look at the width of the data pathway,
or the data bus,
this is going to determine how much information
can be transferred with each and every clock cycle.
Now, if you're using single-channel memory controllers,
your data bus is usually going to be 64 bits wide,
and this happens on most modern computers.
Now, in addition to that,
when we look at the address bus,
there's a width associated with that as well,
and this can be either 32 bit or 64 bit.
This is determined by how many locations the CPU
can keep track of,
and be able to access the data
by properly addressing it.
Now, if you're using a 32-bit CPU,
or an x86-based CPU,
you're only going to be able to use a 32-bit address
to access data over that memory bus.
Now, because of this,
you have about 4 billion items that can be addressed,
which is known as four gigabytes of data,
this is because you have two to the 32nd bits available
to be able to address that information.
Now, if you're using a 64-bit CPU,
on the other hand,
you have two to the 64 possible address locations,
which calculates out
to roughly a 184 quintillion possible options.
Now, in terms of memory,
we call this 16 exabytes of data,
and this means, we can address a lot of data
if we're using a 64-bit processor.
Most of our systems these days
aren't going to use 16 exabytes of RAM,
because that would be prohibitively expensive,
and there's not really enough space on most motherboards
to plug that much memory in,
but this is our upper limit.
The real important thing
is that if you're using a x86,
or 32-bit processor,
you could only address
maximum of four gigabytes of memory,
and this is a huge limitation
for modern computing,
because most modern operating systems
are going to require at least four gigabytes of RAM,
at a minimum, to be able to operate sufficiently.
On the other hand,
if you're using a 64-bit processor,
or x64 architecture,
this means you can access more than four gigabytes of RAM
at one time,
and that's why you'll see this used in systems
that have 8, 16, 32,
or 64 gigabytes of RAM,
because they have access to all of that RAM,
which gives them much better performance.
This is another reason
why you want to choose a 64-bit processor
over a 32-bit processor
for most modern computers and applications.