Transcript L(digital)

Introduction to Electrical & Computer Engineering
Digital Circuits –
Very Brief Introduction
Dr. Cynthia Furse
University of Utah
1
Digital Circuits – Brief Intro
•
•
•
•
Analog & Digital
Binary (Digital) Numbers & Binary Math
Computers & Binary
Digital Logic Gates
NOT OR XOR AND NAND
• Hooking up Digital Circuits
2
Digital vs. Analog
• Digital is fixed (can take one or a few values,
something you can count)
• Analog varies (can take any value, something
you can measure)
3
Analog vs. Digital – Fuel Gauge
• Analog Gauge tells you ‘how much’ fuel you have
• Digital Light tells you you have
enough (off) or you don’t (on)
4
Analog vs. Digital – Clocks
• Analog Clock tells you ‘what time it is’ (continuous)
• Digital clock tells you what
hour and minute it is
(countable)
5
Dr. Thomas Stockham
University of Utah
• Analog opera recordings
have distortion
• Digital Recording lets
you remove distortion
6
Analog vs. Digital – Voltmeters
• Analog Voltmeter tells you ‘what voltage it is’
(continuous)
• Digital voltmeter tells you
voltage to xx.xx digits
(countable)
• OR just ‘on’ and ‘off’
7
Analog vs. Digital – Voltages
• Analog Voltage can be ‘any value’ (Dimmer Switch)
• Digital voltage is a limited set of
voltages On =1 OR Off = 0
8
Analog vs. Digital – Voltages
• Analog Voltage can be ‘any value’
• Digital voltage is a limited set of
voltages (Stairstepped)
9
Digital
Digital – Represent with Binary #s
10
Analog to Digital Conversion (ADC)
Digital to Analog Conversion (DAC)
• Analog Voltage can be ‘any value’
• Digital voltage is a limited set of
voltages – Quantization Error
11
Counting with Binary #s
•
•
•
•
•
•
•
•
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
12
Bits & Bytes
• 0000 0000 << 8 BITS = 1 Byte
13
Computer Numbers
Computers represent numbers
as a set of bits (8,16,32 bit)
& an exponent
2000 = 2 x 10^3
00000010 = 2 00000011 = 3
14
Computers Represent Letters with
ASCII codes
•
•
•
•
•
A = 0100 0001 = ‘41’
B = 0100 0010 = ‘42’
C = 0100 0011 = ‘43’
D = 0100 0100 = ‘44’
Etc.
a = 0110 0001 = ‘61’
b = 0110 0010 = ‘62’
c = 0110 0011 = ‘63’
d = 0110 0100 = ‘64’
15
Write your name in ASCII
A
B
C
D
E
F
G
H
00000001
00000010
00000011
00000100
00000101
00000110
00000111
00001000
I
J
K
L
M
N
O
P
Q
00001001
00001010
00001011
00001100
00001101
00001110
00001111
00010000
00010001
R
S
T
U
V
W
X
Y
Z
00010010
00010011
00010100
00010101
00010110
00010111
00011001
00011010
00011010
16
How Computers Represent Pictures
Pixel (eg. DPI = Dots per inch)
•
Digital (pixels)
Analog (? Or just more
pixels)
17
How Computers Represent Pictures
Color: Red + Green + Blue (RGB)
• Wikipedia
18
Computer Logic:
• 5V = ‘1’ = ‘on’ = ‘yes’ = ‘true’
• 0V = ‘0’ = ‘Off’ = ‘no’ = ‘false’
19
Example: Battery Voltage Sensing
• A battery is considered low when its voltage is
under 1.3V
• Battery 1
Battery 2
20
Example: Is the Battery Charged?
• ECE-speak: Is the battery voltage above 1.3V?
– Convert voltage to digital (0 or 5)
=5V
Battery voltage
Vb
= A(Vb-1.3V)
1.3V
0V
=5V = ‘1’
0V = ‘0’
21
Example:
Are BOTH Batteries Charged?
• Are Vo1 AND Vo2 both ‘1’?
AND
Vo1=IN A
0
0
1
1
Vo1=IN B
0
1
0
1
OUT
0
0
0
1
Example: Is at least one of the
Batteries Charged?
• Is either Vo1 OR Vo2 ‘1’?
OR
Vo1=IN A
0
0
1
1
Vo2=IN B
0
1
0
1
OUT
0
1
1
1
Example: Does at least one of the
batteries need to be charged?
• Is at least one of Vo1 AND Vo2 ‘0’?
NAND
IN A
0
0
1
1
IN B
0
1
0
1
OUT
1
1
1
0
Others
NOT
IN
0
1
OUT
1
0
Excusive-OR (XOR)
Building with Logic Gates
AND
GND
Remember the Power
Supply Voltages! 5V
Digital Circuits – Brief Intro
•
•
•
•
Analog & Digital
Binary (Digital) Numbers & Binary Math
Computers & Digital
Digital Logic Gates
NOT OR XOR AND NAND
• Hooking up Digital Circuits
27
Tombstone Rock
near Moab, Utah
28