0% found this document useful (0 votes)
15 views9 pages

Logic Gates

Uploaded by

Anthony Lloyd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views9 pages

Logic Gates

Uploaded by

Anthony Lloyd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Logic Gates

A computer’s processor is made up of ​billions of logic gates​, devices which apply ​


logical operations​ to one or more ​Boolean inputs​ in order to produce a ​single output​.

Within a processor, logic gates are ​combined t​ o form ​logic circuits​. These can perform
more complex operations​ like binary addition.

Logic Gate Symbols

Each of the six required logic gates has an ​internationally recognised s​ ymbol which
you should learn. The symbols have inputs on the left and outputs on the right.

NOT AND OR XOR NAND NOR

Truth Tables

A truth table shows ​every possible combination​ of inputs and the corresponding output
for a logic gate or logic circuit. The inputs are​ labelled alphabetically ​starting with A and
the output is usually labelled ​Q​.

NOT
The NOT gate has ​one input a
​ nd ​one output​. The gate’s output is always ​the opposite​ of
its input. If the input to the gate is a ​1,​it will output 0 and vice versa.

A Q

0 1

1 0

The ​truth table​ for the NOT gate has just two columns, the input A and the output Q.
​​ ​0​
There are just two possible inputs, 1 and .

Q = A

3
AND
The AND gate has ​two inputs​, labelled A and B in the truth table below, and outputs
the product ​of the two inputs.

A B Q

0 0 0

0 1 0

1 0 0

1 1 1

Q = A × B
) when ​both inputs​ are ​TRUE​
The AND gate only outputs ​TRUE​(​1​ , otherwise it outputs
FALSE.​

OR
​ dds them together​. Therefore, the
In the same way that AND multiplies its inputs, OR a
OR gate is said to output the ​sum ​of its inputs.

A B Q

0 0 0

0 1 1

1 0 1

1 1 1

Q = A + B
OR only outputs ​FALSE when​ ​both inputs​ are ​FALSE​
. When ​one or more​ of the gate’s
inputs are ​TRUE​
, the logic gate outputs ​TRUE.​

4
XOR
The ​XOR ​gate’s full name is ​exclusively or​ and it outputs ​TRUE when
​ ​strictly one​ of its
inputs is ​TRUE​ . The gate’s truth table is the same as the OR gate with the exception of
the last line in which ​FALSE is output with two ​TRUE​inputs.

A B Q

0 0 0

0 1 1

1 0 1

1 1 0

Q = A ⊕ B

NAND
NAND is short for ​NOT AND​. The NAND gate is actually a ​combination of two gates​
which we’ve already covered, the NOT gate and the AND gate.

AND NOT NAND

The NAND gate’s truth table is the same as the AND gate’s truth table, but the output
is reversed​.
A B Q

0 0 1

0 1 1

1 0 1

1 1 0

Q = A×B

5
NOR
NOR, short for ​NOT OR ​is a ​combination ​of the two logic gates NOT and OR.

OR NOT NOR

Therefore, the NOR gate’s truth table is the same as the OR gate’s table, just with the
output reversed​.

A B Q

0 0 1

0 1 0

1 0 0

1 1 0

Q = A + B

6
Combining Logic Gates

Logic gates can be ​combined​ to form ​more complex ​circuits. You may be asked to draw
or interpret a logic circuit involving ​multiple logic gates​.

The logic circuit above combines​ four logic gates ​and can be represented using the​ ​
logical expression b​ elow.

Q = C ⊕ ((B×C) + A )
In order to create a truth table for this circuit, we first need to fill in ​all the possible
permutations of inputs​ like so:

A B C Notice that the input column furthest to the left


alternates ​between ​ 0​and ​1,​the next column
0 0 0
to the right ​alternates ​between ​00​and ​11​and
0 0 1 the column furthest to the right has four ​0​s
followed by four ​1​ s. You’ll see this convention
0 1 0 used time and time again with truth tables.
0 1 1

1 0 0

1 0 1

1 1 0

1 1 1

7
Next, we ​add columns for each of the elements​ that make up the logical expression
such as B × C and A . This will make it easier for us to​ combine them​ to form the final
expression.

A B C B×C A (B × C) + A C ⊕ ((B × C) + A)

0 0 0 0 1 1 1

0 0 1 0 1 1 0

0 1 0 0 1 1 1

0 1 1 1 1 1 0

1 0 0 0 0 0 0

1 0 1 0 0 0 1

1 1 0 0 0 0 0

1 1 1 1 0 1 0

Once the column in the truth table for the​ finished expression ​is complete, the
columns used for working c​ an be removed ​and the final column ​renamed Q .

A B C Q

0 0 0 1

0 0 1 0

0 1 0 1

0 1 1 0

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 0

8
Adders

An adder is a ​logic circuit t​ hat can be used to ​add Boolean values together​. There are ​two
types​ of adder that you need to be aware of: half adders and full adders.

Half adders
A half adder is a logic circuit with t​ wo inputs​, ​two outputs​ and ​two logic gates​. The circuit
can be used to ​add two Boolean values​.

The two inputs are labelled A and B and the outputs are labelled S and C. Short for ​
sum and ​carry​.

A B S C

0 0 0 0 0 + 0 = 0

0 1 1 0 0 + 1 = 1

1 0 1 0 1 + 0 = 1

1 1 0 1 1 + 1 = 0 carry​ 1

9
Full adders
A full adder has​ three inputs ​and ​two outputs​, enabling it to input two Boolean values ​
and a carry bit ​from a previous, ​less significant ​operation.

The three inputs are labelled A, B and C​in​ for ​carry in​. The two outputs are labelled S for
sum ​and C​out​ for ​carry out​.

The full adder’s​ truth table​ looks like this:

A B C​in S C​out

0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 1 1 0 1

1 0 0 1 0

1 0 1 0 1

1 1 0 0 1

1 1 1 1 1

10
Edge-triggered D-type flip-flop

An edge-triggered D-type flip-flop is a logic circuit which can be used as a ​memory unit​
for storing the value of a ​single bit​.

An edge-triggered D-type flip-flop has​ two inputs​, one for ​data ​and another for a c​ lock
signal​. There is ​one output​, which always holds the ​value of the stored bit​.

The clock signal is ​generated by the computer​ and ​alternates between ​0 ​ ​1


and at​a set
frequency​. The value of the stored bit is ​set ​to the value of the​ data input ​with each ​
change of the clock signal.

The clock signal can also be used to synchronise ​numerous ​flip-flops when they form part
of a ​larger system ​such as a ​shift register​.

11

You might also like