Professional Documents
Culture Documents
University of Waterloo
= (8 192)10
= 8 103 + 1 102 + 9 101 + 2 100
= (12.5)10
= 1 101 + 2 100 + 5 10-1
December-10-14
Representation of 1
Voltage (e.g., 0 V)
December-10-14
2n
2n
2n
-8
0.00390625
256
-7
0.0078125
512
NOTE:
-6
0.015625
10
1024
-5
0.03125
11
2048
-4
0.0675
16
12
4096
-3
0.125
32
13
8192
-2
0.25
64
14
16384
-1
0.5
128
15
32768
December-10-14
Base 10
Base 2
December-10-14
Important Powers of 2
There are certain powers of 2 that are easier to remember
due to their importance:
For example:
210 = 1 024
= Kilo
= (1 024)1
= Mega
= (1 024)2
= Giga
= (1 024)3
= Tera
= (1 024)4
December-10-14
(1101 0110)2
(0011 0010)2
______________
(1 0000 1000)2
(214)10
(50)10
________
(264)10
Subtraction Example
Minuend:
Subtrahend:
Difference:
December-10-14
(1101 0110)2
(0011 0010)2
____________
(1010 0100)2
(214)10
(50)10
________
(164)10
Product:
December-10-14
(1010)2
(0110)2
________
(0000)2
(1 010)2
(10 10)2
(000 0)2
______________
(0011 1100)2
(10)10
(6)10
______
(0)10
(20)10
(40)10
(0)10
______
(60)10
= (1100.1)2
December-10-14
Fraction Remaining
0.0125 2
= 0.025
(0.0)2
0.025
0.0250 2
= 0.05
(0.00)2
0.05
0.05 2
= 0.1
(0.000)2
0.1
0.1 2
= 0.2
(0.0000)2
0.2
0.2 2
= 0.4
(0.0000 0)2
0.4
0.4 2
= 0.8
(0.0000 00)2
0.8
0.8 2
= 1.6
(0.0000 001)2
0.6
0.6 2
= 1.2
(0.0000 0011)2
0.2
0.2 2
= 0.4
0.4
0.4 2
= 0.8
0.8
December-10-14
10
Octal Representation
Octal is base 8
Digits range from 0 to 7 {0,1,2,3,4,5,6,7}
December-10-14
11
Hexadecimal Representation
Hexadecimal is base 16
Digits range from 0 to F {0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F}
December-10-14
12
Complements
Complements of numbers are often useful to simplify
arithmetic
Two types of complements are popular:
Diminished Radix Complement (1s complement for binary)
Radix Complement (2s complement for binary)
December-10-14
13
December-10-14
14
Radix Complement
Given a number N in base r having n digits, the radix
complement is defined as rn N
This is often called the rs complement
December-10-14
15
December-10-14
16
Subtraction Example
Using 2s complement, subtract (1010)2 (0110)2
M
= (1010)2
= (0110)2
2s complement of N
= (1010)2
MN
(1010)2
2s complement of N
(1010)2
___________
Intermediate Result
= (1 0100)2
Final Answer
December-10-14
(0100)2
NOTE:
The end carry
is discarded to
arrive at the
final result.
17
Subtraction Example 2
Using 2s complement, subtract (0110)2 (1010)2
M
= (0110)2
= (1010)2
2s complement of N
= (0110)2
MN
(0110)2
2s complement of N
(0110)2
___________
Intermediate Result
(1100)2
Final Result
(0100)2
December-10-14
NOTE:
In this case, the
final answer is found
by taking the 2s
complement of the
intermediate result
18
December-10-14
19
Subtraction Example
Using 1s complement, subtract (1010)2 (0110)2
M
= (1010)2
= (0110)2
1s complement of N
= (1001)2
MN
(1010)2
1s complement of N
(1001)2
____________
Intermediate Result
= (1 0011)2
Final Answer
December-10-14
(0100)2
NOTE:
A value of 1 is
added to the result
to compensate for
the representation.
20
December-10-14
21
Signed Magnitude
Signed 1s Complement
Signed 2s Complement
+7
0111
0111
0111
+6
0110
0110
0110
+5
0101
0101
0101
+4
0100
0100
0100
+3
0011
0011
0011
+2
0010
0010
0010
+1
0001
0001
0001
+0
0000
0000
0000
-0
1000
1111
N/A
-1
1001
1110
1111
-2
1010
1101
1110
-3
1011
1100
1101
-4
1100
1011
1100
-5
1101
1010
1011
-6
1110
1001
1010
-7
1111
1000
1001
-8
N/A
N/A
1000
December-10-14
22
Important Observations
for Signed Binary Numbers
If the most significant bit is a 0, the number is positive
If the most significant bit is a 1, the number is negative
The signed binary number representation is irrelevant for the
purpose of determining whether a value is positive or
negative
December-10-14
23
Signed Arithmetic
Signed arithmetic obeys the same basic rules as unsigned
arithmetic
Carries beyond the width of the number representation should
be discarded
Width of number representation must be large enough to
avoid an overflow condition
Overflow occurs if both number possess the same sign and the
result possesses a different sign
Overflow can be accommodated by making the result 1 bit larger
December-10-14
24
(0110)2
(1010)2
_________
(1 0000)2
Addition Example 2
(6)10
(-6)10
_____
(16)10
Augend:
Addend:
Sum:
(1110)2
(1010)2
_________
(1 1000)2
(-2)10
(-6)10
_____
(-8)10
NOTE:
2s complement arithmetic has
been used in these examples.
December-10-14
25
December-10-14
Decimal Digit
BCD Digit
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
26
December-10-14
27
(1)BCD
(1)BCD
(0010)BCD
(1000)BCD
(0100)BCD
(284)10
(0110)BCD
(0111)BCD
(0110)BCD
(676)10
_____________
________________
Binary Sum
(1001)BCD
(1 0000)BCD
Add (6)10
(0110)BCD
(0110)BCD
_____________
BCD Sum
December-10-14
(1001)BCD
________________
(0110)BCD
_____________
(1010)BCD
_____________
(0000)BCD
__________
(960)10
__________
(960)10
28
Gray Code
Gray code is a binary code that minimizes the number of bits
that change values during incrementing or decrementing
Extremely useful code for systems that process continuous
signals (e.g., sampled analog signals) and for low-power
computer systems (e.g., cellular phones)
Fewer bits changing provides the following benefits:
1. Lower dynamic power consumption
2. Faster data transitions
3. Greater reliability of data
December-10-14
29
Gray Code
December-10-14
Decimal
Number
Gray
Code
Decimal
Number
Gray
Code
0000
1100
0001
1101
0011
10
1111
0010
11
1110
0110
12
1010
0111
13
1011
0101
14
1001
0100
15
1000
30
December-10-14
31
December-10-14
32
2. Identity elements
a) An identity element with respect to +, designated by 0: x + 0 = 0 + x = x
b) An identity element with respect to , designated by 1: x 1 = 1 x = x
3. Commutation
a) Commutative with respect to +: x + y = y + x
b) Commutative with respect to : x y = y x
December-10-14
34
5. Complement
For every element x B, there exists an element x B (called the complement of
x) such that (a) x + x = 1 and (b) x x = 0
6. Two elements
There exists at least two elements x, y B such that x y
December-10-14
35
2. Identity elements
3. Commutation
4. Distribution
5. Complement
6. Two elements
December-10-14
x y B,
if x B and y B
x + y B,
if x B and y B
0+x=x,
if x B
1 x = x,
if x B
x + y = y + x,
if x B and y B
x y = y x,
if x B and y B
x (y + z) = (x y) + (x z),
if x, y, and z B
x + (y z) = (x + y) (x + z),
if x, y, and z B
x + x = 1,
if x B
x x = 0,
if x B
B = {0,1}
36
December-10-14
37
x+x=x
Theorem 1(b):
xx=x
Theorem 2(a):
x+1=1
Theorem 2(b):
x0=0
Theorem 3:
(x) = x
continued
December-10-14
38
x + (y + z) = (x + y) + z
Theorem 4(b):
x (y z) = (x y) z
Theorem 5(a):
(x + y) = x y
Theorem 5(b):
(x y) = x + y
Theorem 6(a):
x + xy = x
Theorem 6(b):
x(x + y) = x
December-10-14
39
Duality
To determine the dual of an algebraic expression, simply
interchange OR and AND operators and replace 1s by 0s and
0s by 1s
Duality is used to derive Theorem 2(b) and Theorem 6(b)
Duality is an extremely powerful concept, particularly when
proving complex theorems involving constants
Example:
f = xyz + xy
dual of f = (x + y + z)(x + y)
December-10-14
40
DeMorgans Theorem
Theorems 5(a) and 5(b) are commonly referred to as
DeMorgans Theorem
Proof of DeMorgans Theorem is too long to produce on a slide
December-10-14
(x + y)
x y
41
Buffer
Inverter
f
f=x
AND
x
y
December-10-14
f = x
f = (x y)
NAND
f
f=xy
x
y
42
OR
x
y
NOR
f
f=x+y
x
y
XOR
x
y
December-10-14
f = (x + y)
XNOR
f
f=xy
x
y
f = (x y)
43
Buffer
Inverter
AND
NAND
OR
NOR
XOR
XNOR
NOTE:
For the buffer and the inverter, only the input x is
relevant. Thus, the results have been duplicated.
December-10-14
44
Example:
f = xy + xz
y
x
f
z
December-10-14
45
NOTE:
Recall:
f = xy + xz
y
x
z
December-10-14
= f1 + f2
f1
f2
46
Example:
f = xy + xz
y
x
f
z
December-10-14
47
48
f1 = xyz + xy + yz
f2 = xy + xz
49
xy + xz + yz = xy + xz + yz(x + x)
= xy + xz + xyz + xyz
= xy(1 + z) + xz(1 + y)
= xy + xz
December-10-14
50
December-10-14
= (x + a)
Let a = y + z
= xa
= x(y + z)
Substituting for a
= x(yz)
= xyz
By Theorem 4(b)
51
x1x2x3xn
(x1x2x3xn)
x1 + x2 + x3 + + xn
December-10-14
52
Examples:
Given:
x+y=y+x
xy = yx
Given:
x(y + z) = xy + xz
x + yz = (x + y)(x + z)
December-10-14
By applying duality
By applying duality
53
Duality
Applying duality changes an expression
Changes to the LHS (Left-Hand Side) of the expression are
equivalent to the changes to the RHS (Right-Hand Side) of
the expression
Clearly, f Dual of f
Example:
x y
=y+x
Dual of f
= yx
December-10-14
Dual of f
0 0 0
0 1 1
1 0 1
1 1 1
54
o1
o2
December-10-14
o1 o2 o3
o3
55
i1
i2
i1
i2
December-10-14
o1
i1
i2
o2
i1
o3
i2
o4
i1
i2
o1 o2 o3 o4
56
i1
i2
December-10-14
i1
o1
i2
o2
i1
o3
i2
o4
i1
i2
o1 o2 o3 o4
57
Canonical Forms
A canonical form is a standard way of expressing a Boolean
function that produces a unique and predictable algebraic
structure
Two types of two-level canonical forms exist:
Sum of Products (Disjunctive Normal Form)
Product of Sums (Conjunction Normal Form)
58
Minterms
Sum of products form uses the
notion of a minterm
x y z Minterm Designation
0 0 0
xyz
m0
0 0 1
xyz
m1
0 1 0
xyz
m2
0 1 1
xyz
m3
1 0 0
xyz
m4
1 0 1
xyz
m5
1 1 0
xyz
m6
1 1 1
xyz
m7
December-10-14
59
x y
Minterm
0 0
m0
0 0
m1
0 1
m2
0 1
m3
= m0 + m3 + m4 + m6
1 0
m4
1 0
m5
1 1
m6
1 1
m7
= (1,2,5,7)
= m1 + m2 + m5 + m7
= xyz + xyz + xyz + xyz
f = (0,3,4,6)
December-10-14
60
Maxterms
Product of sums form uses the
notion of a maxterm
x y z
Maxterm
Designation
0 0 0
x+y+z
M0
0 0 1
x + y + z
M1
0 1 0
x + y + z
M2
0 1 1 x + y + z
M3
1 0 0
x + y + z
M4
1 0 1 x + y + z
M5
1 1 0 x + y + z
M6
1 1 1 x + y + z
M7
61
x y z
Maxterm
0 0 0
M0
0 0 1
M1
0 1 0
M2
0 1 1
M3
= M1 M2 M5 M7
1 0 0
M4
1 0 1
M5
1 1 0
M6
1 1 1
M7
= (0,3,4,6)
= M0 M3 M4 M6
= (x + y + z)(x + y + z)(x + y + z)(x + y + z)
f = (1,2,5,7)
December-10-14
62
= (1,3,6)
= (0,2,4,5,7)
Example 2: f(x,y,z)
= (0,2,4,6)
= (1,3,5,7)
December-10-14
63
Standard Forms
Canonical forms are awkward at times:
Each minterm (or maxterm) contains all inputs or input
complements
For large numbers of inputs, canonical forms can result in large
expressions
64
F0
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
0 0 0
0 1 0
1 0 0
1 1 0
December-10-14
65
Operator
Symbol
F0 = 0
Name
Comments
Null
Always 0
F1 = xy
xy
AND
x and y
F2 = xy
x/y
Inhibition
x but not y
Transfer
x (Error in textbook)
Inhibition
y but not x
Transfer
F3 = x
F4 = xy
y/x
F5 = y
F6 = xy + xy
xy
XOR
F7 = x + y
x+y
OR
x or y
December-10-14
66
Operator
Symbol
F8 = (x + y)
xy
F9 = xy + xy
(x y)
F10 = y
F11 = x + y
F12 = x
y
xy
x
Name
Comments
NOR
Not x or y
XNOR
x equals y
NOT
Not y
Implication
If y, then x
NOT
Not x
F13 = x + y
xy
Implication
If x, then y
F14 = (xy)
xy
NAND
Not x and y
Identity
Always 1
F15 = 1
December-10-14
67
December-10-14
68
December-10-14
69
Translation Example
x
y
x
y
f = xy + xy
x
y
f
x
y
f = xy + xy
NOTE:
To switch to NAND gates when using a two-level, sum of products form,
simply switch all of the AND and OR gates to NAND gates. This is a
special case!
December-10-14
70
Logic Levels
Digital logic gates operate on voltage signals, not logic values
How do you represent a Boolean value using voltage?
1. 0 V = 0,
5V=1
2. < 0.5 V = 0,
> 4.5 V = 1
3. < 0.5 V = 0,
> 2.5 V = 1
4. 5 V = 0,
0V=1
5. > 4.5 V = 0,
< 0.5 V = 1
6. > 2.5 V = 0
December-10-14
< 0.5 V = 1
Positive Logic
Negative Logic
NOTE:
The actual voltage thresholds
depend upon the technology
used.
71
Positive Logic
Negative Logic
Logic
Value
Signal
Value
Logic
Value
Signal
Value
December-10-14
72
Polarity Indicators
Truth tables for digital gates
often use L and H rather than 0
and 1
Polarity Indicator
December-10-14
73
Acronyms
SSI: Small-Scale Integration
10 or fewer gates in a single package
74
Part I
A0
A1
A2
December-10-14
ROM
D0
y
z
LUT
76
Memory Units
December-10-14
77
December-10-14
78
December-10-14
79
December-10-14
80
December-10-14
81
December-10-14
82
December-10-14
83
ASICs are best suited for the development of low cost, mass
market digital logic designs and mixed signal (analog and
digital) designs
Designs that can recover the non-recurring engineering costs
High production volume designs
To view the Xilinx website for the Spartan IIE series of FPGAs,
click here
December-10-14
84
Karnaugh Maps
Simplification of Boolean expressions using algebraic
manipulation can be time consuming
Hardware designers often simplify Boolean expressions using
a graphical technique based on the use of a Karnaugh map
(K-map)
A Karnaugh map is an alternative way for representing the
truth table of a digital logic circuit
December-10-14
y
x
m0 m1
xy xy
m2 m3
xy
xy
86
OR Gate
Truth Table
x
December-10-14
Karnaugh Map
y
Standard Form: f = x + y
Canonical Form: f = xy + xy + xy
87
December-10-14
88
Gate-Level Minimization
Using Karnaugh Maps
yz
wx
00 01 11 10
00
01
11
10
yz
wx
00 01 11 10
00
01
11
10
December-10-14
NOTE:
These 4 bits could not be
grouped together as one term
NOTE:
These 4 bits can be
grouped together as one term
f = xz
89
December-10-14
90
December-10-14
91
December-10-14
92
December-10-14
93
December-10-14
Number of
Adjacent
Squares
Number of Literals in a
Term in an n-variable
Map
2k
16
32
94
December-10-14
95
NOTE:
01
11
10
yz
wx
00 01 11 10
00
01
11
10
December-10-14
NOTE:
f = xz
96
01
11
10
f = y + wx + xz + wz
f = (y)(w + x)(x + z)(w + z)
NOTE:
yz
wx
00 01 11 10
00
01
11
10
December-10-14
f = x + z
f = xz
97
Proof:
(y)(w + x)(x + z)(w + z)
= (wy + xy)(wx + wz + xz + z)
= wxy + wxy + wyz + wxyz + wxyz + xyz + wyz + xyz
= wxy + wyz + wxyz + xyz
= wyz + wxy + xyz
December-10-14
98
December-10-14
99
December-10-14
100
December-10-14
101
December-10-14
102
x y
0 0 X
0 1 X
1 0 0
1 1 1
OR
0 X X
1 0 0
1 1 1
NOTE:
Dont care conditions are sometimes
indicated by the use of a -.
December-10-14
103
0 1
0 X X
1 0 1
Transfer
f = (x y)
XNOR
f = xy
AND
December-10-14
104
December-10-14
105
December-10-14
106
December-10-14
107
f = z + wy
Complement of f
December-10-14
Sum of Products
108
109
NOT Gate
f = x
x
y
x
f
y
December-10-14
AND Gate
f = ((xy)) = xy
OR Gate
f = (xy) = x + y
110
NOT Gate
f = x
x
y
OR Gate
f = ((x + y)) = x + y
x
f
AND Gate
f = (x + y) = xy
December-10-14
111
x y z = (x y) z = x (y z)
December-10-14
112
December-10-14
113
NOTE:
The course material on XOR and XNOR gates has been
adapted from the course notes for ECE 223 provided by
Dr. Andrew Kennings
December-10-14
114
xy
December-10-14
115
xy
December-10-14
116
December-10-14
117
December-10-14
00
01
11
10
00
01
11
10
x1x2
x3x4
00
01
11
10
00
01
11
10
118
00
01
11
10
00
NOTE:
01
11
10
December-10-14
119
00
01
11
10
00
01
11
10
XNOR
December-10-14
XOR
120
121
122
December-10-14
123
f1
f2
December-10-14
124
f1
f2
December-10-14
125
Combinational Circuits
Combinational circuits consist of inputs, logic gates, and
outputs
Combinational circuits may be described by a truth table or m
Boolean functions
December-10-14
127
December-10-14
128
T4
T5
Step 4 is performed
to find the Boolean
functions in terms of
inputs.
T6
December-10-14
129
December-10-14
130
T6 = BC
F2 = (F2)
December-10-14
131
= T2 + T3
= ABC + T1F2
= ABC + (A + B + C)(F2)
= ABC + (A + B + C)(T4 + T5 + T6)
December-10-14
132
=T4 + T5 + T6
= AB + AC + BC
Question:
December-10-14
133
F1 F2
December-10-14
134
December-10-14
135
Design Procedure
To design a combinational circuit from a specification of a
problem, perform the following steps:
1. From the specifications of the circuit, determine the required
number of inputs and outputs and assign a symbol to each.
4. Draw the logic diagram and verify the correctness of the design.
December-10-14
136
Textbook Example
Design a combinational circuit to convert from BCD code to
Excess-3 code
Step 1: Determine the inputs and outputs of the circuit
Four inputs labelled A, B, C, and D
Four outputs labelled w, x, y, and z
The label names were chosen arbitrarily in this case
December-10-14
137
December-10-14
138
December-10-14
139
December-10-14
140
Half Adder
(HA)
S
A B C S
0
0 0 0
1 0 1
0 0 1
1 1 0
NOTE:
From the truth table, it can be
seen that S = A B and C = AB
December-10-14
141
A
B
A
B
A
B
A
B
Implementation 1
Implementation 2
S = AB + AB
C = AB
S=AB
C = AB
December-10-14
142
Ci+1
Bi
Full Adder
(FA)
Si
December-10-14
Ci
Ai
Bi
Ci
Ci+1
Si
143
NOTE:
December-10-14
Ai
Bi
Ci
=A
=B
=C
Si
Ci+1
= F1
= F2
144
Half Adder
(HA)
Ci+1
Half Adder
(HA)
Si
December-10-14
Ai
Bi
Ci
Ai
Bi
Ci
Ci+1
Si
145
Full Adder
(FA)
A2 B2
C3
Full Adder
(FA)
S3
C2
S2
A0 B0
C1
Full Adder
(FA)
Full Adder
(FA)
S1
C0
S0
Bit
4
Bit
3
Bit
2
Bit
1
Bit
0
Ci
Augend
Ai
Addend
Bi
Sum
Si
Input Carry
December-10-14
A1 B1
146
Complement
December-10-14
147
B2
A3
C
C4
B1
A2
Full Adder
(FA)
S3
C3
Full Adder
(FA)
S2
B0
A1
C2
Full Adder
(FA)
A0
C1
S1
Full Adder
(FA)
C0
S0
December-10-14
148
December-10-14
149
Carry Chains
Ripple carry adders and subtractors are inefficient for large
quantities
Ripple carry adders and subtractors use a carry chain
Carry resulting from the addition of the least significant bits must
be calculated before the addition of more significant bits can be
performed
150
Pi
Half Adder
(HA)
Half Adder
(HA)
Si
December-10-14
Ai
Bi
Ci
151
Ci+1 = Gi + PiCi
It is possible to write a Boolean function for each carry
output:
C0 = Input Carry
C1 = G0 + P0C0
C2 = G1 + P1(G0 + P0C0) = G1 + P1G0 + P1P0C0
152
NOTE:
More logic gates are
required to generate
the carry signals but
only two gate delays
are required per carry
signal.
December-10-14
153
December-10-14
154
BCD Addition
BCD uses 4-bits to encode each decimal digit
10 bit patterns are valid:
(0000)2, (0001)2, (0010)2, (0011)2, (0100)2,
December-10-14
155
BCD Addition
There are 2 cases to consider:
1. A carry is produced by the binary addition of BCD digits
2. The result of the binary addition of BCD digits is an invalid bit
pattern
Assume that two BCD digits are added using binary addition
resulting in a Carry Out labeled C and a 4-bit value labeled
Z8Z4Z2Z1
December-10-14
156
NOTE:
If Z8 and Z4 are both
1 or if Z8 and Z2 are
both 1 or if a Carry
Out is generated, the
summation value is
greater than 10. In
any of these cases, a
second addition is
performed to add 6 to
the result to produce
the correct BCD digit.
December-10-14
157
December-10-14
158
Binary Multiplication
Multiplication can be accomplished by computing the partial
products as follows:
B1
B0
A1
A0
--------A0B1 A0B0
A1B1 A1B0
------------------C3
C2
C1
C0
December-10-14
159
December-10-14
160
December-10-14
161
December-10-14
162
December-10-14
163
Magnitude Comparator
Magnitude comparator is an essential component of a
processor
Comparators enable branching in a computer program
3. A = B
December-10-14
164
NOTE:
x3 indicates that
B3 are equal.
x2 indicates that
B2 are equal.
x1 indicates that
B1 are equal.
x0 indicates that
B0 are equal.
December-10-14
A3 and
A2 and
A1 and
A0 and
165
Decoders
Decoders convert a binary quantity into a high (or low) signal
on a particular output
For example, a 2-to-4-line decoder takes a 2-bit binary
encoded input and drives one of four output lines to a defined
value
Decoders are often used to enable devices on a bus that are
memory-mapped
December-10-14
166
Decoder Example
If a video card memory maps to address 0xA000 in a
computer, a 4-to-16-line decoder can be used to distinguish
address 0xA000 from address 0xB000:
Use the 4 most significant bits as the inputs to the decoder
The 16 output lines will correspond with each of the 16 possible
address ranges
0x0000 to 0x0FFF
0x1000 to 0x1FFF
0xF000 to 0xFFFF
December-10-14
167
NOTE:
The outputs are active-high.
December-10-14
168
NOTE:
The outputs are active-low.
December-10-14
169
December-10-14
170
December-10-14
171
December-10-14
172
Encoders
Encoders perform the inverse operation of a decoder
Encoders look for a signal driven on one of a set of input lines
and drive a binary output based on the position of the signal
December-10-14
173
December-10-14
D3
D2
D1
D0
174
NOTE:
These K-Maps differ
slightly from the ones
in the textbook.
175
December-10-14
176
Multiplexers
A multiplexer selects one set of input signals from many sets
of input signals and outputs the chosen set
For example, a 2-to-1-line multiplexer chooses from 2 input
signals and outputs the value that appears on one of them on
the output signal
Multiplexers allow the sharing of a signal wire over time (also
known as time multiplexing)
December-10-14
177
2-to-1-Line Multiplexer
I0
Y
I1
s
December-10-14
178
4-to-1-Line Multiplexer
I0
I1
I2
I3
s0
s1
December-10-14
179
A
B
4
4
4
S
E
December-10-14
180
Demultiplexers
Demultiplexers (sort of) reverse the process of multiplexing
A decoder with an enable input is a demultiplexer
December-10-14
181
Sequential Circuits
Sequential circuits introduce state to a digital logic system
State is saved using memory elements
Outputs of a sequential circuit are a function of both inputs
and state
December-10-14
183
December-10-14
184
Clock Signals
Synchronous sequential circuits utilize clock signals to
determine when to evaluate input signals and state
Clock signals can be:
1. Periodic (i.e., fixed frequency)
or
December-10-14
185
December-10-14
186
Latches
Latches are the simplest form of storage element
Latch is a primitive form of a flip-flop that is sensitive to
changes in the level of input signals
December-10-14
187
SR Latch
SR latch is a set-reset latch
S signal sets the latch to a 1 (assuming that R signal is 0)
R signal sets the latch to a 0 (assuming that S signal is 0)
If both S and R signals are asserted, the latch enters an
unusual state
Both Q and Q signals are set to 0
December-10-14
188
SR Latch
A logic diagram and the truth table for the SR latch are
provided below:
December-10-14
189
SR Latch
Alternatively, the SR latch may be implemented with NAND
gates as follows:
NOTE: This is really a SR latch
NOTE:
Active-low signals
have been used
December-10-14
190
December-10-14
191
Indeterminate State
The next state of Q is indeterminate when all inputs to the SR
latch with control input are 1
Previously, it could be said that an SR latch would produce 1s at
the output of the SR latch implemented with NAND gates
When the control input is added, it is not clear what the stable
state will be once the control signal C is deasserted
Slight timing differences in the gate delays and propagation
delays might bias the indeterminate state
December-10-14
192
D Latch
Rather than set or reset a latch, it is more desirable to have
one input, D, that sets the latch to a defined value
D latches can be built using SR latches with control inputs
December-10-14
193
D Latch
The D latch can be built as follows:
December-10-14
194
December-10-14
195
196
December-10-14
197
December-10-14
198
Comments on Level-Triggering
Level-triggering works well in some applications:
1. If the inputs rarely change during a clock cycle, outputs will
rarely change
2. If the outputs feed flip-flop inputs, changes in the outputs are
irrelevant
December-10-14
199
Edge-Triggering
How do you produce an edge-triggered device?
ANSWER:
Edge-triggered devices use two latches in series to block
undesirable changes in output signals
This configuration is known as a Master-Slave configuration
NOTE:
The master-slave terminology is now the subject of a
controversy. For more details, check out the following
online article:
http://www.theregister.co.uk/content/28/34216.html
December-10-14
200
Master-Slave D Flip-Flop
Master-slave flip-flops are built using two D latches as
follows:
December-10-14
201
At all other times, changes to the input D are filtered out by the
circuit
202
Positive-Edge-Triggered D Flip-Flop
How can a positive-edge-triggered flip-flop be built?
ANSWER:
Inverting the CLK signal prior to use by either latch results in a
positive-edge-triggered flip-flop
Two inverters are used by the modified circuit simply moving
the original inverter will not work
December-10-14
203
Alternative Implementation
Alternatively, a positive-edge-triggered D flip-flop can be built
(more efficiently) using three SR latches as follows:
December-10-14
204
NOTE:
December-10-14
205
December-10-14
206
JK Flip-Flop
JK flip-flops are analogous to SR latches
J signal sets the flip-flop
K signal resets the flip-flop
If both J and K are 0, then the flip-flip holds its state
If both J and K are 1, then the flip-flop toggles its state
December-10-14
207
NOTE:
The outputs of the
flip-flop are used to
enable the J and K
inputs to the OR
gate.
December-10-14
208
T Flip-Flop
T stands for toggle
T flip-flops are built by tying both the J and K inputs of a JK
flip-flop to the same input signal T
December-10-14
209
December-10-14
210
December-10-14
211
Q(t + 1)
Description of Operation
Reset
Set
NOTE:
Q(t + 1) denotes the future value of Q at time t + 1
December-10-14
212
Inputs
Outputs
Q
Trigger 1
December-10-14
Trigger 2
Trigger 3
213
December-10-14
214
D Flip-Flop Implementation
December-10-14
215
December-10-14
Q(t + 1)
Description of Operation
Q(t)
No Change
Reset
Set
Q(t)
Complement
216
Inputs
Outputs
Trigger 1
December-10-14
Trigger 2
Trigger 3
217
JK Flip-Flop Implementation
December-10-14
218
December-10-14
Q(t + 1)
Description of Operation
Q(t)
No Change
Q(t)
Complement
219
Inputs
Outputs
Q
Trigger 1
December-10-14
Trigger 2
Trigger 3
220
T Flip-Flop Implementations
December-10-14
221