Professional Documents
Culture Documents
SYSTEMS
AND
CODES
Juan Carlos Martinez Santos
Reminders
• Analog
=
conRnuous
• Digital
=
discrete
• Example:
• An
analog
clock,
whose
hands
move
smoothly
and
conRnuously.
• A
digital
clock,
whose
digits
jump
from
one
value
to
the
next.
Analog Quantities
Most natural quantities (such as temperature, pressure, light
intensity, …) are analog quantities that vary continuously.
Temperature
(°F)
100
95
90
85
80
75
70
Time of day
1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12
A .M . P.M .
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
The
Digital
Revolu3on
Analog Digital
Record albums CDs
VHS tapes DVDs
Analog television Digital TV
• In
all
of
these
digital
devices,
info
is
stored
and
transmiFed
as
long
strings
of
1s
and
0s.
Analog and Digital Systems
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Voltage
• Voltage
is
a
basic
electrical
quanRty
that
is
important
in
all
circuits
(analog
or
digital).
• You
can
think
of
a
circuit
as
being
like
a
plumbing
system,
with
water
flowing
through
pipes.
• On
this
analogy,
voltage
is
like
the
water
pressure
in
the
pipes.
Its
value
will
vary
at
different
points
in
the
circuit.
A
Simple
Circuit
A wire is like a water pipe. The amount of
electricity flowing through a wire is called
current, which is measured in amperes.
The voltage
(pressure)
at this point
is greater than
the voltage
at this point.
A voltage source is like
a water pump. Its
voltage rating (in volts)
tells you how strong it is.
Resistors are like partial blockages
in the pipe. They restrict the amount
of current that flows through the circuit.
Examples
of
Voltage
Sources
Fixed +5 V supply:
In this course we’ll
always use this one.
Variable supplies,
controlled by the
knobs at left. You’ll
use these in
other courses.
Measuring
Exact
Voltage
Invalid
VL(max)
LOW
VL(min)
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Ones
and
Zeros
• This
week
we’ll
look
mainly
at
how
to
represent
numbers
using
1s
and
0s,
and
also
(briefly)
how
to
represent
text
using
1s
and
0s.
Binary
Number
System
• When
we
represent
numbers
using
1s
and
0s,
we’re
using
the
binary
number
system.
This
system
is
fundamental
to
everything
in
digital
electronics,
so
you
must
learn
it
thoroughly.
• First,
we’ll
briefly
review
the
decimal
number
system
that
you’ve
used
for
most
of
your
life.
Decimal Numbers
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal Numbers
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Binary Numbers
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal Binary
Number Number
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Binary-to-Decimal Conversions
32 16 8 4 2 1
1 0 0 1 0 1
32 +4 +1 = 37
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal-to-Binary Conversions (First Method)
64 32 16 8 4 2 1.
0 1 1 0 0 0 1.
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal-to-Binary Conversions (Second Method)
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
The
Hexadecimal
and
Octal
Systems
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal Hexadecimal Binary
Hexadecimal Numbers 0 0 0000
1 1 0001
Hexadecimal is a weighted number 2 2 0010
system. The column weights are 3 3 0011
powers of 16, which increase from 4 4 0100
5 5 0101
right to left. 6 6 0110
Column weights {4096
3 2
16 16 16 16 .
256 16 1
1 0 7
8
7
8
0111
1000
9 9 1001
Express 1A2F16 in decimal. 10 A 1010
11 B 1011
Start by writing the column weights:
12 C 1100
4096 256 16 1
13 D 1101
1 A 2 F16
14 E 1110
1(4096) + 10(256) +2(16) +15(1) = 670310 15 F 1111
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
Decimal Binary BCD
BCD 0 0000 0000
1 0001 0001
Binary coded decimal (BCD) is a 2 0010 0010
weighted code that is commonly 3 0011 0011
used in digital systems when it is 4 0100 0100
5 0101 0101
necessary to show decimal 6 0110 0110
numbers such as in clock displays. 7 0111 0111
The table illustrates the 8 1000 1000
difference between straight binary and 9 1001 1001
BCD. BCD represents each decimal 10 1010 0001 0000
digit with a 4-bit code. Notice that the 11 1011 0001 0001
codes 1010 through 1111 are not used in 12 1100 0001 0010
BCD. 13 1101 0001 0011
14 1110 0001 0100
15 1111 0001 0101
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
BCD
© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved
The
ASCII
Code