Basic Logic Not Math behind the boolean operator

Understanding the basics of Logic Not Math behind the Boolean Algebra

Β·

3 min read

Gorege Boole tossed the concept of Boolean Algebra

and said one can represent any logical statement with AND, OR, NOT

Basic Logic is in their name

Starting with AND

assume AND as a 5-year-old child who demands telescope πŸ”­ and StarshipπŸš€, so if you provide him with both stuff he will be happy, and if anyone or both aren't there the child will start crying.

Similar with AND if it say I want value x > 3 & y < 5 then the condition will only satisfy if both stuff are true

Telescope πŸ”­Starship πŸš€Output Q
000
010
100
111

Moving towards OR

the same child here also, where now he demand Falcon 9 OR Saturn 5 as he wants to Mars. So, if you provide him Falcon 9 he will be happy as his Mission will be completed with Falcon 9, but show you aren't able to contact Elon to arrange Falcon 9 but you are able to contact NASA for Saturn 5 even then the 5 yr Child will be happy. Also, if you provided him with both Falcon 9 and Saturn 5 he will be happy as now he can talk to the crew too.

Similar, to OR, if it wants Falcon 9 || Saturn 5 if it gets Falcon 9 it will be satisfied even if it got Saturn 5 he will be satisfied, but it won't satisfy if both are False

Falcon 9πŸš€Saturn 5 πŸͺπŸš€Output Q
000
011
101
111

Now comes NOT

not is very simple to understand, it is used to negate the condition, so if just convert's the value of the condition, from true to false and false to true. | Input A | Input B | |:-------:|:-------:| | 0 | 1 | | 1 | 0 |

Now comes XOR, NAND, NOR above basics.

XOR

XORonly wants one true value to be true, example the child only wants SpaceX or Saturn 5 but not both, if you give both he will break the rocket in two pieces, so please with XOR you can only give him one of them.

Input AInput BOutput Q
000
011
101
110

NOR

A situation where one except's nothing from anyone, the child is now grown up, now he doesn't need your help to build a complete rocket. If you don't give him anything he will be happy,

Input AInput BOutput Q
001βœ…
010❌
100❌
110❌

NAND

Here the child doesn't want both things from you he only even if you don't give anything to him he will be happy, but if you give him both he will cry, but you can give one of any.

Input AInput BOutput Q
001βœ…
011βœ…
101βœ…
110❌

credits to Isaac Computer Science

Repo: @Day5 Blog

ping πŸ€™πŸΎ me on Twitter @abhayprajapati

Did you find this article valuable?

Support @Abhay's Blog by becoming a sponsor. Any amount is appreciated!

Β