Documente Academic
Documente Profesional
Documente Cultură
Number Systems
A number system is a way of counting
things. It's a way of identifying the quantity
of something.
Number systems of a given radix or base
provide the means of quantifying
information for processing by digital
systems e.g.
systems,
e g the radix or base of decimal
number is 10 and binary numbers is 2.
3
Decimal Numbers
The decimal number is expressed as:
DN 1 DN 2 DN 3 D1 D0
where N is the no. of digits
General rule:
DN 110 N 1 + DN 2 10 N 2 + DN 310 N 3 + +D110 + D0
Examples:
1 536 = 5 10 2 + 3 101 + 6 10 0 = 536
1.
2. 3192 = 3 10 3 + 1 10 2 + 9 101 + 2 10 0 = 3192
V = dn 1r n 1 + dn 2 r n 2 + L + d1r + d0
Value of a number is absolute, but a particular value can be represented
in different number systems.
B = bn 1bn 2 bn 3 L b1b0 ,
The value of B can be evaluated by the general formula,
formula
V = dn 1r n 1 + dn 2 r n 2 + L + d1r + d0
Example:
10112 = 1 2 3 + 0 2 2 + 1 21 + 1
= (8 + 0 + 2 + 1)10
= 1110
7
Decimal-to-Binary Conversion
Convert the decimal number 1410 to a binary number.
14 2 = 7
72=3
Remainder
0 = b0
1 = b1
3 2 =1
1 2 = 0
1 = b2
1 = b3
b3b2b1b0 = 1110 2
14.5610=?
9
10
Hexadecimal Digits
11
12
Binary Arithmetic
13
Signed Numbers
Signed numbers provide the means by which both positive
andd negative
ti numbers
b may be
b represented.
t d
Three main
Th
i signed
i d numbers:
b
1. Signed magnitude
2 True
2.
T
(radix)
( di ) complement
l
3. Radix-minus-1 complement
14
Examples:
Decimal
Signed
g
magnitude
g
+15
01111
+10
01010
+0
00000
-0
10000
-10
11010
-15
11111
sign
15
16
Radix - 1
Radix - 1
17
Radix - 1
Radix - 1
18
Complements in Number
N mber Systems
S stems
2. Radix-minus-one complement
Radix - 1
Radix - 1
19
Radix - 1
Radix - 1
20
(2
e.g. For
F a 4-bit
4 bit no., 2 N 1 = 10000 1 = 01111
(2
11' s complement + 1
21
22
23
24
25
27
28
Example:
The value for which a 44-bit
bit signed 22ss complement no. that can
be represented are between the range of -8 to +7.
29
30
31
32
33
Summary
y of Objectives
j
After completing
p
g this section,, you
y should be able
to:
1. Understand how to use numbers of different
bases to represent a quantity.
2. Convert numbers in one base to numbers of
another base, especially in binary, octal, decimal,
and hexadecimal bases.
3. Understand the function and conversion of
signed binary codes.
34
36
Boolean
oo ea algebra
a geb a iss similar
s
a to the
t e ordinary
o d a y algebra
a geb a but
based on only 2 possible states, ON-OFF (or TRUEFALSE,
S , or 1-0)) called logic
g states.
37
Logic Functions
NOT
AND
OR
38
state = L
lit
Li ht bulb
Light
b lb =
not lit state = NOT L or L
39
41
L=S
Truth table
42
S2
S1
S2
AND
Light bulb L
A simple
i l circuit
i it utilizing
tili i AND gate
t
43
B
0
L
0
Truth table
44
OR Function
S1
OR
S1
S2
V
S2
Light bulb L
A simple
i l circuit
i i utilizing
ili i OR gate
45
OR Function (cont.)
The lamp (L) will turn on when one of the two switches (S1
or S2) is closed.
closed
L = S1 + S2 where + is read as OR.
Truth table
46
Combining
g Basic Logic
g Functions ((1))
A logic circuit composes of NOT and AND logic functions.
C=A
X=C.B
X = AB
47
D=A.B
E=D
X=E+C
X = AB+C
48
50
51
53
Theorem
Name
1a
A+B=B+A
Commutative
1b
AB=BA
2a
(A + B) + C = A + (B + C)
2b
(A B) C = A (B C)
3a
A (B + C) = A B + A C
3b
A + (B C) = (A + B) (A + C)
4a
A+A=A
4b
AA =A
5a
(A) = A
5b
A=A
6a
A+A B =A
Associative
Distributive
Identity
Negation
Redundancy
54
Theorem
6b
A (A + B) = A
7a
0+A=A
7b
1A=A
7c
1+A=1
7d
0A=0
8a
A+A= 1
8b
AA=0
9a
A+AB=A+B
9b
A (A + B) = A B
10a
A+B=AB
10b
AB=A+B
Name
De Morgans theorem
55
AB
A+AB
56
A+B
A+B
1
57
Proof by
y Algebraic
g
Manipulations
p
Theorem 3b. (A + B) (A + C) = A + B C
(A + B) (A + C)
= (A + B) A + (A + B) C
= A (A + B) + C (A + B)
= AA+ AB+CA+C B
= A + A B + A C + B C
= A (1 + B + C) + B C
= A + BC
58
Algebraic
g
Simplifications
p
& Manipulations
p
A (A B + C)
= A A B + A C
= A B + AC
= A (B + C)
AB+ AB+ AB
= (A + A) B + A B
= 1 B + A B
= B+ AB
= B+ A
59
60
E
A
D
AND
NOT
OR
A
B
5x
NAND
C
61
L = AB
L = A B C D
AB
NAND
Truth table
62
Fig. 1.9
Circuit symbol
63
L = A+ B
L = A + B + C + D
A+B
NOR
Truth table
64
Circuit symbol
65
Truth table
66
Circuit
Circuit symbol
67
X Y = X + Y
= (A + B)A + (A + B)B
(10b)
= AA + AB + AB + BB
= AB + AB
= AB
2. F = A B D + A B C D + A B C D
= A B D + A B D(C
( + C))
= B D(A + A)
=B D
68
(10a)
where X = A B C + A C D and Y = A C D + B C D + B C D
3. F = A B C + A C D + A C D + B C D + B C D
= (A B C + A C D) (A C D + B C D + B C D)
= (A B C + A C D) (A + C + D + B C D + B C D)
= A A B C+A A C D+A B C C+A C C D+A B C D+A C D D
=AB C+AB C+AB C D
= A B C(1 + D)
=ABC
69
70
A+B= A B
71
F = AB + CD
= AB CD
72
F = ABC + D
= ABC D
73
A+ B= A+ B
74
AB = A+ B
75
(A + B)(A + C) = A + B + A + C
76
77
Example:
L = W X + X Y + W Y Z + X Y Z
= W X Y + W X Y + X Y + W Y Z + X Y Z
= W X Y Z + W X Y Z + W X Y + X Y + W Y Z + X Y Z
79
From Row 4,
L = 1 when X = 1, Y = 0, and Z =
0 Thus,
0.
Thus X Y Z = 1
Row
1
1
1
1
1
80
1
1
1
1
1
Similarly, Rows 3,
Similarly
3 6,
6 and 7
lead to different
combination
off the
th variables
i bl
L = X Y Z + X Y Z + X Y Z + X Y Z + X Y Z
81
L = (2, 3, 4, 6, 7)
m
83
Row
0
1
2
3
4
5
6
7
0
0
84
L = X +Y + Z
L = X +Y + Z
Row
0
1
2
3
4
5
6
7
0
0
L = (X +Y + Z ) (X + Y + Z ) (X + Y + Z )
85
L = ((0,1,
, , 5))
M
86
De Morgans
Morgan s theorems can simplify all the possible logic
functions which contains one type of logic gate.
Procedure for designing a NAND-only circuit
1. Convert the logic expression to sum
sum-of-products
of products form.
2. Draw the corresponding two-level AND-OR circuit and
change
g all ggates to NAND.
87
AND-OR circuit
= (X + Y )(X + Z )
= (X Y
Y ) (X Z )
89
90
L = X Y + X Z
= (X + Y )(X + Z )
OR AND circuit
OR-AND
i i
92
AB
AB
=0
AB
AB
=1
B
0
1
A 0
B
0
A 0
1
1
A simple
i l K-map
94
95
Row
L = AB+ AB+ AB
L1 = A B + A B = B
L2 = A B + A B = A
L = L1 + L2 = A + B
96
L = AB+ AB+ AB
A
L = A+ B
1
1
A
97
Contains 8 cells.
Each cell represents the logic product of all 3 variables.
AB
00
C
01
11
ABC
ABC
10
98
99
01
0
1
11
10
00
01
11
10
L=B
101
Contains 16 cells.
Each cell represents the
l i product
logic
d off all
ll 4
variables.
CD
00
01
11
10
00
01
11
10
102
00
01
11
1
01
11
10
10
1
1
1
104
ABD
Example:
CD
00
00
01
11
10
ABD
ABCD
01
11
CD
10
1
1
L = A BC D + A B D + A B D + C D
105
L = A BC D + A BC D + A BC D + A BC D +
A BC D + A BC D + A BC D + A BC D
106
AB
CD
AB
00
01
00
01
11
10
BCD
11
10
L = AC + A B + BC D
107
108
109
Procedure
Truth table
Total
45%
30%
15%
10%
10
15
25
30
40
45
55
45
55
10
60
11
70
12
75
13
85
14
90
15
100
111
L = A BC D + A BC D + A BC D + A BC D
+A
A BC D + A BC D + A BC D + A BC D
112
BC D
01
11
10
00
01
AD
AC
11
10
L = BC D + A B + AC + A D
113
114
115
00
01
00
01
11
10
CD
AC
AB
11
10
BC D
K-map for all NOR
implementation
AD
L = (B + C + D) (A + C) (A + B) (A + D)
116
OR AND circuit
OR-AND
i i iimplementation
l
i
117
NOR-only circuit
Additional Examples
AE1. A warning light is to grow when the mains switch (S) is
on provided
id d that
th t either
ith switches
it h A andd B or C andd D are
turned on. Assume that logics 1 and 0 are produced when a
switch is closed and opened respectively, design a minimal
circuit using NAND gates to produce a logic 1 signal when
the light is on. Redesign the circuit using two-input NAND
gates only.
119
AB
00 01 11 10
CD
00
01
00 01 11 10
1
00
1
01
11
11 1
10
10
S
Z = (AB + CD)S
1
S
= ABS + CDS
= ABS + CDS
= ABS CDS
120
121
Additional Examples
AE2. A chemical process is activated only if at least three out of
four keys are inserted.
inserted Assuming that an inserted key produces
a logic 1, design a minimal circuit to achieve this using (1)
AND, OR, and NOT gates, and (2) NAND gates only.
AB
CD
00 01 11 10
00
01
11
10
1
1
1
122
123
Summary of Objectives
After completing this section, you should be able to:
1. Understand the function and apply the three basic logic gates
for more complex
p logic
g expressions.
p
2. Understand and apply Boolean equations, truth tables, or
logic diagrams to describe combinational logic.
3. Understand and apply Karnaugh maps.
4. Design logic circuits with only NAND gates or only NOR
gates.
gates
5. Understand the motivation of using only one type of logic
gates.
124
S
Sequential
ti l Circuits
Ci it
125
Introduction
Combinational circuits provide output signals upon
application of input signals which are assumed to
be available at the same time.
Memory elements are required to store information
for most digital systems
systems.
Combinational circuits become sequential circuits
when
h th
the memory elements
l
t are added.
dd d
126
Memory Elements
Three types:
1. Flip-flops
constructed from logic gates.
capable of storing 1-bit of information as long as required.
2. Registers
g
constructed from flip-flops.
used to store and manipulate multi
multi-bit
bit data.
3. Counters
count the number of bits applied to registers
registers terminals.
terminals
127
Flip-Flops
1. Set-Reset (SR) Flip-Flops
Qn+1
Qn
Not Allowed
Truth table
128
129
Clocked SR flip-flop
SR circuit symbol
131
132
Qn
Qn+1
Qn
Qn+1
133
Circuit Symbol
134
JK Flip-Flops
The most commonly used flip-flops.
135
Qn+1
No Change
Reset
Set
Qn
Toggle
Qn+1
Qn
1
1
136
Circuit Symbol
137
138
Qn
Qn+1
Qn
Qn+1
139
Circuit Symbol
140
Registers
Registers
R
i
are constructedd with
i h flip-flops
fli fl
andd usedd
for storing binary data.
One flip-flop is used for each bit.
Interconnectingg flip-flops
p p obtains multi-bit
registers.
141
Examples
144
Counters
Counting circuits are a class of sequential circuits that
require
i no external
t
l input
i
t andd may be
b clocked
l k d or
unclocked.
Clocked
Cl k d system is
i triggered
i
d by
b a master clock,
l k is
i
called synchronous.
A combinational operations trigger other operations,
y
operation.
p
this is called asynchronous
145
Timing Waveforms
rising edge
falling edge
Asnchronous Counters
147
Timing Diagram
B
MSB
149
Synchronous Counters
Synchronous
S
h
circuit
i it has
h a master
t clock,
l k the
th
operation speed is depending the clock
speed.
150
Count table
151
Qn+1
No Change
Reset
S
Set
Qn
Toggle
Qn+1
Qn
1
1
152
ENG237State
Basic Electricity &
Electronics
Present
Next
State I
Excitation
No
A
A
B
B
C
C
D
D
JA
KA
JB
KB
JC
KC
JD
KD
10
11
12
13
14
15
153
K-Maps
AB
CD
00
01
11
AB
10
00
01
11
10
CD
00
00
01
01
11
10
11
10
JA = B C D
KA = D
154
K-Maps
AB
AB
00
01
11
10
01
11
10
01
11
10
CD
CD
00
00
00
01
11
10
JB = C D
KB = C D
155
K-Maps
AB
CD
00
01
11
AB
10
01
00
11
10
CD
00
00
01
01
11
11
10
10
JC = A D
KC = D
156
K-Maps
AB
AB
00
01
11
10
C
CD
00
11
01
10
CD
00
00
01
01
11
11
10
10
JD = 1
KD = 1
157
Circuit realization
158
159
1. Using SR Flip-Flops
Qn
Qn+1
SR Excitation table
160
Next State
SR Excitations
SA
RA
SB
RB
SC
RC
1
161
K-Maps
AB
00
C
0
01
11
X
1
10
AB
C
0
00
C
0
1
00
X
X
01
11
X
1
RA = ABC
11
10
SA = ABC
AB
01
AB
C
0
00
01
11
10
SB = BC
10
AB
C
0
1
00
01
11
SC = C
10
X
1
RB = BC
AB
C
0
1
00
01
11
10
RC = C
162
Circuit Realization
163
2. Using JK Flip-Flops
Qn
Qn+1
JK Excitation table
164
Next State
JK Excitations
JA
KA
JB
KB
JC
KC
165
K-Maps
AB
C
0
01
00
11
10
AB
C
0
00
JA = BC
AB
C
0
1
00
01
11
01
11
10
AB
C
0
00
01
11
10
JB = C
10
KA = BC
AB
C
0
00
01
11
X
1
KB = C
JC = 1
10
AB
00
01
11
10
C
0
KC = 1
166
Circuit Realization
167
Summary of Objectives
After completing this section, you should be able to:
1 Understand
1.
U d
d and
d apply
l the
h function
f
i off SR,
SR D,
D T,
T andd
JK Flips.
2 Understand
2.
U d
d the
h ffunction
i off registers.
i
3. Understand and apply truth table, excitation table,
state transition
i i table,
bl andd K-map
K
to design
d i simple
i l
counters.
4 Understand
4.
U d
d and
d apply
l rising
i i andd falling
f lli edge
d
triggerings.
168