Professional Documents
Culture Documents
Chapter 1: Introduction
Slides to accompany the textbook Digital Design, with RTL Design, VHDL, and
Verilog, 2nd Edition,
by Frank Vahid, John Wiley and Sons Publishers, 2010.
http://www.ddvahid.com
2010
1
Instructors may make printouts of the slides available to students for a reasonable photocopying charge, without incurring royalties. Any other use requires explicit permission. Instructors
Frank Vahid
may obtain PowerPoint
source or obtain special use permissions from Wiley see http://www.ddvahid.com for information.
www.cse.nd.edu/courses/cse20221/www/
TAs during lab time: M,T,W,T,F 3:00 5:20
email yoders1@nd.edu
325 D Cushing Hall
108 Stinson-Remick on Tues. & Thurs. during lab
If there is a video for the lab, view it before you come to lab
Download the Xilinx software for lab on your personal computer
Review the lab assignment before you come to lab
Complete the design work before you come to lab
Questions?
1.1
1995
DVD
players
Cell phones
1997
1999
Video
recorders
Cameras
2001
2003
Musical
instruments
TVs
2005
2007
???
1.2
Digital signal
Sound waves
move the
membrane,
which moves
the magnet,
microphone
digital
signal
analog
signal
Possible values:
1.00, 1.01, 2.0000009,
... infinite possibilities
a
time
Digital Design 2e
Copyright 2010
Frank Vahid
value
value
which creates
current in the nearby wire
4
3
2
1
0
Possible values:
0, 1, 2, 3, or 4.
Thats it.
time
5
value
1
0
time
Digital Design 2e
Copyright 2010
Frank Vahid
Sample voltage at
particular rate, save
sample using bit encoding
Voltage levels still not kept
perfectly
But we can distinguish 0s
from 1s
lengthy transmission
(e.g, cell phone)
time
received signal
1
0
time
How fix -- higher, lower, ?
01 10 11 10 11
a2d
1
digitized signal
0
time
1
0
time
Can fixdistinguish 0s/1s, restore
Higher sampling
rate and more bits per
encoding improves re-creation
Volts
original signal
lengthy transmission
(e.g, cell phone)
2
1
0
Volts
Volts
Example of Digitization
Benefit
d2a
3
2
1
0
Volts
3
1
samples
wire
microphone
00 01 10 10 11 11 11 01 10 10 00 time
analog-todigital
converter
digitized signal
0001101011111101101000
(a)
wire
Volts
digital-toanalog
converter
analog signal
reproduced from
digitized signal
2
1
0
00 01 10 10 11 11 11 01 10 10 00 time
(b)
speaker
Digital Design 2e
Copyright 2010
Frank Vahid
00 00 10000001111 01
digital
data
D2A
electric
signal
actuators and
other outputs
Digital Design 2e
Copyright 2010
Frank Vahid
button
red
blue
green
black
0 0 0
red
blue
green
black
0 0 1
red
blue
green
black
0 1 0
air
33
degrees
temperature
sensor
0 0 1 0 0 0 0 1
10
Encoding Symbol
Encoding Symbol
100 1110
N
100 1111
O
101 0000
P
101 0001
Q
101 0010
R
101 0011
S
101 0100
T
101 0101
U
101 0110
V
101 0111
W
101 1000
X
101 1001
Y
101 1010
Z
Encoding Symbol
110 0001
110 0010
...
111 1001
111 1010
a
b
011 0000
011 0001
011 0010
011 0011
011 0100
011 0101
011 0110
011 0111
011 1000
011 1001
0
1
2
3
4
5
6
7
8
9
y
z
Question:
What does this ASCII bit sequence represent?
1010010 1000101 1010011 1010100
a
REST
11
24
23
22
21
20
Q: How much?
+
=
a
4+ 1= 5
12
temperature sensor
0
"33"
Digital System
if (input <= "00100000") // "32"
output = "1000110" // "F"
else if (input >= "11010100") // "212"
display
"N"
13
28
27
26
25
24
23
22
21
20
16 8
Digital Design 2e
Copyright 2010
Frank Vahid
Desired decimal
number: 12
Binary
number
Current
sum
(a)
(b)
0
16 8
0 1
16 8
(c)
12
0 1
16 8
1
4 2
(d)
done
0 1
16 8
1 0
4 2
0
1
15
Digital Design 2e
Copyright 2010
Frank Vahid
Desired decimal
number: 23
Binary
number
1 0
sum: 0 16 8 4 2 1
16
(a) 16
(b) 20
(c) 22
(d) 23
(e)
16
Desired value: 73
a
0 1 0 0 1 0 0 1
Q:
(a)
128 64 32 16 8
sum:
64
72
(b)
73
DIP switch
channel receiver
"34" 0 0 1 0 0 0 1 0
1
0
"73" 0 1 0 0 1 0 0 1
InA
if (InA = InB)
Out = 1
else
Ceiling fan Out = 0
module
Out
InB
(c)
0
Digital Design 2e
Copyright 2010
Frank Vahid
17
163
162
161
160
binary
hex
binary
0
1
2
3
4
5
6
7
0000
0001
0010
0011
0100
0101
0110
0111
8
9
A
B
C
D
E
F
1000
1001
1010
1011
1100
1101
1110
1111
18
Decimal to Hex
Easy method: convert to binary first, then binary to hex
Convert 99 base 10 to hex
First convert to binary:
0 1 1 0 0 0 1 1
128 64 32 16 8
1
a
Digital Design 2e
Copyright 2010
Frank Vahid
19
(b)
Province #
(a)
RFID
tag
Digital Design 2e
Copyright 2010
Frank Vahid
City #
(f)
Animal #
Animal: 513
00000010 00000001
02 01
20
26 10
16
Binary
1
0
1
To binary
To decimal
1
16
16
16+8
= 24
24
24+2
= 26
--
Digital Design 2e
Copyright 2010
Frank Vahid
To hex To octal
16 + 8 + 2
= 26 10
1 1010
= 1A16
11 010
= 32 8
21
Decimal
6
2 12
12
0
0
1
(current value: 0)
2. Divide quotient by 2
Insert remainder into the binary number
Continue since quotient (3) is greater than 0
3
2 6
6
0
0 0
2 1
(current value: 0)
3. Divide quotient by 2
Insert remainder into the binary number
Continue since quotient (1) is greater than 0
1
2 3
2
1
1 0 0
4 2 1
(current value: 4)
4. Divide quotient by 2
Insert remainder into the binary number
Quotient is 0, done
0
2 1
0
1
1 1 0 0
8 4 2 1
(current value: 12)
Digital Design 2e
Copyright 2010
Frank Vahid
Binary
Note:
Works for
any base
Njust
divide by
N instead
22
Dibble-Dabble Algorithm
2|12
2|6
2|3
2|1
12 10 = 11002
23
Digital Design 2e
Copyright 2010
Frank Vahid
24
1.3
microprocessor
digital circuit
Microprocessors a
common choice to
implement a digital
system
I0
I1
I2
I3
I4
I5
I6
I7
Digital Design 2e
Copyright 2010
Frank Vahid
P0
P1
P2
P3
P4
P5
P6
P7
Easy to program
Cheap (as low as
$1)
Readily available
void main()
1
a
{
0
while (1) {
1
b
P0 = I0 && !I1;
0
// F = a and !b,
1
F
}
0
}
6:00
7:057:06
9:009:01
time
25
Digital Design 2e
Copyright 2010
Frank Vahid
26
Image Sensor
(a)
Memory
Image Sensor
Microprocessor
Custom
Digital Circuit
Read
0.1
Compress
0.5
Digital Design 2e
Copyright 2010
Frank Vahid
0.8
(Read,
Compress,
and Store)
Read
circuit
5+8+1
=14 sec
Compress
circuit
(b)
Image Sensor
Memory
.1+.5+.8
=1.4 sec
Store
circuit
Memory
(c)
Store
Microprocessor
Read
circuit
Compress
circuit
Microprocessor
(Store)
.1+.5+1
=1.6 sec
Good
compromise
27
Chapter 1 Summary
Digital systems surround us
Inside computers
Inside many other electronic devices (embedded systems)
28
2.1
Chapter 2 Introduction
Lets learn to design digital circuits, starting with a
simple form of circuit:
Combinational circuit
Outputs depend solely on the present combination of the circuit
inputs values
Vs. sequential circuit: Has memory that impacts outputs too
Motion
sensor
a
Digital
System F
Lamp
Light
sensor
(a)
Digital Design 2e
Copyright 2010
Frank Vahid
(b)
b
b=0 Digital F=1
System
29
Note: Slides with animation are denoted with a small red "a" near the animated items
2.2
Switches
Electronic switches are the basis of
binary digital circuits
9V
4.5 A
4.5 A
Electrical terminology
+
2 ohms
9V
0V
V = I * R (Ohms Law)
9 V = I * 2 ohms
I = 4.5 A
Digital Design 2e
Copyright 2010
Frank Vahid
4.5 A
a
Switches
control
input
off
source
input
Control input
Voltage that controls whether that
current can flow
1930s: Relays
1940s: Vacuum tubes
1950s: Discrete transistor
1960s: Integrated circuits (ICs)
control
input
on
output
(b)
Digital Design 2e
Copyright 2010
Frank Vahid
source
input
output
discrete
transistor
vacuum tube
IC
quarter
(to see the relative size)
31
Moores Law
IC capacity doubling about every 18 months
for several decades
Known as Moores Law after Gordon Moore,
co-founder of Intel
Predicted in 1965 predicted that components
per IC would double roughly every year or so
Digital Design 2e
Copyright 2010
Frank Vahid
32
2.3
nMOS
gate
gate
oxide
source
IC package
drain
conducts
does not
conduct
pMOS
(a)
IC
gate
does not
conduct
conducts
33
source
gate
drain
Digital Design 2e
Copyright 2010
Frank Vahid
source
gate
drain
34
2.4
Logic gates are better digital circuit building blocks than switches (transistors)
Why?...
Digital Design 2e
Copyright 2010
Frank Vahid
35
Boolean Algebra
Variables represent 0 or 1 only
Operators return 0 or 1 only
Basic operators
AND: a AND b returns 1 only when both a=1 and b=1
OR: a OR b returns 1 if either (or both) a=1 or b=1
NOT: NOT a returns the opposite of a (1 if a=0, 0 if a=1)
Digital Design 2e
Copyright 2010
Frank Vahid
a
0
0
1
1
b
0
1
0
1
AND
0
0
0
1
a
0
1
NOT
1
0
a
0
0
1
1
b
0
1
0
1
36
OR
0
1
1
1
Nice features
a
0
0
1
1
b
0
1
0
1
AND
0
0
0
1
a
0
0
1
1
b
0
1
0
1
OR
0
1
1
1
Formally evaluate
m=1, j=0, s=1 --> F = (1 OR 0) AND NOT(1) = 1 AND 0 = 0
Formally transform
F = (m and NOT(s)) OR (j and NOT(s))
Looks different, but same function
Well show transformation techniques soon
Formally prove
a
0
1
NOT
1
0
Digital Design 2e
Copyright 2010
Frank Vahid
37
a
0
0
1
1
b
0
1
0
1
AND
0
0
0
1
a
0
0
1
1
b
0
1
0
1
OR
0
1
1
1
a
0
1
Digital Design 2e
Copyright 2010
Frank Vahid
NOT
1
0
38
Q2. either of a or b is 1.
Answer: F = a OR b
Q3. a is 1 and b is 0.
Answer: F = a AND NOT(b)
Q4. a is not 0.
Answer:
(a) Option 1: F = NOT(NOT(a))
(b) Option 2: F = a
Digital Design 2e
Copyright 2010
Frank Vahid
39
Homework
Chapter 1: 2,10,16,18, 21
Due date: Thursday, January 27
40