small missed detail, : the bitwise, & and | or whatever, they look if both are set, meaning both are one, not just matching, because if both are 0 for example, & will give zero and not 1 The video is amazing, Thank you, really!.
@alexhyettdev Жыл бұрын
That is a very good point, I should have mentioned that in the video. Thank you for pointing it out. For those finding this comment in the future: IF: a = 1 b = 1 THEN: a & b = 1 IF: a = 0 b = 0 THEN: a & b = 0
@AntiAtheismIsUnstoppable11 ай бұрын
I mean... how can anyone call himself a programmer and then not know the most basic of how computers operate, which literally can be learned in one day? This is like claiming to be a matematician, but not knowing how addition works. I will never ever trust any programmer who doesn't know the most basic of his own tool.
@loayalsaid634311 ай бұрын
I know, and appreciate what you said, but you know, mistakes happens, and he said he forgot about it, now he does not know about it. buy anyway, Good luck with your learniing process.
@witchoutcandy10 ай бұрын
so in the XOR example: READ_WRITE = 4 WRITE_PERMISSION = 2 EXECUTE_PERMISSION = 1 userPermissions ^= WRITE_PERMISSION this equals 4 because 6^2 is 110^010, that IS 100, right? i've thinking... the userPermissions was 7 because of the last operator example, so 111^010 was going to be 5, and the userPermissions "lost" WRITE_PERMISSION but didnt lost execute_permission and read_permission :0 epic
@gabeznl35918 ай бұрын
Also, how can the binary number 0011 equals to 6? It's always 3 in decimal...
@johningram215310 ай бұрын
I've been using the term "bit" when explaining unix permissions ot people for over 25 years, and never understood why. Great video.
@TVParsley8 ай бұрын
You explained in 8 minutes what my CS professor couldn’t explain in an hour! Great video!
@lanniekin2 жыл бұрын
Thank you for this! I've been a game developer for a while and had never had to deal with this concept, but it's been thrown at me with very little explanation in the cybersec course I'm taking. This was very helpful :)
@alexhyettdev2 жыл бұрын
I am glad you found it helpful. They are definitely one of the lesser used bits of programming.
@numbertumbers5292 жыл бұрын
This was very well-made and informative! You deserve a lot more than 94 subscribers!
@alexhyettdev2 жыл бұрын
Thank you very much, I am glad you liked it.
@bouzie800010 ай бұрын
oh how much he has grown since this comment
@cannabisanomaly6 ай бұрын
I always come back to this video to refresh my terrible memory on bitwise operations. Thank you Alex!
@IsraelSilva-ho8yc3 ай бұрын
Thank you so much for this man, got a task at work dealing with this and was a "bit" lost 🥁
@mr.luxxyandreneo5168 Жыл бұрын
Sir really , the rwx ex. from linux was amazing , none told us such deeply, thanks for relating bin no with programming & with linux, just amazing
@alexhyettdev Жыл бұрын
Thank you for the kind words. I am glad my video was helpful!
@paval1s692 жыл бұрын
Nice! Already learned it but it was still great as a refresher and also a great introduction for newbies to the topic. A shame that the channel is not that big yet
@alexhyettdev2 жыл бұрын
Thanks! I have only started posting regularly at the start of this month so still early days 🤞🏻
@Nonsense1164 ай бұрын
excellent video! I'm a Java & React dev. I've been getting into C lately reading the K&R book and was having a hard time internalizing the bitwise operators. This is exactly what I needed.
@ShermukhammadKarimov Жыл бұрын
Thank you so much. You helped me with my university exams. Keep going. Well done.
@luis.barragan2 жыл бұрын
This was a really professional video, straight to the point. Thanks for saving my day.
@alexhyettdev2 жыл бұрын
You are welcome. I am glad you found it useful.
@timi_t_codes Жыл бұрын
You keep things so simple!! I would love to teach like you do.
@alexhyettdev Жыл бұрын
Thank you for the kind words! I have never really taught anything before doing this channel. You never know what you can do!
@Tech-Dev Жыл бұрын
Cheers for making this concept so easy to understand.
@alexhyettdev Жыл бұрын
You're very welcome!
@mossabDiae Жыл бұрын
Great video Alex and well explained! I've been using Linux in a while and it's the first time to know the origin behind choosing those exact numbers for files permission, learned a lot! Thank you, subscribed.
@alexhyettdev Жыл бұрын
Thank you! Yes I don't think many people realise where those numbers come from. It does seem quite arbitrary at first glance.
@oglothenerd Жыл бұрын
Well, I just learned something cool about UNIX file permissions! I love this, because I use Arch, btw.
@alexhyettdev Жыл бұрын
That's great! I used Arch a lot when I was younger. Back when I had time to customise everything lol
@oglothenerd Жыл бұрын
@@alexhyettdev Lol.
@oglothenerd Жыл бұрын
@@alexhyettdev I am 14, so, yeah... XD
@alexhyettdev Жыл бұрын
@@oglothenerd I remember Arch Linux being really fast. I screwed something up though and couldn’t boot. 🤦🏻♂️
@SaMcfc05 Жыл бұрын
Thank you, this makes things a lot simpler to understand
@alexhyettdev Жыл бұрын
You’re welcome!
@Ctrl_Alt_Elite Жыл бұрын
I'm learning DSA atm, and came across a constant time solution for the Power of 2 problem that uses the AND bitwise operator AMAZING videos, watched both the binary & bitwise operators vids and learned a tonne! Thanks a lot! 😁
@alexhyettdev Жыл бұрын
Thanks for sharing, I am glad my videos could help!
@AFriendOfYours0 Жыл бұрын
Thank you so much. I was trying to make sense of some code I came across on GitHub and I had no idea what was going on until I watched this. Didn't think I'd have to deal with bitwise operators in JavaScript haha. Loved the simple explanation and the lighting/graphics.
@alexhyettdev Жыл бұрын
They are definitely quite confusing if you haven’t seen them before. Even if you have it can take a little while to work out what is actually doing.
@abeldamtew20049 ай бұрын
thanks for the awesome explanation and it is good to know when and how to use them.
@brianmwaniqi2 ай бұрын
Great explanation as well as examples given for the application of bitwise operations
@hernanphillip334 Жыл бұрын
Very very nice video sir, it has helped me out a lot!
@alexhyettdev Жыл бұрын
That's great! I am glad it helped.
@PauloGosen Жыл бұрын
Thank you Alex, I really learned something with this video. Keep it up
@blaxpow Жыл бұрын
That's excellent content. Good explanation and video editing. +1 subscriber 🎉
@alexhyettdev Жыл бұрын
Thanks Wesley! Glad to have you here, welcome 👋
@DaveDemers692 жыл бұрын
Thank you, this helped a ton!
@alexhyettdev2 жыл бұрын
Glad it helped!
@davidvillalobos3854 Жыл бұрын
good video,very simple, straight to the point and the example of user permission was great and easy to follow. Thanks
@alexhyettdev Жыл бұрын
Thank you, I am glad I could help!
@amaniabid4476 Жыл бұрын
thank you for this because I get it very easy when you explain it
@alexhyettdev Жыл бұрын
You’re welcome! I am glad I could help.
@arhanghosh27449 ай бұрын
Wonderfully explained. Great video
@bouzie800010 ай бұрын
Informative and concise video. Good stuff
@rcnhsuailsnyfiue22 ай бұрын
Great video and excellent explanation 👍
@senriofthealexis39989 ай бұрын
Very concise and informative, thank you Alex
@nazarinebeats599 Жыл бұрын
Im confused, at 4:06 the output is can read, but it looks to me that the result form the bit and should not match so I expected to see 0 ?
@alexhyettdev Жыл бұрын
I don't think I explained that well in this video. As one of the other comments points out (see pinned) for & operator if both bits are 1 then it will equal 1, if both bits are 0 it will equal zero. If they are both different it will be 0. So our user permissions are set to 6, which is 110 in binary. The read permission is 4 which is 100. If you do 110 & 100 you will get 100, which is why you can do: if (userPermissions & READ_PERMISSION) == READ_PERMISSION:
@wangxuerui99499 ай бұрын
What an awesome video! Super helpful!!
@alexhyettdev9 ай бұрын
Thank you, I am glad you liked it.
@Xander95X Жыл бұрын
Wow, this video is great, super succinct and explained very clearly.
@alexhyettdev Жыл бұрын
Thank you I am glad it helped!
@wypimentel10 ай бұрын
Yeah, this topic was scary to me but you make it seems easy, thanks!
@MrOvergaming8 ай бұрын
I clicked on the like button before strarting the video!
@mikeh770411 ай бұрын
This reminds me of the days I was learning Z80 machine language programming. Nice video! Are there no bitwise rotate operators, or are they rarely needed in higher-level languages?
@vincentzacks958410 ай бұрын
Excellent explanation, thanks mate!
@alexhyettdev9 ай бұрын
You're welcome!
@artemmozharov249211 ай бұрын
you can use shifts to multiply by 2pow n and there is also >>> operator or
@jewsefjones6 ай бұрын
Nice vid I would of liked to see the 0 0 table row and some examples uses for the last few operators
@kdt85 Жыл бұрын
what practical uses do the left and right bit shifts have?
@alexhyettdev Жыл бұрын
They do have some mathematical uses. Doing x > 5 is equivalent of dividing x by 2 to the power of 5. They are also sometimes used for enum definitions which you can see here: stackoverflow.com/questions/3999922/why-use-the-bitwise-shift-operator-for-values-in-a-c-enum-definition If anyone has any other uses for them, I would be interested to know too!
@kdt85 Жыл бұрын
@@alexhyettdev thanks!
@JacksonBockus8 ай бұрын
I use them all the time! Some hardware peripherals will store numerical values in weird places within registers, so to extract them and use them as numbers you need to perform a shift so that each bit is in the right place. Say we had an 8 bit register used by a temperature sensor with the lower three bits being for control and the upper five bits actually representing the temperature. You can extract the temperature by reading the value of the register and doing a left shift by three.
@kdt858 ай бұрын
@@JacksonBockus thank you, yes I've come to realise they are widely used in embedded systems to directly access the pins by manipulating the register. Arduino for example used an extraction layer to turn pins on and off, if you use bit wise it's much faster and parallel
@thoniasenna23306 ай бұрын
great, many thanks from Brazil!
@MrKruges10 ай бұрын
This is so helpful. Thank you!
@alexhyettdev9 ай бұрын
You're welcome!
@moonasha Жыл бұрын
in unity we use these for layer masks. For whatever reason, layers are stored as a series of booleans in a 32 bit (i think) integer... so if we want to mask off layer 7, we have to bit shift 1 over 7 places, 1
@alexhyettdev Жыл бұрын
That's interesting, thanks for sharing. I have been meaning to try out Unity.
@MohammedRayaanPasha6 ай бұрын
couldn't get better explanation!
@IndisputableConnoisseur Жыл бұрын
this is gold
@alexhyettdev Жыл бұрын
Thank you for the kind comment. I am glad it was useful.
@peaceomohimua11832 ай бұрын
U re a life saver.... God bless u
@unidentifiedpy8 ай бұрын
damn man, you should've been my professor in college. now I'm gonna your student on every vid. cheers!
@Honest_Reply9008 ай бұрын
Very informative video, thanks and making and sharing it
@zmo__69926 ай бұрын
This a very wonderful video. thanks you!
@MoolsDogTwoOfficial8 ай бұрын
This'll be helpful for going into raw mode (UNIX).
@Dallascalo7 ай бұрын
Now it makes more sense!
@ShiloBuff9 ай бұрын
Great explanation. Thanks
@kevinbatdorf Жыл бұрын
What are some common use cases for the last three you mentioned? ~ >
@kevinpellerin6715 Жыл бұрын
Programming can be so high level, coming from microprocessors, its a little hard to not have to think about registers and interrupts.
@civioartsАй бұрын
Great video! Thank you. Makes a lot of sense, especially the practical uses. However, I miss the logical shift (>>>). Amazing video nonetheless.
@moishie209 ай бұрын
Thanks. Great video
@dumebiubogu34458 ай бұрын
Thanks for the video. Not sure I am understanding the point of the 2's compliment. Does that give us the answer of ~5 ? So ~5 is -6?
@rockingshubzz32014 ай бұрын
If you use 2 complement it means ~5 (positive number) will be converted to -5
@raxmax14217 ай бұрын
very helpful, thank you
@Ivanesenses6 ай бұрын
thanks Rayan!
@o.fm.a55733 ай бұрын
Why is 1 negative and 0 positive? I find it confusing 😅
@theEtch2 ай бұрын
because it's positive by default. the first bit is reserved for that I think.
@theEtch2 ай бұрын
as it's a signed byte
@oglothenerd Жыл бұрын
I am needing to use them because I am making a voxel game.
@alexhyettdev Жыл бұрын
That’s awesome. I have had “make a game” on my todo list for a long time. One of these days.
@oglothenerd Жыл бұрын
@@alexhyettdev Highly recommend Rust with the Bevy engine!
@SurajAbdullai Жыл бұрын
@@alexhyettdev Hi pls my account got banned and i need your help
@bijjepurushotham76679 ай бұрын
nice explanation
@jumbo9996148 ай бұрын
Please tech me this code Below is part of code that someone wrote for making dot matrix led 8x8 text scrolling byte bitmap[8][7]; int numZones = sizeof(bitmap) / 8; // One Zone refers to one 8 x 8 Matrix ( Group of 8 columns) int maxZoneIndex = numZones - 1; int numCols = numZones * 8; // Converts row and colum to bitmap bit and turn it off/on void Plot(int col, int row, bool isOn) { int zone = col / 8; int colBitIndex = x % 8; byte colBit = 1
@oreokarail Жыл бұрын
Don't stop. There's a long way to go...
@alexhyettdev Жыл бұрын
Yes it is definitely a long journey!
@ericni22167 күн бұрын
I love to have less variables thank you, my arduino now can fit more
@shinkansen1907Ай бұрын
thanks
@hariram56544 ай бұрын
Respect from INDIA😇
@robertvalentic4939Ай бұрын
also good for networked games
@hydrotdАй бұрын
came for shift
@endribehari6645Ай бұрын
You can a and b not 6 and 7
@realdragon Жыл бұрын
I discovered using bitwise operators is faster than dividing by 2 for floats
@alexhyettdev Жыл бұрын
Good to know! Thanks for sharing.
@leonardeuler410 ай бұрын
Which language?
@realdragon10 ай бұрын
@@leonardeuler4 C
@Debianguy3110 ай бұрын
@@leonardeuler4any Language
@martinfinch501110 ай бұрын
Also multiplying by 2 using the bit shift left operator is faster as well I believe
@UnknownGamer-lw7zp5 ай бұрын
Tq
@DinHamburg23 сағат бұрын
how can you make a vid about bits and not mention 'Hackers Delight' ?? fail
@meerkatpowergaming9412 Жыл бұрын
This video is a bit loaded for someone who is truly a beginner.
@alexhyettdev Жыл бұрын
Noted. I will try and do some more videos for true beginners in the future.
@meerkatpowergaming9412 Жыл бұрын
@@alexhyettdev Yeah I just find it truly hard to find resources for others on this specific subject. Even 10 years ago.
@seanfull7123 Жыл бұрын
Teach my class plz
@alexhyettdev Жыл бұрын
Is your teacher not very good, or just boring? 🤣
@newbsagehaha2 күн бұрын
this video sucks. is too short. too fast. too annoying. too script reading. low energy. and bad instruction.
@newbsagehaha2 күн бұрын
stock video of black guy in first 7 seconds, tons of stupid sh't in your background, annoying trendy cuts and camera movements. yep youre a youtuber. nice job.