Topic 2_1 Digital Logic
Topic 2_1 Digital Logic
Topic 2_1 Digital Logic
p
Fundamentals of Computer Science
3-5
2.1 Transistors
y Boolean algebra:
g basis for computer
p logic
g
design
y Transistors: means for implementing Boolean
algebra
y Switches: on/off to represent the 0’s and 1’s
of binary digital circuits
y Combined to form logic gates
2.2 Boolean Algebra
y George
g Boole developed
p ‘Boolean Algebra’
g
(details later) Æ it’s applied in the design and
analysis of digital systems.
y Boolean algebra is a mathematical system for the
manipulation of variables that can have one of
two values.
y In formal logic,
logic these values
alues are “true”
true and “false
false.”
y In digital systems, these values are “on” and “off,” 1 and 0, or
“high” and “low.”
y Boolean expressions are created by performing
operations on Boolean variables.
y Common Boolean operators include AND, OR, and NOT.
7
2.2 Boolean Algebra
8
2.2 Boolean Algebra
9
Boolean Operators
y EXCLUSIVE-OR
A B C
y Result TRUE if either A or B is
TRUE but not both 0 0 0
y C =A ⊕ B 0 1 1
Now you k
N know why
h ththe bi
binary numbering
b i
system is so handy in digital systems.
11
2.2 Boolean Algebra
12
2.2 Boolean Algebra
y As with common
arithmetic, Boolean
operations have rules of
precedence.
precedence
y The NOT operator has
highest priority,
priority followed
by AND and then OR.
y This is how we chose the
(shaded) function
subparts in our table.
13
2.2 Boolean Algebra
14
2.2 Boolean Algebra
15
2.2 Boolean Algebra
16
2.2 Boolean Algebra
17
2.2 Boolean Algebra
18
2.2 Boolean Algebra
19
2.2 Boolean Algebra
y DeMorgan’s
g law can be extended to any
y number of
variables.
y Replace each variable by its complement and
change all ANDs to ORs and all ORs to ANDs.
y Thus, we find the the complement of:
is:
20
2.2 Boolean Algebra
21
2.2 Boolean Algebra
22
2.2 Boolean Algebra
y It is easy
y to convert a function
to sum-of-products form using
its truth table.
y We are interested in the values
of the variables that make the
function true (=1).
( 1).
y Using the truth table, we list the
values of the variables that
result in a true function value.
y Each group of variables is then
ORed together.
together
23
2.2 Boolean Algebra
y The sum-of-products
p form
for our function is:
24
2.3 Logic Gates
25
2.3 Logic Gates
27
2.3 Logic Gates
28
2.3 Logic Gates
29
2.3 Logic Gates
30
2.4 Digital Components
32
2.5 Combinational Circuits
y C
Combinational logic
g circuits
give us many useful devices.
y One of the simplest is the half
adder, which finds the sum of
two bits.
y We can gain some insight as
to the construction of a half
adder by looking at its truth
table, shown at the right.
33
2.5 Combinational Circuits
34
2.5 Combinational Circuits
35
2.5 Combinational Circuits
36
2.5 Combinational Circuits
y Here
Here’s
s our completed full adder.
37
2.5 Combinational Circuits
38
2.5 Combinational Circuits
39
2.5 Combinational Circuits
If x = 0 and y = 1,
which output
line is enabled?
40
2.5 Combinational Circuits
y A multiplexer
p does jjust the
opposite of a decoder.
y It selects a single output from
severall iinputs.
t
y The particular input chosen
for output is determined by
the value of the multiplexer’s
control lines.
This is a block
y To
T beb able
bl tto select
l t among n diagram for a
inputs, log2n control lines are multiplexer.
needed.
41
2.5 Combinational Circuits
If S0 = 1 and S1 = 0,
which input is
transferred to the
output?
p
42
2.5 Combinational Circuits
y This shifter
moves the bits
of a nibble
one position
iti
to the left or
right.
If S = 0, in which
direction do the
i
input t bits
bit shift?
hift?
43