X X Ifx Otherwise
X X Ifx Otherwise
X X Ifx Otherwise
þH
j _ digital computer \"fH é
¿
ß ºt 0 ü< 1
bits [
të
þ
ß 6x÷
&¦ e
¦ ¸H programs õ
data
t
þ
[ rÏ
É ÎF
ã G&Ü
h ¼Ðs [të
þ _
ß ¸½ËÜ
+ ¼
г ð³|
& c̈ Ã
ºe
.
ªA
Õ "f s
[t
þ r #
É Qt_ devices \
$
© a
) . s
Qô
Ç$
© u
© H
l
rÐ\¦:
x
#" f
Ð&
ñ Ð\¦
§
ô
8̈Ç
. rÐ_ ôÇ Â
Òìr\
"
f_
_ bit
H
·
Ü
ú ¼
Ð"
f
r Â
É ÒìrÜ
¼
Ð ²
ú a
) .
"
f ¿º 7xÀ
á Ó_
Ã
ú
· ºïrs
כ
9 ¹K t
¦ ¦·
ú r 1 `
É ¦
§ÀÓ½ÉÃ
+ º e
¦
$ ·
úr 0 `
É ¦
§ÀÓôÇ
. gate
ÂÒØÔH 3 t
_
l r&
:
h solid-state devices e
HX
< s[t
þ r y
É
·
Ã
ú ºïr`
¦ &
¦ ã¼
H %
i Ö̧`
¦ ô
Ç
. 7
¤, ¿
£ º bits _
½
9
| Ë`
+ ¦ Z2 = {0, 1}
Ð ³
ð³
& s
[t_
þ ½
Ë gate
+
t`
þ
[ ¦
6§õ
£ °ú
s &
_
ñ ôÇ
:
Definition.
( 1. AND gate:
1 if x1 = 1 and x2 = 1
x1 ∧ x2 =
0 otherwise.
1
2. OR gate:
(
1 if x1 = 1 or x2 = 1
x1 ∨ x2 =
0 otherwise.
3. NOT
( gate:
1 if x = 0
x=
0 if x = 1.
x1 x1 ∧ x2x1 x1 ∨ x2 x
x2 x 2
x
s
Qô
Ç combinatorial circuit
r l
É %§
3
4 r t
É t
§
ú
· ¦ Õ
ª ئ§
4 r Õ
É ª s_
{§
9 s
4
Õ
ª rÛ
¼% 7
_
©
\
I %
ò Ó`
¾ ¦~
Ît
à · §Ü
ú ¼"
f
y{§
9 _
4
¸H
¸½Ë\
+ _
#
Ä»{9
>&
_
ñ a
) . Output s
inputs
sys-
tem _
I
© \
H
ÊÃ
< º{
9
Ä
â º_ circuit
¦ sequential circuit s
` ô
Ç
.
2
x1
x2 y
x3
Combinatorial Circuit
x1
x2 y
Non-combinatorial Circuit
>>
Y
h_
combinatorial circuits [
t`
þ ¦ "
fÐ
#
_
combinatorial circuit `
¦ ë
[
ß t Ã
þ º e
.
0_
A combinatorial circuit `
¦ Â
Ò ñ
Ð ³
ð
³
&
§õ
£
6 ° s
ú ³
ð³ |
& c̈ Ã
º e
¦
X symbol [ t x1, . . ., xn \
þ _
ôÇ Boolean
expression s
X = X(x1, . . . xn)
s
H
. x ¢̧
H x \
¦ literal s
ô
Ç
.
3
X = X(x1, . . . xn) Boolean expression s ¦
x1, . . ., xn \
ÅÒ#
Q
° כa1, . . ., an [
ú ts
þ {0, 1} \
e X _
°ú
`כ¦ 0
A_ l r Z
: g
O :Ü
Ë ¼Ð >
í½
ß É Ã
+ ºe
¦ Õ
ª õ
\¦ X(a1, . . . an) ¢̧
H X(xi = ai)
Ð H
.
X1 õ X2 H
Ã
º[t 0, 1, x1, . . ., xn \
þ _
ôÇ
Boolean expressions
,
(a) (X1), (b) X 1, (3) X1 ∨ X2, (d) X1 ∧ X2
¸ Boolean expression s
.
\\
V ¦ [
t
þ y = X(x1, x2, x3) = (x1 ∧ x2) ∨ x3 \
x1 = 1, x2 = 0, x3 = 0 _
°
`כ
ú ¦ Å
Ò,
y = X(1, 0, 0) = (1 ∧ 0) ∨ 0 = 0 ∧ 0 = 0 = 1.
F
c
ñ \
O H Boolean expression \
"f
H∧\
¦∨
Ð
$
>
íô
ßÇ
.
4
UV
d 1 ÅÒ# Q
6§_
£ Boolean expression _
com-
binatorial circuit \
¦Õ
ªo
¦ logic table `
¦ë
[
ß t
þ .
5
§9.2 Properties of Combinatorial circuits
For example (x ∨ y) = x ∧ y.
Definition. {9
§
4Ã
º x1, . . ., xn \
@
/K"
f
_
Ø
¦§
`
4 ¦ Å
ÒH ¿
º combinatorial circuits "
fÐ
equivalent
H
כ r>
É ¤°
á
ú r{
É 9
§[
4 t\
þ @/K
"f>¤
á
ú
° r Ø
É ¦§
`
4 ¦ Å
ÒH
rÐ[ts
þ .
·]
¡
ú \
X "
f |9
½Ë Z2 = {0, 1} \
+ &
_
ñ ô
Ç 3 gates ∨,
∧, − [
t
þ r
É 6§_
£
í
Z
ßg
O :þ
Ë t
[`¦ ë
7
ß ¤ô
á Ç
.
6
§_
£ ¿
º combinatorial circuits
H ì
rC
Z
g
O :_
Ë
õ
Ð "f
Ð °
ú r
É õ
\¦ Å
ÒH 1
x1
l xô
p Ç
rÐs
.
x1
x2 (x1 ∧ x2) ∨ x3
x3
x1
(x1 ∨ x3) ∧ (x2 ∨ x3)
x2
x3
½
ËZ
+ g
O :\
Ë
a1 ∨a2 ∨· · ·∨an
õ a1 ∧a2 ∧· · ·∧an
t
þ
[ r ì
É r"
î >
ú̧
&
_
ñ
a
) .
7
§9.3 Boolean Algebras
0_
A combinatorial circuits \
¦
Ð {
ì
9Í
ø o
6
§_
£ &
_
ñ 0 x
p .
Definition. 0
A_ 5 t Zg
O :`
Ë ¦ ë
7
ß ¤
á
H
¸
H
system [
t`
þ ¦ Boolean Algebra
ôÇ
.
#l
"f
_
system s
êÍ
ø
כ r"
É fÐ r¿
É º¶"é
è
0õ1` ¦
í
Ê
< H
_
| ½
9 ËS
+ Ð"fÕ ª¶ "
éè[
tç
þ
ß
¿
\ º >
h_
í
ß +, ∗ ü
<
_ unary operator
0 ú̧
&
_
ñ ÷
&#Q 0
A_ 5 t
í
Z
ß g
O :`
Ë ¦ ë
7
ß ¤
á
H
s
כ
.
\\
V ¦[
t
þ , Z2 = {0, 1} with + = ∨, ∗ = ∧, 0 =−
is a Boolean algebra. Õªo
¦ s s
כ ]j{
&
9
h r
É
Boolean algebra s
.
¢̧ô
Ç, U \
¦
_ universal set
¦ S = P(U )
HU _
the power set s P(U ) with + = ∪,
∗ = ∩, 0 =−, which is the complement, H
Boolean algebra s
_ .
8
Theorem. In a Boolean algebra.
(1) The element x0 is unique: If x + y = 1 and
x ∗ y = 0, then y = x0.
(2) x + x = x, x ∗ x = x: (Idempotent laws)
(3) x + 1 = 1, x ∗ 0 = 0: (Bound laws)
(4) x + x ∗ y = x, x ∗ (x + y) = x: (Absorption
laws)
(5) (x0)0 = x: (Involution laws)
(6) 00 = 1, 10 = 0: (0 and 1 laws)
(7) (x + y)0 = x0 ∗ y 0, (x ∗ y)0 = x0 + y 0: (De
Morgan’s laws)
¤Ã
: x ∗ y
Z H xy
Ð ³ðl
.
(1) y = y1 = y(x + x0) = yx + yx0 = 0 + yx0 =
xx0 + yx0 = (x + y)x0 = x0.
(7) (x+y)(x0y 0) = (xx0)y 0 +x0(yy 0) = 0y 0 +x00 =
0.
(x + y) + x0y 0 = ((x + y) + x0)((x + y) + y 0) =
(y + (x + x0))(x + (y + y 0)) = 1 · 1 = 1.
By uniqueness (1), x0y 0 = (x + y)0. ¤
9
Definition. For a statement involving Boolean
expressions, its dual is the statement obtained
by replacing 0 by 1, 1 by 0, + by ∗, ∗ by +.
¤Ã
: If P is a proof of a theorem T about
Z
Boolean algebras involving only the definitions
of the Boolean algebra, then the sequence of
statements P ∗ obtained by replacing every state-
ment in P by its dual becomes a proof of the
dual of T . ¤
10
Consider dual statements x+x = x and xx = x.
x = x+0 x = x1
= x + (xx0) x = x(x + x0)
= (x + x)(x + x0) x = xx + xx0
= (x + x)1 x = xx + 0
= x+x x = xx.
x1 x2 x1 ⊕ x2
1 1 0
1 0 1
0 1 1
0 0 0
UV
d 2 f : Z3 2 → Z2 defined by f (x1, x2, x3 ) =
x1 ∧ (x2 ∨ x3) is a Boolean function, whose in-
puts and outputs are given in the following ta-
ble:
12
UV
d 3 %
Ü
i¼Ð 6§_
£ { 9
§õ
4Ø ¦§
ç
4 _
ß
a>
' ³
ð\¦
Ð
¦ Boolean function `
¦ ¹
Ô
1
Ð:
1) Ø
¦§
_
4 °
כs
ú 1
' P
Í : ×
¦\
"
f ÅÒ#Q {
§
9 , 1,
4
1, 1 \
@/K
"fئ§
`
4 ¦1
ÐÅÒ¦ r
É ¸H{
9
§°
4 כ
ú
@
\ /K"f
H 0 `
¦ Å
ÒH ³
ð³É
& r
x1 ∧ x2 ∧ x3 s
.
2) %
r
i ئ§
s
4 1
4
P
: צ\
"
f ÅÒ# Q {
9
§ 1,
4
0, 0 \
@/K"
fØ ¦§
`
4 ¦1
ÐÅ Ò¦ r
É ¸H{
9
§°
4 כ
ú
@
\ /K"f
H 0 `
¦ Å
ÒH ³
ð³É
& r
x1 ∧ x2 ∧ x3 s
.
13
3) {
ì
9 Í&
ø Ü
h ¼
Ð x1 ∧ x2 ∧ x3 _
³
ð³\
& "f Ø
¦§
_
4 °כ
ú
1
s
× ¦\
"f{ 9
§°
4 כs
ú 0
Ã
º xi _
negation
¦[
` 2ô
Ç
.
"f6 P
:צ_
{9
§°
4 כs
ú 0, 1, 0 s
¼
Ù Ð x1 ∧ x2 ∧ x3 `
¦ ×
þ Å
Ò#Q {
9
§\
4 "fë Ø
ß ¦
s
4
§ 1 s¦
r
É ¸
H {
9
§ °
4\כ
ú @
/K"fH 0 `
¦ Ø
¦
ô
4
§ Ç
.
4) s
]jsyy
_
³ð³[
& t_
þ OR-gate \
¦ë
[
ß t
þ
_
^ the Boolean expression:
(x1 ∧ x2 ∧ x3) ∨ (x1 ∧ x2 ∧ x3) ∨ (x1 ∧ x2 ∧ x3)
` 3
¦
%>
a
) .
z´ Å
Ò#Q
³
ð_
ÊÃ
< º f (x1, x2, x3)
H s
OX>
%
#
3 Q
Boolean expression ü
< °
ú r °
É כ
ú
¦
`
H `
כ ¦ S
X
H
כ r ~
É
1 . ¤
{ì
9Í&
ø Ü
h ¼Ð 6§_
£ ñ&o
H Å
Ò#
Q
table Ð
ÂÒ'
Boolean function `
¦ 1
¹
Ô H ~
ÓZ
½ `
O ¦
Ð# Å
Ò¦ e
.
f (x1, . . . , xn) = m1 ∨ m2 ∨ · · · ∨ mk .
¤Ã
: If f is identically zero function, it is clearly
Z
a Boolean function since 0 is a Boolean expres-
sion.
15
For A ∈ Zn2 , if A = Ai for some i ∈ {1, . . . , k},
then f (A) = 1 and mi(A) = 1, so
m1(A) ∨ · · · ∨ mk (A) = 1.
IfA 6= Ai for any i ∈ {1, . . . , k}, then f (A) = 0
and mi(A) = 0, so
m1(A) ∨ · · · ∨ mk (A) = 0. ¤
UV
d 4 It is easy to find the disjunctive normal
form of the exclusive-OR x1 ⊕ x2, whose logic
table is defined by:
x1 x2 x1 ⊕ x2
1 1 0
1 0 1
0 1 1
0 0 0
x1 ⊕ x2
x2
UV
d 5 Find the disjunctive normal form of
f (x1, x2, x3) = (x1 ∨ x2) ∧ x3.
g(x1, . . . , xn) = M1 ∧ M2 ∧ · · · ∧ Mk ,
where each Mi is of the form
Mi = y1 ∨ y2 ∨ · · · ∨ yn,
where
(
xj if aj = 1
yj =
xj if aj = 0.
Mi _
¸`
ª¦ maxterm s
¦g_
¸`
ª ¦ con-
junctive normal form s
ô
Ç
.
18
§9.5 Applications
¤Ã
: x ∨ y = x ∨ y = x ∧ y, by De Morgan’s law.
Z
Now, given any function f : Zn 2 → Z2, a combi-
natorial circuit can be constructed using AND,
OR, NOT gates. But OR can be replaced by
AND and NOT gates. ¤
19
Definition. A NAND gate, denoted by
x1 ↑ x2, is defined as:
(
0 if x1 = 1 and x2 = 1
x1 ↑ x2 =
1 otherwise.
Its logic table and circuit are drawn as:
x1 x2 x1 ↑ x2
1 1 0
1 0 1
0 1 1
0 0 1
x1
x2 x1 ↑ x2
Ã
¤: Note x1 ↑ x2 = xy. Thus
Z
x = xx = x ↑ x
x ∨ y = x y = x ↑ y = (x ↑ x) ↑ (y ↑ y).
Since { OR, NOT } is functionally complete,
so is { NAND }. ¤
20
Combinatorial circuits of NOT and OR using
NAND:
x
x
x
x∨y
y
s
כ r gate _
É tÃ
º\¦ &
>
h
H
s
כ
6§
£
r gate _
É
>
hú\
¦ ×
¦s
H ~
ÓZ
½ `
O¦
Ð.
x y z f (x, y, z)
1 1 1 1
1 1 0 1
1 0 1 0
1 0 0 1
0 1 1 0
0 1 0 0
0 0 1 0
0 0 0 0
21
The disjunctive normal form of f is
Õ
ª Q
s gate _
ú 8&
h r
É rÐ\¦ë
[
ß tÃ
þ ºe
¦
H]
ë j
H ‘þ
j&’_
h
rÐ Áº% s
Á
H
s
כ . s
Q
Ç
ô `
כ¦ ¹
Ô
1 H
`
כ ¦ minimizing problem s
ôÇ
.
s
QôÇ
Ð ßçé
ô
ß Ç
rÐ\
¦ 1
¹l
Ô 0
A
#
Boolean
expresssion `
¦
$
ç
é
ß y
ß ½
É 9
+ כ
¹ e
.
]
s j E \
¦ e
_
_ Boolean expression s
Ea ∨ Ea = E = E ∨ Ea
$
w
í n
ôÇ
.
=
Ea ∨ Ea = E(a ∨ a) = E1 = E
s ¦ ¿
ºP
: 1
xd
p
r absorption law s
É .
22
"
f A
0_ Boolean function f
H
6§õ
£ °
s
ú
é
ß
çy
ß
a
):
xyz ∨ xyz ∨ xy z = xy ∨ xy z
= xy ∨ xyz ∨ xy z
= xy ∨ xz
= x(y ∨ z).
s]
j ¶
"
éA_
rÐü
< 1xu
l
combinatorial circuit
H 3 >
h_ gate ë
Ü
ß ¼
и 0
x
p
¦
6§õ
£ °
ú :
x
y
z
0_
A ~ÓZ
½ s
O ë
0
ß x
p r
É m. \
V\¦ [
t
þ Better cir-
cuit design of exclusive-OR x ⊕ y = xy ∨ xy
H]
ë j\¦
Ð 0
A_
~ÓZ
½ s
O ú̧
:x
t
3
w
l
¦ y
y
_
Boolean rule [
t`
þ ¦r
'
Ì
à ¸
Ð&6
h xK
ÐH
s
כ .
s
Ä
â ºH
xy ∨ xy = xx ∨ yx ∨ xy ∨ yy = (x ∨ y)xy.
·_
¡
ú ½
Ó r 5 >
É h_ gate \
¦ כ
¹½¨
t}
Ó`
½ ¦
Ð
4 >
h_ gate
Ð 0x
p
H
`
כ ¦ ·
Ã
ú º e
.
23
6
x 0
xô
p Ç gate _
ú Minimizing ë
H]
j\
¦
&
ñ
t
ë
ß ³F
& _ l
Õt_
ü
I
© 0xô
p Ç gate Ã
º\¦
ñ
& Ù¼
Ð minimizing ë
H]
j
H r
@/\
ô
Ç
.
ì
Í
ø ¸^1x_
p ¦^ èl Õt_
ü µÏ
1 s
ÅÒÜ
¼
_
^
rÐ\¦ s
ÀÒH integrated circuits
H
_
כ
j
] s
0xK
p &
. ¸Zt±
þ \
ú
¸כ
9 ¹ô Ç
rÐÊÃ
< º\¦
í
>
ß H
rÐn
r AND, OR, NOT, NAND
É
xõ
p
1 °
ú r
É l
© r&
:
h
gate [
tõ
þ integrated
r
Ð1
x_
p ½
ËÜ
+ ¼Ð÷ &#Qe #
Q"f Boolean algebra
H
#y
essential tool
Ð z
e
.
s]
j z
#
Qt
H multiple output `
¦ ?
/H
rÐ\¦
Ð
. n >
h_ output `
¦ ?
/H
rÐH
6§_
£ \
V %
!
3
n >
h_ Boolean expressions
Ð ³
ð³÷
& &#
Q
.
24
Consider two outputs:
y1 = ab
y2 = bc ∨ ab = bc ∨ y1.
a y1
b
y2
c
25
¤, The table for the half-adder circuit is:
£
7
x y c s
1 1 1 0
1 0 0 1
0 1 0 1
0 0 0 0
#l
"f c = xy, s = x ⊕ y
כ
`
¦ ·
Ã
ú º e
¦, the
half-adder circuit
H
6§õ
£ °
ú .
x
y s
26
Definition. A full-adder accepts as input three
bits x, y, and z and produces as output the bi-
nary sum cs of x, y, and z. The term cs is a
two-bit binary number.
[Full-Adder Circuit]
The table for the full-adder circuit is:
x y z c s
1 1 1 1 1
1 1 0 1 0
1 0 1 1 0
1 0 0 0 1
0 1 1 1 0
0 1 0 0 1
0 0 1 0 1
0 0 0 0 0
27
Using the tools set up earlier:
Ea ∨ Ea = E, E = E ∨ Ea,
we get:
28
M = x3x2x1, N = y3y2y1 \ ½
¦ Ë
+
¦
H ¿
º
binary Ã
º
¦ z4z3z2z1 `
¦ Õ
ª +
½s
Ë
.
x1 Half s z1
Adder c s
y1 z2
Full
x2
Adder c s z
y2 3
Full
x3
Adder c z
y3 4
29