Studyfin Studyfin ✨ Sign up free

Boolean logic (AND, OR, NOT)

Grade 4 · Coding · Free lesson

Hi there! Today we are going to explore Boolean logic. It is a cool way that computers make decisions using simple rules!

Computers think in a very special way. They use Boolean logic, which means every statement is either True or False. We can use words like AND, OR, and NOT to build these rules.

xor

The rule AND needs both parts to be true. For example, you can play outside only if it is sunny AND you finished your homework. If either part is false, the whole rule is false.

Sunny (TRUE) AND Homework (TRUE) = Go Outside! (TRUE)

The rule OR only needs one part to be true. You can have fun if you play video games OR read a book. If you do at least one of those, the whole rule becomes true!

Game (TRUE) OR Book (FALSE) = Having Fun! (TRUE)

The rule NOT is like a flipper. It changes True to False, or False to True. If it is NOT raining, then you can go play!

TRUE NOT FALSE
✏️ Worked example

Let us solve this puzzle step-by-step. Is the expression (NOT False) AND True equal to True or False?

  1. First, find the part inside the parentheses: NOT False.
  2. The NOT rule flips the value. So, NOT False becomes True.
  3. Now, rewrite the whole expression with our new value: True AND True.
  4. The AND rule needs both parts to be true for the whole thing to be true.
  5. Since both sides are True, the final answer is True!
school
Want the full interactive lesson — quiz, animations, and Finn cheering them on?

More Coding lessons