CS5720 - Week 1
Slide 7 of 20

Perceptron Example: AND Gate

AND Gate Truth Table

The AND gate is a perfect example for understanding how perceptrons work. It only outputs 1 when both inputs are 1.
Input 1 (x₁) Input 2 (x₂) Output (y)
0 0 0
0 1 0
1 0 0
1 1 1
💡 Key Insight
The AND gate requires BOTH inputs to be active (1) to produce an output. This creates a specific pattern that a perceptron can learn.

Perceptron Solution

Here's one solution that works for the AND gate. Click on each weight to understand its role:
w₁ = 0.5 (Weight for input 1)
w₂ = 0.5 (Weight for input 2)
b = -0.7 (Bias/Threshold)
Perceptron Formula:
y = step(0.5×x₁ + 0.5×x₂ - 0.7)
Decision Rule: Output 1 if sum > 0, otherwise output 0

Interactive AND Gate Perceptron

Input 1 (x₁):
0
Input 2 (x₂):
0
Σ
AND Gate
Output:
0
Step 1: Weighted Sum = 0.5×0 + 0.5×0 - 0.7 = -0.7
Step 2: Apply Step Function: -0.7 ≤ 0, so output = 0
Result: AND Gate outputs 0 (FALSE)
Prepared by Dr. Gorkem Kar