Game Development Reference

In-Depth Information

switches called
logic gates
allow for the circuit to be opened or closed,

depending on two incoming electrical currents instead of the one from the

previous example.

In all, there are seven logic gate configurations that take two currents as input

and output a single current. These gates are called AND, OR, NOT, NAND, NOR,

XOR, and XNOR. The AND gate takes two input currents; if both currents are

on, the output current is on. If only one or none of the input currents is on, the

output is off. This is illustrated in
Figure 1.24
.

In computer science,
1
the operation of combining two currents or signals into

one is called
Boolean algebra
2
and logic gate names (i.e., AND, OR) are called

Boolean functions
, although the
on
signal in computer science is referred

to as TRUE or the value 1 and
off
is FALSE or 0. Using this terminology, all

possible functions of the AND gate can be represented in
truth tables
shown

in
Table 1.1
. It should be noted from
Table 1.1
that truth tables can be written

in a number of formats using 1s and 0s or TRUEs and FALSEs.

Fig 1.24
A conceptualization of an

AND logic gate.

off

off

off

on

off

off

off

off

on

on

on

on

1
And mathematics, physics, information technology, etc.

2
Named after George Boole, the 19th-century mathematician who first defined algebraic

systems of logic.