Simple Logic Gates

Computer Logic

Binary and Boolean Variables

A Binary or Boolean variable has one of two values

Gates

The term Gate is used to describe the members of a set of basic electronic components which, when combined with each other, are able to perform complex logical and arithmetic operations. 'Gates' are the physical realization of the simple Boolean expressions.

An understanding of the electronics within logic gates is beyond the scope of this course however it should be noted that logic gates can be designed with only a few electronic components. For example the following circuit diagram shows how an 'AND' logic gate can be constructed from two transistors and a resistor.

AND circuit

Types of Logic Gates

The 'OR' Gate

OR symbol

 Truth Table

X       Y       X OR Y
0       0          0
0       1          1
1       0          1
1       1          1
Note: the output value is 1 when at least one input value is 1

The 'AND' Gate

OR symbol

 Truth Table

X       Y       X OR Y
0       0          0
0       1          0
1       0          0
1       1          1
Notes: The output is 1 only when both inputs are 1

The 'NOT' Gate

OR symbol

 Truth Table

X       X OR Y
0          1
1          0
Note: Only one input

Binary Arithmetic

Addition: You add binary numbers as you would decimal numbers except you must carry when you rach the value "2" in decimal.

Examples of Binary Addition: 1 + 0 = 1; 1 + 1 = 10; 10 + 10 = 100; 11 + 10 = 101