Free mock test
Boolean Algebra and Logic Gates

Boolean Algebra and Logic Gates

Computer Fundamentals · 2 min read

A logic gate is a circuit with one or more inputs and one output, working on 0 and 1.

Basic gates

GateExpressionOutput is 1 when
ANDA.Bboth inputs are 1
ORA+Bat least one input is 1
NOTA'the input is 0 (it inverts)
NAND(A.B)'not both inputs are 1
NOR(A+B)'both inputs are 0
XORA xor Binputs are different
XNOR(A xor B)'inputs are the same

Truth table for two inputs

ABANDORNANDNORXORXNOR
00001101
01011010
10011010
11110001

Laws of Boolean algebra

LawRule
IdentityA+0 = A and A.1 = A
Null (domination)A+1 = 1 and A.0 = 0
IdempotentA+A = A and A.A = A
ComplementA+A' = 1 and A.A' = 0
Double negation(A')' = A
CommutativeA+B = B+A
DistributiveA.(B+C) = A.B + A.C
AbsorptionA+A.B = A
De Morgan's laws(A.B)' = A'+B' and (A+B)' = A'.B'

Adders

  • Half adder adds two bits: Sum = A XOR B, Carry = A AND B.
  • Full adder adds two bits and a carry-in: Sum = A XOR B XOR Cin.

Keep practising

Notes are only half the work. Test yourself with questions and discuss doubts with other aspirants.

Prepared for exam revision from standard computer textbooks, Microsoft documentation and official sources. Features differ between Excel and Word versions (2016, 2019, 2021, 365) so check which version your exam follows. Found a mistake? Tell us.