AND OR NOT - Logic Gates Explained - Computerphile

Поделиться
HTML-код
  • Опубликовано: 30 сен 2024

Комментарии • 418

  • @b4ux1t3-tech
    @b4ux1t3-tech 9 лет назад +131

    I already know all this stuff, but I watched the whole video simply because Professor Brailsford is such a wonderful lecturer. This is one of my all-time favorite channels, thanks for keeping with it!
    I would love to see a video going further into binary logic, for instance how NAND/NOR are used in flash memory, or how XOR is more generally used.

    • @SuperBartles
      @SuperBartles 4 года назад +2

      Christopher Pilcher Same. It’s like getting a masterclass in how to teach this stuff. I’ve been telling my son about propositional logic/Boolean algebra because it seems so useful in so many areas, most obviously computer science

    • @gradientO
      @gradientO 3 года назад

      @@SuperBartles what other areas?

  • @Nintony58
    @Nintony58 9 лет назад +370

    Had to learn this if you wanted to use redstone in Minecraft

    • @AkariInsko
      @AkariInsko 4 года назад +3

      True

    • @decrodedart2688
      @decrodedart2688 4 года назад +5

      Had to learn this (and beyond) to operate real life.

    • @Henrix1998
      @Henrix1998 3 года назад

      Similar to real life, only NAND and inverters are efficient in Minecraft, everything else needs extra pieces

    • @ziconghuang7139
      @ziconghuang7139 3 года назад +2

      But I leaned logic gate through redstone

    • @memerboi69.0
      @memerboi69.0 3 года назад

      @@Henrix1998 isn't or the simplest

  • @Rickyroko
    @Rickyroko 9 лет назад +76

    Computerphile,
    you might consider doing an episode on the implementation of logic gates in RTL / CMOS so viewers can learn how all this actually works in silicon.
    I think Professor Derek McAuley has some knowledge on this from his discussion on Moore's Law.
    Great and interesting topics! Great work.

  • @SinthTeck
    @SinthTeck 9 лет назад +49

    That "square matrix" is called a Karnaugh map

    • @sp10sn
      @sp10sn 3 года назад +3

      @KamaCoding Interesting. What culture does not?

    • @troydavis3878
      @troydavis3878 3 года назад +2

      @KamaCoding It's simply a way of denoting things more precisely. Heisenberg's uncertainty principle, Euler's Number, Karnaugh Map, Pythagorean Theorem would be Principle, Number, Map and Theorem without the descriptive name of the practitioner who is most closely associated with it. Yes, owing to the time most of these discoveries were made, that being a time in which the preeminent science and math cultures of the world were western ones, many of these concepts have an Anglo name attached. I suspect in the future, we will see many more non-western names associated with discoveries to come.

    • @l0ckb0x22
      @l0ckb0x22 2 года назад +2

      @KamaCoding No, it's a Karnaugh map. Everyone studying computer architechture/organization knows this.
      To bring up culture here is not very elegant or clever.

  • @MilcorTheMighty
    @MilcorTheMighty 9 лет назад +290

    2B + ~ 2B
    That is the question

    • @yousorooo
      @yousorooo 9 лет назад +1

      You are mixing up the symbols.

    • @18vallancel
      @18vallancel 9 лет назад +31

      2B || ~2B

    • @skifree0
      @skifree0 9 лет назад +10

      18vallancel if the 2 is interpreted as a symbol and the ~ applied on (2B) as a whole on the RHS "technically speaking" thats a tautology => true. Did i break Shakespeare yet?

    • @18vallancel
      @18vallancel 9 лет назад

      iamterence77 I know :)

    • @klutterkicker
      @klutterkicker 9 лет назад +5

      True.

  • @johnbird9997
    @johnbird9997 8 лет назад +32

    I like the way this guy explains things..are there more? Can I watch him exclusively?

  • @celinem9084
    @celinem9084 4 года назад +12

    I am 15 y/o and i learn this in school so this subject is amazing

  • @alishawhelan-baxter6727
    @alishawhelan-baxter6727 5 лет назад +17

    You teach this better than my computing teacher 😂💛

  • @heterodoxagnostic8070
    @heterodoxagnostic8070 5 лет назад +3

    in binary, 1+1=10 and the last digit is 0, so why isn't xor called logical sum instead of or gates?

  • @erelde_
    @erelde_ 9 лет назад +26

    Professor Brailsford seemed quite happy about explaining this ^^

  • @bookdream
    @bookdream 9 лет назад +7

    Probably the only Computerphile video in which I understood everything that was said.

  • @CarlosTrejo2309
    @CarlosTrejo2309 9 лет назад +4

    Thanks to Little Big Planet 2 I already knew that :)

  • @erobertt3
    @erobertt3 3 года назад +7

    disappointed that you didn't show the actual mechanics of how these work, personally I think that the logic behind it is pretty simple and intuitive

  • @anteconfig5391
    @anteconfig5391 7 лет назад +1

    That "easter egg" at 2:00 would've been fun if it lead me somewhere but this was a lot of ones and zeros to begin with. whatever I still had some fun.

  • @ShullTV
    @ShullTV 3 года назад +2

    Great video, thank you!

  • @trenvert123
    @trenvert123 6 лет назад +4

    One way of representing an OR gate mathematically is *a + b - (ab)*

    • @78anurag
      @78anurag 3 года назад +1

      How did you come up with that formula?

  • @OVRxNxOUT
    @OVRxNxOUT 2 года назад +1

    I absolutely hated Truth Tables in high school math. I think they got introduced 1st in Like algebra II OR III & got ever more complicated in Geometry & I think also Trig?? I took as many honors classes as I could & I think We even saw them pop up in my Physics class. I wish I hadn’t of hated them so much as this is one of those moments of- ‘If only I knew then what I know now…’ I would’ve appreciated them, tried a bit harder, & understood a helluva lot more about why they exist & their function to everyday life.

  • @CatboyChemicalSociety
    @CatboyChemicalSociety 9 лет назад +1

    reminds me of dem meincraft!!
    not = redstone torce + dirt
    and = dirt 1x3 + 3 torches + dust
    or = 2 blocks + 2 repeaters + dust

    • @maribelhandesu
      @maribelhandesu 5 лет назад

      the and gate of minecraft is actually a NAND gate

  • @preenaidoo298
    @preenaidoo298 4 года назад +2

    This guy could sell ice to a penguin

  • @jacquelinemartinez3485
    @jacquelinemartinez3485 2 года назад +4

    Wonderful explanation, so calm and clear! Thanks

  • @_Anna_Nass_
    @_Anna_Nass_ 2 года назад +1

    Omg I knew AND was A multiplied by B but I didn’t know why until just now and it’s so simple and I feel so dumb for not putting that together myself

  • @HungLionSmokes
    @HungLionSmokes 6 лет назад +4

    David Attenborough for logic.

  • @Midaspl
    @Midaspl 9 лет назад +26

    That 'different way' is called Karnaugh map ;) .

  • @GogiRegion
    @GogiRegion 6 лет назад +5

    As soon as you mentioned multiplication, it hit me that or is just + and xor is -. I’m working on some assembly stuff, so that might come in handy.

    • @tanveerhasan2382
      @tanveerhasan2382 4 года назад

      Xor is equivalent to minus! I never thought of that

    • @m_t_t_
      @m_t_t_ 2 года назад

      @@tanveerhasan2382 how is it? 0-1 is not 1

    • @tanveerhasan2382
      @tanveerhasan2382 2 года назад

      @@m_t_t_ it's minus 1

    • @dmitripogosian5084
      @dmitripogosian5084 Год назад

      xor is exactly + mod 2, isn't it ?

  • @richardwilliamsiv3778
    @richardwilliamsiv3778 6 лет назад +2

    Reminds me of a punet square from early biology class. I know I spelled that wrong so don't crucify me.

  • @MidnightSt
    @MidnightSt 9 лет назад +1

    COMPUTERphile, but the only notation they don't mention is the programming one, funny.
    and - &&
    or - ||
    not - !

  • @chasemarangu
    @chasemarangu 7 лет назад +2

    and (computer science) ∧ (n-ary) ⋀
    or (computer science) ∨ (n-ary) ⋁
    not (programming) ~ (sign) ¬

  • @mavriksc
    @mavriksc 9 лет назад +1

    i've never seen the ~ notation for not. the other one we used in Discrete was to put a bar over the item.

  • @Theldonio
    @Theldonio 9 лет назад +15

    You can actually create any gate using only nor gates or only nand gates. I'm pretty sure actual computers use nands (transistors) whereas Minecraft logic uses nors (redstone torches).

    • @skifree0
      @skifree0 9 лет назад +2

      actually you can frequently interchange where nands and nors are used. You can build a transistor based nor gate in the same amount of material as it does to build a nand gate. really its all dependant on the type of logic you are building.
      for instance building a S/R latch with nor gates is cheaper than building it with NAND gates because with NAND, bot S/R have to be inverted before feeding into the latch itself.

    • @FinaISpartan
      @FinaISpartan 9 лет назад

      All gates can be made with Or And Not Nor and Nand

    • @angeldude101
      @angeldude101 9 лет назад

      The nand gates in real computers are only a few micrometers across (I don't known the actual distance) and can transfer a signal extremely fast. A single not gate in Minecraft can take up to 2m^3 in volume and passes signals in just 1/10 of a second.

    • @Rocky183
      @Rocky183 9 лет назад +2

      Final Spartan
      what about if you not use and and or or and nand or and nor?

    • @ConsciousAtoms
      @ConsciousAtoms 9 лет назад

      angeldude101
      Modern cpu gate size is on the order of 20 nanometers.

  • @guilhermecunha1518
    @guilhermecunha1518 7 лет назад +1

    Easter egg.
    Easter egg.
    I wasted all that time
    For Easter egg
    Just
    Just great

  • @vimicito
    @vimicito 6 лет назад +2

    I know that I'm quite late with my comment (3 years it seems), but I really wanted to say how much I like how Professor Brailsford cares about the electronics engineers. Much appreciated!

  • @Alexus00712
    @Alexus00712 9 лет назад +9

    Anyone else knew this because of minecraft?

  • @sebastiansimon7557
    @sebastiansimon7557 9 лет назад +2

    I got the “easter egg” message without an ASCII table.

  • @trydodgingthis
    @trydodgingthis 7 лет назад +9

    This is so clearly explained and so simply put. Honestly, fantastic tutorial

  • @Koseiku
    @Koseiku 9 лет назад +2

    Good video, prof. I am learning logic gates right now. Quite an interesting topic.

  • @thofus
    @thofus 9 лет назад +1

    The current memory circuits in todays electronics are made of NAND gates (an AND gate combined with a NOT gate ). :-)

  • @conorm2524
    @conorm2524 4 года назад +1

    Noob question:
    At 1:20 when he says 0 and 0 is false, why is that?
    Could it be argued that because both are in a "false state" so to speak it is actually true?
    True that both are false?

    • @CarlosHenrique-ex8fg
      @CarlosHenrique-ex8fg 3 года назад

      That's because on AND gate, you multiply the two inputs to get the output and 0 in binary is considered false and 1 true, then:
      0*0 = 0 > false

  • @similartoself4750
    @similartoself4750 6 лет назад +2

    Thank you for this! Great help in only a few minutes! You guys rock!

  • @Schindlabua
    @Schindlabua 9 лет назад +7

    To our european viewers: The way Professor Brailsford draws his logic gates is not what you'll usually see around here, as he uses a US standard. We simply draw squares with a symbol in it (& for and, ≥1 for or, etc). We also use the little circles denoting not operations for brevity, and all in all I think it's nicer and more intuitive than the random shapes which you have to memorize. Seeing how americans like random standards (three feetsies in a yard!) it doesn't surprise me that they still use it though :P
    The US-standard is called US ANSI 91-1984,
    the european one IEC 60617-12.

  • @KurakiN64
    @KurakiN64 9 лет назад +1

    The logical addition actually represents the exclusive or and it perfectly makes sense when you realise that the mathematical structure ({0;1};+;⋅) in which you perform your calculations is identical to ℤ/2ℤ, hence 1 + 1 = 0.

    • @Schindlabua
      @Schindlabua 9 лет назад

      + is merely a symbol and you can define it any way you want really. It's also gotta be said that not only ℤ/2ℤ can form a boolean algebra, any lattice with a couple of additional properties does.
      + for regular old or starts to make a lot more sense when you look at how you'd build it with transistors, which is more or less just "connecting wires" - so HIGH signal + HIGH signal still equals HIGH signal, not LOW.

  • @SingHouse
    @SingHouse 9 лет назад +1

    Very interesting to a layman like me to see how abstract logic takes on a physical form through electronics! I imagine that's how computer circuits work at a very fundamental level? Computer science must be an interesting subject.

  • @xingewen
    @xingewen 9 лет назад +1

    Hello,
    At the top of the page it is written AND OR NOT XOR
    Then in the video we are explained the AND, the OR, the NOT and the NOR
    So is an XOR same as a NOR ?

    • @Computerphile
      @Computerphile  9 лет назад +1

      辛格文 XOR is a separate video, sorry for the confusion - XOR coming very soon!

    • @NWProductionsHD
      @NWProductionsHD 9 лет назад

      Amelia explained it precisely in truth table form but it's the eXclusive or.
      In the exclusive case if A or B are true, then the output is true, BUT if A AND B are both true, then the output is false. To compare it to real life an exclusive or is similar to where you order a meal at a restaurant, and you have a choice between soup OR salad as the side dish. This is an example of an exclusive or as we can have one or the other, but not both.
      When dealing with or's we assume them to be inclusive, and because of this fact we have the always funny (but extremely corny) joke:
      "A logician goes out to dinner and orders the steak, the server asks if they would like the soup or salad, the logician responds yes."
      //_^

  • @Luis1n7
    @Luis1n7 2 года назад +1

    Why does RUclips offer better lectures than my university?
    Great video! :)

  • @koszuta
    @koszuta 9 лет назад +6

    2:00 Nice Easter Egg.

    • @AkariInsko
      @AkariInsko 4 года назад

      What did it mean in text

    • @NoName-ui5ou
      @NoName-ui5ou 4 года назад

      Akari Insko "easter egg"

  • @thefoe76
    @thefoe76 2 года назад

    More specifically: we do indeed have three basic logic gates. But to create the others, two, for example NOT and AND, are enough.
    NOT ( (NOT X) AND (NOT Y) ) X OR Y

  • @TheInevitableHulk
    @TheInevitableHulk 4 года назад

    Would XOR emulate addition with AND representing the carry bit?

  • @robertlake2753
    @robertlake2753 6 лет назад

    Having problems with circuits? Try circuit solver Stumble Upon: 'Circuit Solver' by Phasor Systems on Google Play.

  • @valseedian
    @valseedian 9 лет назад

    wow...
    I somehow can believe that you've decided to throw away Computer related operational characters in favor of all the non-ascii depictions.. I'm sure it's been posted already that the characters commonly associated with these opperations are & (and), | (or), ! (not)
    I'd expect this treatment out of numberphile, but common guys...

  • @DrRChandra
    @DrRChandra 9 лет назад +7

    NOT is also written a lot of times with a bar over the input designator. For example, if the input is designated as A, NOT A will be written as an A with a line or bar over it.

    • @BertGrink
      @BertGrink 6 лет назад

      and still others use a / to denote the negative state, eg "/A", typically when you're using plain text.

  • @EMAngel2718
    @EMAngel2718 9 лет назад

    You can actually do anything you need with a nor or a nand, since (A'+B')'=A*B & (A'*B')'=A+B. This is because and & or each act for 0 like the other acts for 1.

  • @CelmorSmith
    @CelmorSmith 9 лет назад

    I think IEC symbols are easier to read wgere you don't have to remember a symbol for each logic function instead the IEC symbols pretty much explain themselves.

  • @hansangb
    @hansangb 2 года назад

    Got here a bit late. But now I have to go see if Karnaugh (sp?) map is covered as the natural extension of this series.

  • @michaelcorcoran3942
    @michaelcorcoran3942 11 месяцев назад

    My question after watching the whole thing??....Who is Docter Baggleea?

  • @jeffirwin7862
    @jeffirwin7862 9 лет назад

    Fun tidbit: the "or" symbol ∨ comes from the Latin word "vel," which translates to "or."

  • @stephengarrison172
    @stephengarrison172 5 лет назад

    easter egg - fun fact (at least in the versions I've found) there is no easter egg in the "easter egg" entry of the jargon file. Which seems a wasted shame.

  • @axelasdf
    @axelasdf 9 лет назад

    It almost feels criminal to not talk about NAND gates. There should be a following video about it. You also need a video about how once you have established a NAND gate your binary logic is completed.

  • @wanchan7842
    @wanchan7842 6 лет назад

    I can't find any video about 'boolean satisfiability problem' on the computerphile channel :(Are you going to make one?

  • @whirgod
    @whirgod 9 лет назад

    The and gate isn't even needed to make it logically sufficien is it? And can be expressed by just or and not gates: ~(~a v ~b)Also or can be expressed by and gates and not gates: ~(~a and ~b)

  • @stocktonjoans
    @stocktonjoans 9 лет назад

    ***** do any of the guys involved with this (or any of Brady's other channels) actually play minecraft, it would make a great way to demonstrate these concepts

  • @mustafatalaeezadehkhousani4856
    @mustafatalaeezadehkhousani4856 8 лет назад

    I prefer to think that NOT symbol is just that little circle. That way we already know that the triangle is just a simple buffer, so the circle with a triangle is actually a negating buffer.

  • @codeman99-dev
    @codeman99-dev 9 лет назад

    This is a strange video for this gentleman. He never mentioned why any of these operators are important. Granted if you watch previous videos you can work it out, but I thought this channel assumed every video you started with zero knowledge on the topic.

  • @obidahasdia4095
    @obidahasdia4095 4 года назад +1

    *What about XOR?*

  • @garcipat
    @garcipat 4 года назад

    Actual to jus describing AND and NOT are suficient, isnt it? Since AND is the invertion or OR

  • @sarainiaangelsong440
    @sarainiaangelsong440 2 года назад

    You forgot the And + Not for a Nand, as you did the Nor, but yeah I learned 3 notations today, all I knew before was the pictures of them but never the notation so it was neat.

  • @NA-lp2re
    @NA-lp2re 2 года назад

    Helpful knowledge when building a recycling facility in Fallout 4.

  • @skinnedtomato9720
    @skinnedtomato9720 7 лет назад

    Time for logic!
    There are three AND gates, one OR gate, and one NOR gate.
    One signal is connected to the A on the first AND gate, and one signal is connected to the B on the first AND gate. Signal A is off. This AND gate is also connected to the OR gate. A signal is connected to the A signal on the second AND gate. There is another signal on the second AND gate. Signal A and Signal B are on. The NOR gate has a signal that is on. The NOR and OR gate are connected to the A and B signals of the last AND gate. Is the last AND gate on or off?

  • @Paul-vi9gh
    @Paul-vi9gh 2 года назад

    This video helped me understand the circuit system in Factorio... :)

  • @cloviscareca
    @cloviscareca 4 года назад

    Ain't no problem. Someday I'll understand this.

  • @unvergebeneid
    @unvergebeneid 9 лет назад

    Every way to denote logic functions that doesn't need Unicode is boring and therefore Wrong™.

  • @mersadz3743
    @mersadz3743 5 лет назад +5

    "Bless his cotton socks" did he really say that? 7:06

  • @DrGreenGiant
    @DrGreenGiant 6 лет назад

    Any reason why you didn't state C type bitwise operators? & |

  • @ZorlacSkater
    @ZorlacSkater 4 года назад

    I hoped for an explanation how the NOT gate is actually build.

  • @theKashConnoisseur
    @theKashConnoisseur 9 лет назад

    All of a sudden, Minecraft Redstone makes a lot more sense...

  • @BetaSwimmer
    @BetaSwimmer 2 года назад

    Not is often also represented by the 'bang' symbol "!"
    And fun math logic, if you 'not' a logic pair, like a+b, and factorally apply the 'not' to the formula like a multiplier you also flip the operator symbol.
    Ex: ! = not
    !(a+b) ==> !a.!b
    Not(a and b) ==> not a or not b

  • @oscarchivas3123
    @oscarchivas3123 9 лет назад

    Is XOR similar to OR except there can only be one 1 (one true and one false)?

  • @silviogames
    @silviogames 9 лет назад

    There is another easter egg nobody but me might have found yet... White and Gold

  • @legendgames128
    @legendgames128 3 года назад

    For the and gate, output is false if the result shares a row with a false input. Same for any column that contains a false.

  • @victornpb
    @victornpb 9 лет назад

    what about !a in most languages it is the 'NOT' operator, not factorial.

  • @nauvis
    @nauvis 9 лет назад

    Found the Easter egg. Worth writing it out and adding the slots. Back to the video I go!

  • @bergweg
    @bergweg 9 лет назад +1

    there also other schemes, e.g: ~, &, |, ^

  • @BenuthBasnet
    @BenuthBasnet 3 года назад +1

    subscribed

  • @clix9153
    @clix9153 2 года назад

    I have a different way of creating logic operations. Any one to help me create a prototype

  • @SDILUYNTsiu39fnd
    @SDILUYNTsiu39fnd 2 года назад

    Anybody else here from frums - XNOR XNOR XNOR ?

  • @mohitrahaman21
    @mohitrahaman21 8 лет назад

    Oneplus One was really the 2014 flagship killer

  • @shanerobbins6733
    @shanerobbins6733 3 года назад

    There are "and gates" and "or gates" then there is " bill gates" 0010110010100

  • @infopackrat
    @infopackrat 3 года назад

    He should have done XOR (exclusive or).

  • @jameselliott9397
    @jameselliott9397 5 лет назад

    That’s much simpler than the traditional way it is taught.
    Why don’t we come up with world standards for electronic symbols? Would make things much simpler.
    Thank you.

  • @livedandletdie
    @livedandletdie 9 лет назад

    And Or Not Nand Nor Xand Xnand Xor Xnor for a total of 8 logical gates. N stands for not and X stands for eXclusive.

  • @MrSanktjakob
    @MrSanktjakob 7 лет назад

    Why do you use 3 different kinds of notation? that's silly!

  • @lexibigcheese
    @lexibigcheese 6 лет назад

    inputs A and B
    not ((not A) or (not B)) = A and B
    also
    not ((not A) and (not B)) = A or B

  • @tensevo
    @tensevo 7 лет назад

    He has an Apple - I did NOT see that coming.

  • @eternalodball6426
    @eternalodball6426 Год назад

    woah great it's so wonderful learning like that

  • @SirFancyPantsMcee
    @SirFancyPantsMcee 3 года назад

    This helps me remember that AND starts before OR. multiplication before division. Could be a bad way to think about it.

  • @technoworld3460
    @technoworld3460 3 года назад

    Why logic gate invented or created or discovered ?

  • @DominicVictoria
    @DominicVictoria 6 лет назад

    For people who are wondering how Not Gates really work. Not Gates technically doesn't turn convert the input into it's inverted state. Your input will just be read not modified. Instead. Gives you an output based on what your input is. Look it up and you'll know what I mean.

  • @lmiddleman
    @lmiddleman 9 лет назад

    Another common notation for NOT is the overbar.

  • @offtheball87
    @offtheball87 9 лет назад

    I like a line over the notted symbols, because then you get this little mnemonic:
    Break the line, change the sign.
    I can't write it with the line over here, but it's a handy shortcut:
    !(A + B) = !A . !B
    It's also a little easier to read when you've got a complex equation. Fewer parentheses all over the place.

  • @TheBandScanner
    @TheBandScanner 7 лет назад

    Yeah! My t-shirt design has a large 2B on the back, then a OR NOT gate symbol on the front. Rather Shakespeare like.

  • @Selur91
    @Selur91 9 лет назад

    Here in Spain the a.b(Many-times even a dot-less ab) is more commonly used, at least in college, than the a and b. Same thing for the or, but with the NOT we use it like !a, the ¬ is only used in maths.
    Also, with CMOS gates, the NOR and NAND are not a gate with a NOT behind, but the other way around, the OR is a NOR with a NOT "glued" behind.

  • @akshaypatni9733
    @akshaypatni9733 8 лет назад

    Nicely explained. Still, I have a query, what is the need of NOT gate, why was it introduced? I want to explain same to a non-IT professional, can you give me a real world example where such implementation exists?

    • @malteeaser101
      @malteeaser101 8 лет назад +1

      I imagine it is used when flipping bits, before using the Adders to add one, in calculating two's complement, which allows you to sign numbers, therefore representing the negative ones. That's a guess.
      Also, to do this would require combining a couple of Nots into a device called a 'Noter', which would be able to invert several bits. This would all be present in the arithmetic and logic unit of the CPU.