Boolean Logic

Logic Gates

All logic gates work on Input/Process/Output model (just like a computer, but much more simple)

AND (one and the other)

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

0

0

0

1

 

OR (one or the other or both)

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

0

1

1

1

 

NOT (this is a unary operation, there is only one input)

Truth Table   Diagram

A

0

1

Q

1

0

 

NAND (this is simply a combination of NOT and AND)

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

1

1

1

0

 

NOR (for both NAND and NOR, notice the little circle at the front? that's the NOT component)

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

1

0

0

0

 

XOR

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

0

1

1

0

 

XNOR

Truth Table   Diagram

A

0

0

1

1

B

0

1

0

1

Q

1

0

0

1

 

Combinations are fun. They require 3 variables and 8 different decisions to be made.

A B C Q  

0

0

0

0

1

1

1

1

0

0

1

1

0

0

1

1

0

1

0

1

0

1

0

1

0

0

0

0

0

0

1

0

Simple Adder

The most basic application of these logic gates is to set up a system that will add two binary numbers together. This is called a 'simple adder'.

First, let's take a look at how adding in binary works (with one digit)

It seems like we get a 1 in the ones column when the values we're adding together are different and 0 when they're the same. That corresponds with XOR. For the second column, we need 1 when both numbers being added are 1 and 0 otherwise, that's AND.

HOME