All courses › Embedded Systems and Instrumentation › Logic Gates

Logic Gates

Logic gates are the building blocks of digital electronics and software: AND gives 1 only when both inputs are 1, OR gives 1 when at least one input is 1, XOR gives 1 when the inputs differ, and NOT inverts a single input. NAND and NOR are simply AND and OR followed by a NOT.

Y=A⋅BY=A\cdot BAND: 1 only when A=1 and B=1
Y=A⊕BY=A\oplus BXOR: 1 only when A and B differ

Symbols

A, BA,\ Binputs (0 or 1)
YYoutput (0 or 1)

Example

AND gate with A=1A=1, B=0B=0:

Y=1⋅0=0Y=1\cdot0=0.

Build a truth table if you are unsure how a gate behaves.
Practise number systems and digital logic for free →

← Two's Complement · Pull-Up Resistor →

Part of Embedded Systems and Instrumentation: Number systems and digital logic.