Computer systems - AQALogic gates

At the simplest level, computers are little more than a collection of transistors and circuits. They connect together to form logic gates, which in turn are used to form logic circuits.

Part ofComputer ScienceTheoretical knowledge

Logic gates

In its most basic form, a computer is a collection of powered and unpowered and . A is a series of transistors connected together to give one or more , each output being based on the or combination of inputs supplied to it. There are four types of gate to consider:

  • AND gate
  • OR gate
  • NOT gate
  • XOR gate

Each type of gate can be represented either as a diagram, in algebraic form, or as a .

AND gates

An AND gate uses two inputs to generate one output. The output is 1 (TRUE) only if both of the inputs are 1 (TRUE).

AND gates are represented diagrammatically as:

Two separate AND gates representing a TRUE and a FALSE output

A represents the first input. B represents the second input. Q represents the output.

A truth table shows, for each combination of inputs, what the output will be. Like logic gates, a 0 in the table represents FALSE, while 1 represents TRUE.

An AND gate is represented in the truth table below.

ABQ
000
010
100
111
A0
B0
Q0
A0
B1
Q0
A1
B0
Q0
A1
B1
Q1

OR gates

An OR gate uses two inputs to generate one output. The output is 1 (TRUE) only if either or both of the inputs are 1 (TRUE).

OR gates are represented diagrammatically as:

Two separate OR gates representing TRUE outputs

A represents the first input. B represents the second input. Q represents the output.

An OR gate is represented in the truth table as below.

ABQ
000
011
101
111
A0
B0
Q0
A0
B1
Q1
A1
B0
Q1
A1
B1
Q1

NOT gates

A NOT gate uses just one input to generate one output. A NOT gate inverts the input - the output is 1 (TRUE) if the input is 0 (FALSE), and the output is 0 (FALSE) if the input is 1 (TRUE).

NOT gates are represented diagrammatically as:

Two separate NOT gates representing a TRUE and a FALSE output

The NOT gate has what appears to be a nose at the front. When using more complex gates, this nose is added to other gates to show they have been combined with the NOT gate.

A NOT gate is represented in the truth table below.

AQ
01
10
A0
Q1
A1
Q0

XOR gates

The XOR gate is known as the exclusive OR gate. This gives the true meaning of the word OR. The XOR gate outputs 1 (TRUE) when any input is 1 (TRUE). But unlike the OR gate, when both input 1 (TRUE), the OUTPUT is 0 (FALSE).

XOR gate with a 0 output
XOR gate with a 1 output

An XOR gate is represented in the truth table below.

ABOutput
000
011
101
110
A0
B0
Output0
A0
B1
Output1
A1
B0
Output1
A1
B1
Output0

Boolean notation

Logical expressions can also be expressed using algebra notation. Instead of writing the words AND, OR, NOT or XOR it is often written using the following shorthand notation.

Boolean expressionShorthand notation
A AND BA . B
A OR BA + B
NOT AA’ (can be also shown as Ā)
A XOR BA ⊕ B
Boolean expressionA AND B
Shorthand notationA . B
Boolean expressionA OR B
Shorthand notationA + B
Boolean expressionNOT A
Shorthand notationA’ (can be also shown as Ā)
Boolean expressionA XOR B
Shorthand notationA ⊕ B