Hello again let's continue with the operators now and let's complete the bitwise operators the assignment
operators the membership and the identity operators quickly in this review.
All right so we go into programming that ASPI to 3 and let's understand.
I'm not going to make a file and write them in the sialic So this time let's say is equal to 5.
Or or let me say easy equal to 7 and B is equal to equals 10.
Now when I see the bit twice operate.
What you're going to go with this a and b it takes two white right.
Now we need to understand a because a 7.
I say it can get it as binary 0 0 0 0 0 1 1 1.
That's the binary of the 7 cuts the Big 8 bits each.
And then if I say be that Astin it's going to be written as 0 0 0 0 1 0 1 0.
All right.
Now when you do this twice and when you do a bit why isn't that the campus and operable.
And then it stands.
Each of these bits twice.
1 and 0 0 1 and 1 is a 1 so if I write and the it's going to be something like this
0 0 0 0 1 0 0 0 and 0 0 0 and 1 is 0 1 and 0 0 1 and 1 is 1 and 1 and zero is zero.
What is this too perfect.
That's the answer.
All right let's go on to let's go on to what would be a or OK A or B what would it be.
All right.
It's going to be OK.
I'll just say this.
Or B before going to a command.
Sorry that's 15.
How did that come.
I'll write this once again and I'll write this B once again and then we will do the oring part of it.
That is a or b.
So that's going to be 0 0 0 0 0 0 0 0 1 1 1 or 2 1 is 1 1 or 0 is again 1 0 or 1.
If any one of them on one or at least one of them one.
OK.
And to now.
So we got a or b then you have another operator called as a exhaust.
Now what is exhaust.
Again if I copied these two things out to
a zombie that's going to be given as exactly 0 0 0 0 0 0 0 0 eggs or UPS.
Just a minute one sec x or x or is one exhorter is one.
Yeah.
When any one of them are one.
So if it pulls them or zeros or both of them or once it's going to be answered it's going to be zero
so $0.00 exhaust below zero zero zero zero or one at least one of them is one.
Yes.
Then it is going to be 1 1 exhorter zero is again one but one in Zone One is 0 1 0 0 is 1 again.
What is that.
This is 13.
This is a plus for that astraddle 12 plus one that is Kirti OK.
We now go on to the next bitwise operator that is knocked off.
It says it's mine is it.
OK what is not ofI and that's mynahs.
OK.
So if it's a copy the when you put it up here.
Not or not they are negative off the negation of the.
There's going to be given as a complement of each of them.
So you know this is a negative.
No.
Now there's a negative number which is stored in this particular fashion.
Now if you want to know what kind of number this is you need to get the two complement of the complement
of this is going to be OK.
So so this negative number not of the is going to get this and this is going to be exactly the way that
it's going to be stored in your memory.
But then if you want to read it why does vinyl see it when you write not of his mindset.
OK.
Why is it minus eight then you need to take the two's complement of this and figure out what is the
positive number of which this is all right.
So it is a complement.
So negative numbers are starting to complement form.
So then I can say this right here.
If I were to take the compliment.
I would just say zero.
First then you take the one complement that is 000.00 1 1 1 and then I need to add 1 to it.
So if I add a 1 to it one plus one.
So one plus one to the last bit one if I add to this last bit one to one to the last one what is going
to happen one plus one is zero.
Gary one zero carry one.
This one needs to be added with this one.
Again it's going to be zero carry one.
Again this is going to be zero carry one.
The one is going to come here.
So this one right here.
Now what is this number.
And hence the number that is.
This particular number is minus eat.
So this is how you read what is a negative number.
All right.
Now we go on to the next one that is so you resaw bitwise operators and or X or negation and then oh
we have Sorry congressman and then we have the right shift and the left shift.
OK a right shift by 2 and to it says one by one.
OK I'll store a I'll write it once again and then let's see what is it right.
Shift by two OK what is it going to be.
Each of the bits are going to be shifted to the right by two.
So this bit is going to be shifted one place you're in one place here.
So this bit is going to finally come here.
The first MSBA is going to come here.
The next bit is also going to be shifted by two which means that it's going to come here.
The next one is going to come here.
So these are the three bits which got shifted to the right.
What about East to deal so we come off of that.
Then comes the three ones.
This one is going to be shifted to the right which means that one is going.
That one is also going to come here.
But what about the rest of the day once you are gone.
OK.
They cannot be shifted to the right because this is the maximum that it can hold.
What about these Two-Bits.
These debates are going to be zero.
And you they just go flat.
So what's the answer.
Right shifting the bits by two onset is one.
All right then we go on to left shifting belts by two.
OK.
So that's going to be a left shift by two.
OK so if I do that I'm going to shift.
OK.
Not not this one.
There's a lot of the shape shifting there's some shifting a by too so they're shifted by two.
If I shifted or were I'm going to get like this 000 right these two zeroes will go off.
It is not going to be there then it's going to be 1 1 1 and then zeros are going to be added at the
end.
Again this is going to be the answer.
Now what exactly is that.
A lecture by two that's going to be 28.
This is 16 plus 16 plus eight is how much that's going to be.
Twenty four twenty four plus four is straight.
And that's right.
So you are really off shift to that is 28 clear.
These are the bitwise operators.
Now we go on to some other operators also.
So the so that we finish up the operators quickly.
OK.
By the way where are these operators going to be used.
We're going to use them.
Maybe when you have certain data and you want to hide a few bits you want to show a few bits you want
to do some operations where you want do you want to do some bitwise operations on that data.
Okay.
On any kind of data that you get when you will use any of the bitwise operators.
Okay another operator which is going to be used very frequently.
Scholars.
The assignment operators.
OK.
This is nothing.
This is not is not difficult to understand why.
Because if I do a class 2 what's the answer 9 but if I say what is the value of it now it is seven.
Which means which means it has not changed.
We got the answer A-plus too because we are printing a too.
But did we when we change D-plus do.
Did we assign it back to it.
Did we change it.
No he was still remaining seven hands you can write that.
Hence we have an.
You can actually write something like this a plus do is equal to a plus two.
Now if I say what is a.
That's nine.
That's right.
But instead of writing this White says will give you an operator.
It says A what do you want or do you want to add it to.
And then you could get back to me.
You can write something like this plus sequel to a plus equals or two.
And it was Garny nine.
It has become Levan correct.
OK.