Instructor: In this lesson,
we're going to talk about ECC memory,
known as error correcting code.
But first, we need to cover the concept
of non-parity and parity in terms of memory.
Now when we talk about non-parity,
this is memory that is just standard memory.
It doesn't check for errors and it allows data
to be put in or taken out of memory at will
and this is what most memory is going to be.
Non-parity is very cheap to manufacture
and it has a higher speed than does parity memory.
Now parity memory, on the other hand,
is going to be used to perform basic error checking
and to ensure the memory contents
are reliable and have integrity.
Now because of this,
this memory is going to be slower than non-parity memory
but it has that reliability
that's going to be needed for servers
and certain high-end desktop workstations.
Now memory that has a parity check
is going to be able to do a basic calculation
based on what it's seeing
to verify if the data is good or not.
And if that data is good, it will use it.
And if it's not, an error will occur
but it won't be able to fix it.
It'll just be able to say there's an error here
but I don't know how to fix it.
Now basically, this works by having every byte
having a parity bit associated with it.
So instead of having eight bits, you now have nine bits
because eight data bits plus one bit for parity.
Now that parity bit is going to be set at right time.
And then, it's going to be calculated and compared
when you read from the memory to determine
if any of the bits have changed
since that data was last written into that memory.
This type of checking
is limited to detecting those single bit errors though.
And if there's two bits that have been altered,
that parity check may actually pass,
because remember, bits can only be a 0 or a 1.
So for example, let's say I stored the number 0
which is written
as 00000000 in binary.
Now if I add all those bits together, I get eight 0s
which gives me 0 for my parity bit.
Now if I go to read that number from memory
and I see there are eight 0s,
I add those together and I get 0,
0 matches my parity bit as 0,
so this is good data.
Now, on the other hand,
let's say I was writing down the number 1
which is written as 00000001.
Now if I add all those numbers together, I'm going to get 1.
And I'll put that in my parity bit of the ninth bit.
By doing this, I now read from that
and I get 00000001.
And because that all adds up to 1
and that matches my parity bit,
I know the data is good
But if I put that into memory
and it sat there for a couple hours
and that 1 got changed to a 0 by accident,
if I read that now
and I get 00000000,
and I add those together, I get 0,
and I compare that to my parity bit
which had a 1 in it,
that now tells me that there's an error
and something went wrong.
I don't know which of those eight bits got changed
but at least one of them did.
Now, on the other hand,
if that number
from 00000001 got changed
to something like 01010001,
I now had two bits that were changed
from 0s to 1 by accident by the memory.
When I look at my parity, it's still going to be a 1
because when I'm adding those up, if it's an odd number,
it's going to be a 1 for my parity bit.
And if I add those up and it's an even number,
it's going to be a 0.
So as you can see,
you're not going to be able to detect an error
if two bits were changed inside of this
if you're using a parity type calculation.
Now, the good news is about 90% of most errors
are going to be a single bit type of error
and so parity checking can usually be sufficient
for most of our situations.
But if you're dealing with something
like running servers for a bank,
having any kind of errors could be a bad thing.
So we want something better than parity
and that's where ECC comes into play.
Now ECC stands for Error Correcting Code.
An error correcting code is the type of memory
that takes parity up to the next level.
Now not only can it detect there's an error,
just like parity can,
but it can also correct that error for you as well.
Now ECC is a little bit slower than parity
which is also slower than non-parity.
And so you're giving up some performance
for this extra capability
but you are getting higher integrity
and reliability out of your memory
when you're using ECC
because it is going to be able to detect those errors
and fix those errors.
In general, you're only going to see ECC
or error correcting code
being used in really high-end workstations or servers
because of the additional cost
and that extra high level of integrity
is only needed in those types of environments.
Now you may be wondering,
how does ECC actually determine
what was wrong and how to fix it?
Well, to do that,
it's going to use something known as buffered
or registered memory.
Now buffered memory or registered memory
has additional hardware that's going to sit
between the memory and your CPU or processor.
This hardware is called a register
and it stores data to a buffer
before it's being sent to the CPU.
This feature is used as a reliability measure
in a lot of systems
especially systems like servers
that have lots of different memory modules
where errors could occur.
These systems require buffering or registering the data
in order to reduce the electrical load
used by these systems
that have large amounts of memory modules,
and this can be paired up with parity
or error correcting code memory
to be able to give you that additional reliability
that you're looking for and detect those errors.
Now in order to use error correcting code modules,
your motherboard has to support it as well as your CPU.
If either those components don't support ECC,
then even if you buy the ECC modules which cost more,
you're not going to get that extra ECC benefit.
So keep that in mind.
Also most motherboards either support ECC or they don't.
It's not generally an option.
So if you buy a motherboard that support ECC,
you're going to have to buy ECC modules
which are those registered memory modules.
Now if you do find a motherboard that supports ECC
or non-ECC modules,
generally they won't support both at the same time.
So all your modules have to be ECC
or none of your modules can be ECC.
Having a mixture of them can cause errors in the system
and the motherboard won't know how to handle it.
Now the last thing I want to mention
is that if you're using DDR5,
DDR5 does have some error checking
internal to the modules themselves.
This is not considered ECC or an ECC module.
And so this error correction
inside the newer DDR5 modules
can be used on motherboards that don't support ECC
and you'll still have some error checking capability.
This is a different form of error checking
and it's not considered error correcting code.
So keep that in mind and don't let that confuse you
when you're out in the field.
This is a different form of error checking
and DDR5 modules still can be sold
as either ECC or non-ECC modules,
because in addition to that internal error checking,
they can also work with the CPU and the motherboard
if they support ECC
and they are now error correcting code as well.
I know that gets a little confusing.
So just be aware of that when you're out in the field.