A logic gate, in electrical engineering, takes some number of inputs binary inputs and produces a binary output. The binary inputs are basically just TRUE or FALSE, but you also might see them represented as 1 or 0, or ON and OFF.
I’ll walk through an OR gate because that’s a simple one. An OR gate has two inputs and produces one output. If any of the inputs are true, the output will be true, and the output will be false if both inputs are false. To give a real world example, let’s say you were designing a toll road. You want to let the drivers through if they have either paid the toll or have a pass, so you can take an OR gate and one of the inputs is “has pass” and the other is “paid toll” and you can use the output of that to decide to open the gate.
A truth table is just a list of all the inputs and what output you’d get. For an OR gate, it would look like this
False, False: False
False, True: True
True, False: True
True, True: True
Latest Answers