OK so we're going to review parity.
Parity checks and hear see just through examples just examples.
OK.
So parity assuming we're doing even parity we have a number here which looks like this.
And to do even parity just attach a bit at the end we count the number of ones one two three four ones.
So it's going to be a zero.
If we had a different number of ones for instance this one two three four five ones then we would be
catching a one at the end.
And that's parity.
You just check to see if there's an even number of ones that you would attach a zero.
If there's an odd number of ones then you attach a one that's parity and that's we just attach a bid.
That's the check.
So it's only about 50 percent accurate double parity is if we were to have a bunch of numbers and we
will now just go and do both the row and the column for a number.
So it's essentially the same thing as parity.
The row is three so that's one.
There's three so that's that's odd again to say that it's even two so it's even.
And then over here we have three.
So that's one.
We have three so that's when we have two.
So that's we have two and then we're going to have there's two ones in both the row in the column so
we can attach this and this or we could just send it as this number with the extra bit this number with
extra bit this number with the extra bit this number with extra bit and this number and then it will
figure out with what it is that is the check.
And you can imagine that we can fix one problem and it's explained elsewhere that if let's say this
were in a 1 instead of a zero.
So what would happen in this row.
This would be wrong now because there's four and that should be zero.
And this column would be wrong as well because there's four and that should be zero so we could pinpoint
where the error is so that's just the way that we would manage this.
OK.
So now what we're going to do is we're going to go and look through some more examples and try out a
couple other things.
So let's try out check some.
Now how does checksum work.
We add our numbers together and then we do that and show you what happened.
So I'm going to take a couple numbers.
I have four numbers right there and I'm going to add them together.
Now if you're not sure how to add then you can watch the other videos but I'm going to do a two by two
just to make it easier on and also for clarity purposes.
So it'll be 0 1 carry the one and then I have 11 over there.
Now I'm going to add the next number which is this I'm going to add that k.
So I get 1 carry the one that now I'm going to add the last number which is this and I carry the 1 1
1 1.
OK.
Since I decided just now that I'm going to be doing this in blocks of four so I'm going to take this
and I take this.
This really is this as a block of four.
You just don't see that but that's what it really is.
So it's 0 0 0 0 1 and 1 1 1 0.
Now for my check sum what I do is I add those two pots spots together.
So I'm going to add 1 1 1 0 and 0 0 0 1.
I'm going to add it together when I get that I get 1 1 1 1.
Now this happened to work out this way but then have to.
Now what I do is I flip it.
OK.
So I flip it and I get 0 0 0 0.
OK.
So this is my check something.
All right.
So that's what I send along.
Now if you were to do the same procedure it should be that you get the same thing and you should be
getting 0 0 0 0.
OK.
That's assuming you added everything correctly because you added the bits you put all together needed
this.
OK.
So let me just do another example just to go over this make sure we all have this.
So all we do we added together we added two parts together we flip it and then we send it along and
make sure that you get what you're supposed to get.
OK.
So I'm going to now just do.
Again another example and take four numbers.
And I'm going to add them together and I'm just going to add it all together because that's zero.
And that's one that's 10 and that's three four.
So that's going to be for.
OK.
Cause that's carrying right that's.
Let me just show you separately because that's one in one if you do it separately plus one in one if
you do it separately.
So that becomes four.
So that's sort of added on the end over there.
Now I'm going to break it into blocks of four because that's just what I decided on.
And I going to put the zeros there to show you and I have 0 0 1 0.
And they have 0 0 1 0.
Those are two the two blocks that I have.
I add the two parts I get 0 0 1 0.
I flip it.
This is the flip stage where you flip it and you get 1 0 1 1.
OK.
Now in this case I actually am going to send this along and this is a little bit better of an example.
And I going to send this along.
Now what's going to happen if I send my data if I send my data this is my data and they send along my
checks on.
Well what's going to happen is you as the receiver will say let me add all of this together with this.
OK.
Let's see what's going to happen if you add all of that together with this.
Essentially all you're doing is you're taking what this would be and you're adding this to the end so
let me add this to the end and I get 1 0 1 and add it over here and then I get 1 0 1 1 and I get 0 1
0 0.
So I have my two different parts over there.
OK.
And I'm going to add it together and you can see that if you add it together you get 1 1 1 1.
Because of that.
And then you flip it and you get 0 0 0 0.
That means that everything is fine.
It worked.
If any of these bits were off that it's not going to work.
So I mean you could have forty nine and fifty.
And that adds to 100 and then you could get 50 and 50.
And that adds to 100 and that would be pretty exact especially if they were a lot more numbers and you're
sending all of this so it's you know where it's really really well except for you know very rare rare
cases.
But essentially Again this is a procedure.
You add your data together you get these two blocks.
You might have to put some years and you add the two blocks together then you're at this stage where
you added the two blocks together.
You get this as the output you flip the way you flip it zeros become one one with zero.
You send along your data with your checks on the person that receives it adds all the data together
adds the check.
The checks come in when he does that.
He gets this number.
That's right here.
And then he does the same procedure.
He adds the two parts together gets this.
Flips it and gets 000.
So that's how checksummed works.
And that is you know pretty straightforward as far as as it goes.
Now we're going to now do CRC just practice and give an example.
OK.
So here is the practice for these cyclic redundancy check.
What we're going to do is we're going to use a number known bad number but doesn't matter.
OK.
And I'm going to add three bits to the MNM again.
We're doing the internet sorry we're doing the CRC and.
OK.
This is going to be my equation that I'm going to be using because this is really polynomial division
that's how it's working.
We're just looking for the maade we're looking for the remainder.
So this equation really means one x Q plus zero x squared plus 1 x plus 1 which in binary in our interpretation
of this just means this because we only have we know what each spot is and we don't need to.
We don't need to do that.
So here's what I do.
I take the first spot and I'm doing X or which means that I look at each of these and I see what happens
in the X or.
Well one and one X sort is zero because the same is 0 0 0 0.
OK the rest is going to be the same.
And so I'm just going to write that out.
And now I'm going to go to the next spot that has a 1.
It's actually not a bad example.
Go the next but it has a 1 and I'm going to put in my polynomial that I'm going to ma doing the math
so that I'm going to X or.
So these are all zeros in front.
Those are all zeros.
I'll make them just different.
So they're zeros.
OK this becomes 0 1 0 1 1 0 1 0 0 0.
Now on an x or again at the next spot everything in front this is the zero.
Take my same equation do it.
This is a good example because it's quick.
Everything over here is a zero.
OK.
This is now 0 0 0 0 0.
I'm sorry.
This is the first I'm just doing the the ME the switch that I'm just doing this.
So those don't exist.
And so it's one two three four.
And now we can continue with this which is we get a 1 001.
OK.
So these are all zeroes from out there and we're going to X or our equation with this.
And now we get 0 0 1 1.
This is the remainder these extra three that I added.
That is the remainder everything else is zero.
OK.
This is the remainder.
So when you divide it out you will get something.
But we don't care about that we're just looking at the remainder.
So what you said is you don't send the message with zeros at the end.
You in fact send the message with 0 1 1 at the end.
So you send this message.
OK.
Now there's different ways.
I'm just saying that that's what you're sending really.
You would take this and you'd add it to this and then send it and make sure the division and then you'd
get a division of zero the whole time.
We could show that and it makes sense because let's just pretend that this number over here is you're
sending the number 52.
And when you do this whole thing and you divide it you get a remainder of you know three.
So if you if this equation gave you a remainder of three if you added three to this so that now it was
55 you should have a remainder of 0.
So this is what you could do.
You could send your message along with this added to it he added to the last bits.
Or you could just send that with the last bits and make sure they get the same remainder.
Right.
Two options.
Either you send the message with three bits and your equation and then they could just take the equation
X or it shift x or shift x or shift x or shift and then they'll get this as a remainder and that should
match what you have.
Or you could add it to it and then if they divided and then if they in.
Now you have to carefully added your message.
You know but that's what you would do you'd added to your message.
And then it should be that they would get a remainder of 0 if they did this and then they know there's
no issue.
This corrects.
Ninety nine percent ninety nine point nine nine nine nine percent.
So this is your review of CRC.
How do you do it.
Take your message and you take some zeros that you add up to the end.
That's how you.
We get this moving.
We take some zeros that we're adding on to the end.
We take our polynomial that we're going to be dividing by we x or then start again exploring shifting
over any time we have zeroes so we shift till the last zero.
So the first one shifts to the last zero shift until we get to the end and we get a remainder everything
else being 0.
We send it along.
And that's how we do it.
We send that along with our message and that's how we do a cyclical redundancy check.
OK.
Again this is polynomial division because this really is going to be representative of polynomial this
is and I got Whitefield base too.
But we don't really care about all of that math.
We just want to know that we do X or n shift and those are superfast operations because they're easy
to do.
They're adding without any carry.
Super easy to do super fast and that's why this is great because it one is fast and efficient and to
correct 99 percent of errors.
So that's our review of those error detection techniques and error correction technique would be something
like the Heming code which we discuss in the future.