Тёмный

Left and Right Shift 

Mr Powell's Computer Science Channel
Подписаться 2,7 тыс.
Просмотров 258 тыс.
50% 1

Learn how to multiply and divide by two in binary (or any power of two!)

Опубликовано:

 

10 янв 2015

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@bossgirl9176
@bossgirl9176 4 года назад
I've got a computer science examination tomorrow and I found your video extremely helpful thank you
@theatomgamers3115
@theatomgamers3115 8 лет назад
Got a computing exam coming up, This really helped, thanks mate.
@DrMadPotato
@DrMadPotato 7 лет назад
Teach better than my teacher! And it's such a simple thing
@Abdulisbasith
@Abdulisbasith 5 лет назад
Helped me clear so many doubts , Thanks Mr Powell's Computer Science Channel
@SunitaSharma-nc4zq
@SunitaSharma-nc4zq 6 лет назад
I can't understand this topic in any of the lecture video but only this works thanks a lot for this simple nice and wonderful video I respect your teaching
@rubyc967
@rubyc967 6 лет назад
Thank you so much!! This is so simple haha
@blackstreet23
@blackstreet23 8 лет назад
Thanks this was really useful !!!!
@jes2276
@jes2276 6 лет назад
Have you done a rotate binary video?
@zeefer9867
@zeefer9867 6 лет назад
so clear, very nice,
@RishikaSinghthetraveler
@RishikaSinghthetraveler 7 лет назад
Thanks very helpful
@tpwk1282
@tpwk1282 5 лет назад
Thank you so much for this
@Shkencetari
@Shkencetari 8 лет назад
Thank you very much :)
@bollyhunt7083
@bollyhunt7083 7 лет назад
nice. and easy to understand
@NinjaCokeGaming
@NinjaCokeGaming 6 лет назад
thanks Mr Powell!!!!!!
@aura9654
@aura9654 5 лет назад
thanks man helped a lot :)
@khaldounal-nuaimi3594
@khaldounal-nuaimi3594 5 лет назад
Thank you!
@Dr_Ali.Aljboury
@Dr_Ali.Aljboury 5 лет назад
Thanks for explaining. So may I know where we using these shifts and one more things how you make 5 or 10 after equal? Thanks
@mrpowellscomputersciencech7120
Binary shifts are used to quickly multiply / divide by powers of two. They can also be used to zero out lower or upper bits (although bitwise and would probably be better), they can also be used in binary multiplication. I am sure there are other uses. I am not sure I understand your second question.
@burgerking220
@burgerking220 4 года назад
Thank you very much.
@tanuj1253
@tanuj1253 7 лет назад
What if you left shift the number 10 twice in hexadecimal(8 4 2 1)?
@mrpowellscomputersciencech7120
I am not quite sure what you mean. b10 as a binary number left shifted twice will be b1000 - or from 2 denary to 8 denary (and indeed from x2 to x8). If you mean x10 left shifted then x10 = b10000 and so left shifted is b01000000 which is x40 or denary 64. Lastly, if you are shifting places in hex then x10 would be x1000 which is whatever 16x16x16 is in denary.
@lawalabdulateefolawale4548
@lawalabdulateefolawale4548 5 лет назад
fantastic .......thanks
@shaheryarahmad5871
@shaheryarahmad5871 5 лет назад
Good Easy to Understand
@hooramahi8441
@hooramahi8441 5 лет назад
thanks very good video
@Toturials
@Toturials 6 лет назад
Thank you very much
@sunlime3347
@sunlime3347 6 лет назад
Thank you
@theo9743
@theo9743 7 лет назад
whats the difference between a logical left shift and a arithmetic left shift?
@mrpowellscomputersciencech7120
There is no difference. There is however a difference for right shift. A logical right shift just shifts the bits along and fills the gap left at the left hand end with a zero - it is moving the place of the bits. An arithmetic right shift copies the most significant bit. This is useful when using two's complement numbers: -8 4 2 1 1 1 0 0 - this is two's complement for -4 0 1 1 0 - logical right shift has become positive 6- although it has moved the bit order 1 1 1 0 - arithmetic right shift - the gap is filled with the old most significant bit. -4 right shifted has become -2
@asdf256
@asdf256 6 лет назад
Thank you so much for explaining this simply. My professor doesn't teach us anything and the textbook is too in-depth.
@yagzyalcntas553
@yagzyalcntas553 6 лет назад
Thank you for your answer been looking for this for half an hour and no ..... one does signed shifting! including you but at least in comments you did it. and another question if we do signed shift of positive number 0110 for example we will again copy msb which is 0 right? i havent came across any positive signed shifting made me question does signed mean negative or something...
@irenenastatchenko905
@irenenastatchenko905 6 лет назад
msb will be copied anyway when using arithmetic right shift: either it is 1 or 0. The empty position in the most significant bit is filled with a copy of the original MSB.
@Rawoonah2cool
@Rawoonah2cool 7 лет назад
At 2:37 when I tried to shift again I got 4 shouldn't I get 20?
@mrpowellscomputersciencech7120
If you use five or more bits to represent the number then you will get 20. In this case we were using just four bits which can represent the numbers 0-15 only - hence 20 won't fit in. If you left shift and have not got enough bits to represent the number then a computer processor will usually set an overflow flag. How to check for overflow varies between languages and architectures. The number of bits use to represent basic types like integers will vary too.
@ahmedulhaquefuad280
@ahmedulhaquefuad280 5 лет назад
64, 32, 16, 8, 4, 2, 1 for 7 bit
@roushanraj2155
@roushanraj2155 8 лет назад
thankssssssssssssssssssssssss
@michaelattard2634
@michaelattard2634 6 лет назад
well done m8 very good enjoyed your lesson
@grainfrizz
@grainfrizz 4 года назад
3
@anoshaaziz7332
@anoshaaziz7332 5 лет назад
nice
@naziasultana1860
@naziasultana1860 5 лет назад
Thats my teacher
@tokihossoin7861
@tokihossoin7861 6 лет назад
Safe bro
@mohithkumar9210
@mohithkumar9210 5 лет назад
8 4 2 1 0 0 11 --> 3 --LS 1bit --> *2. This part is ok But if the register is has a fixed memory of 4 bit then the output should not go beyond 16, or you have an overflow, so for the above example it is necessary to restrict the operation to 2 left shifts only. Am i right? example: 8 4 2 1 1 0 1 1 -->LS, 1 bit != *2.
@mrpowellscomputersciencech7120
It isn't necessary to restrict it to 2 left shifts, but you will lose data. Consider a 32 bit IP address 192.168.1.45. if I do ip > 24 then I get left with 45. If I want to check if the most significant bit of a number is a 1 then I could do if ((number1==number) {}. This isn't the most effective way to do it, but it does work.
Далее
Binary Shifts Tutorial
9:13
Просмотров 34 тыс.
C bitwise operators 🔣
6:47
Просмотров 68 тыс.
ВОТ ЧТО МЫ КУПИЛИ НА ALIEXPRESS
09:35
КАК Я ЭТО СДЕЛАЛА?
00:13
Просмотров 145 тыс.
Comparing C to machine language
10:02
Просмотров 5 млн
The SAT Question Everyone Got Wrong
18:25
Просмотров 12 млн
Bitwise Operators 4: The Logical Shift Operation
13:27
The Test That Terence Tao Aced at Age 7
11:13
Просмотров 4,3 млн
Why you didn't learn tetration in school[Tetration]
6:23