02 binary numbers
Post on 06-Jul-2018
227 Views
Preview:
TRANSCRIPT
-
8/16/2019 02 Binary Numbers
1/79
Instructor: Alexander Stoytchev
http://www.ece.iastate.edu/~alexs/classes/
CprE 281:i!ital "o!ic
-
8/16/2019 02 Binary Numbers
2/79
#inary $u%&ers
CprE 281: Digital Logic
Iowa State University, Ames, IACopyright Ale!an"er Stoytchev
-
8/16/2019 02 Binary Numbers
3/79
Ad%inistrative Stu''
(his is the o''icial class we& pa!e:
http://www.ece.iastate.edu/~alexs/classes/2)1*+Sprin!+281/
I' you %issed the 'irst lecture, the sylla&us and other class
%aterials are posted there.
http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/http://www.ece.iastate.edu/~alexs/classes/2014_Spring_281/
-
8/16/2019 02 Binary Numbers
4/79
Ad%inistrative Stu''
• -1 is out
• It is due on ednesday e& 22 0 *p%.
• Su&%it it on paper &e'ore the start o' the lecture
-
8/16/2019 02 Binary Numbers
5/79
Ad%inistrative Stu''
(he la&s and recitations start next wee:
•Section : (uesdays, 12:1) 3:))p% 4Coover -all, roo% 2)5)6
•Section 7: (uesdays, 3:1) :))p% 4Coover -all, roo% 2)5)6
•Section 9: ednesdays, 12:1) 3:))p% 4Coover -all, roo% 2)5)6
•Section : ednesdays, :1) ;:))p% 4Coover -all, roo% 2)5)6
•(he la& schedule is posted on the class we& pa!e
-
8/16/2019 02 Binary Numbers
6/79
"a&s $ext ee
Figure 1.5 in the textbook: An FPGA board.
-
8/16/2019 02 Binary Numbers
7/79
"a&s $ext ee
•
-
8/16/2019 02 Binary Numbers
8/79
Ad%inistrative Stu''
• $o class next >onday 4?niversity -oliday6
-
8/16/2019 02 Binary Numbers
9/79
(he eci%al Syste%
[https://reader015.{domain}/reader015/html5/0716/5b4bf4a9
-
8/16/2019 02 Binary Numbers
10/79
hat nu%&er syste% is this one@
[http://freedomhygiene.com/wp-content/themes/branfordmagazine/images/backgrounds/Hands_141756.jpg]
-
8/16/2019 02 Binary Numbers
11/79
(he #inary Syste%
[ http://divaprojections.blogspot.com/2011/11/alien.html]
-
8/16/2019 02 Binary Numbers
12/79
$u%&er Syste%s
-
8/16/2019 02 Binary Numbers
13/79
$u%&er Syste%s
n-th digit
(most significant)
0-th digit
(least significant)
-
8/16/2019 02 Binary Numbers
14/79
-
8/16/2019 02 Binary Numbers
15/79
(he eci%al Syste%
-
8/16/2019 02 Binary Numbers
16/79
(he eci%al Syste%
-
8/16/2019 02 Binary Numbers
17/79
Another ay to "oo at (his
5 2 4
-
8/16/2019 02 Binary Numbers
18/79
Another ay to "oo at (his
5 2 4
102 101 100
-
8/16/2019 02 Binary Numbers
19/79
Another ay to "oo at (his
5 2 4
102 101 100
boxes
labels
Each box can contain only one digit and has only one label. From right
to left, the labels are increasing powers of the base, starting from 0.
-
8/16/2019 02 Binary Numbers
20/79
#ase
-
8/16/2019 02 Binary Numbers
21/79
#ase
base power
-
8/16/2019 02 Binary Numbers
22/79
#ase
most significant
digit
least significant
digit
base power
-
8/16/2019 02 Binary Numbers
23/79
#ase
-
8/16/2019 02 Binary Numbers
24/79
-
8/16/2019 02 Binary Numbers
25/79
#inary $u%&ers 4#ase 26
-
8/16/2019 02 Binary Numbers
26/79
#inary $u%&ers 4#ase 26
most significant bit least significant bit
base power
-
8/16/2019 02 Binary Numbers
27/79
#inary $u%&ers 4#ase 26
-
8/16/2019 02 Binary Numbers
28/79
Another Exa%ple
-
8/16/2019 02 Binary Numbers
29/79
-
8/16/2019 02 Binary Numbers
30/79
hat is the value o' this &inary nu%&er@
• ) ) 1 ) 1 1 ) )
• ) ) 1 ) 1 1 ) )
• )B2A )B2 1B25 )B2* 1B23 1B22 )B21 )B2)
• )B128 )B* 1B32 )B1 1B8 1B* )B2 )B1
• )B128 )B* 1B32 )B1 1B8 1B* )B2 )B1
• 32 8 * D ** 4in deci%al6
-
8/16/2019 02 Binary Numbers
31/79
Another ay to "oo at (his
0 0 1 0 1 1 0 02021222324252627
-
8/16/2019 02 Binary Numbers
32/79
So%e (er%inolo!y
• A &inary di!it is called a bit
• A !roup o' ei!ht &its is called a &yte
• ne &it can represent only two possi&le states,which are denoted with 1 and )
-
8/16/2019 02 Binary Numbers
33/79
Felationship #etween a #yte and a #it
1 0 1 0 1 1 1 0
-
8/16/2019 02 Binary Numbers
34/79
Felationship #etween a #yte and a #it
1 0 1 0 1 1 1 0
1 bit
-
8/16/2019 02 Binary Numbers
35/79
Felationship #etween a #yte and a #it
1 0 1 0 1 1 1 0
8 bits = 1 byte
1 bit
-
8/16/2019 02 Binary Numbers
36/79
#it
-
8/16/2019 02 Binary Numbers
37/79
#it
-
8/16/2019 02 Binary Numbers
38/79
hat is the %axi%u% nu%&er that can &estored in one &yte 48 &its6@
hat is the %axi%u% nu%&er that can &e
-
8/16/2019 02 Binary Numbers
39/79
hat is the %axi%u% nu%&er that can &estored in one &yte 48 &its6@
• 1 1 1 1 1 1 1 1
• 1 1 1 1 1 1 1 1
• 1B2A 1B2 1B25 1B2* 1B23 1B22 1B21 1B2)
• 1B128 1B* 1B32 1B1 1B8 1B* 1B2 1B1
• 128 * 32 1 8 * 2 1 D 255 4in deci%al6
• Another way is: 1B28 H 1 D 25 H 1 D 255
hat would happen i' we try to add 1 to the lar!est
-
8/16/2019 02 Binary Numbers
40/79
hat would happen i' we try to add 1 to the lar!est
nu%&er that can &e stored in one &yte 48 &its6@
1 1 1 1 1 1 1 1
1
1 ) ) ) ) ) ) ) )
) ) ) ) ) ) ) )
-
8/16/2019 02 Binary Numbers
41/79
Analo!y with car odo%eters
-
8/16/2019 02 Binary Numbers
42/79
Analo!y with car odo%eters
[http://www.hyperocity.com/volvo240/images/Volvo/odometerrepair/speedo999999.jpg]
eci%al to #inary Conversion
-
8/16/2019 02 Binary Numbers
43/79
eci%al to #inary Conversion
4?sin! uessin!6
eci%al to #inary Conversion
-
8/16/2019 02 Binary Numbers
44/79
eci%al to #inary Conversion
4?sin! uessin!6
-
8/16/2019 02 Binary Numbers
45/79
Convertin! 'ro% eci%al to #inary
-
8/16/2019 02 Binary Numbers
46/79
Convertin! 'ro% eci%al to #inary
-
8/16/2019 02 Binary Numbers
47/79
[ Figure 1.6 in the textbook ]
-
8/16/2019 02 Binary Numbers
48/79
ctal Syste% 4#ase 86
-
8/16/2019 02 Binary Numbers
49/79
#inary to ctal Conversion
-
8/16/2019 02 Binary Numbers
50/79
#inary to ctal Conversion
1011100101112 = ?8
-
8/16/2019 02 Binary Numbers
51/79
#inary to ctal Conversion
1011100101112 = ?8
101 110 010 111
-
8/16/2019 02 Binary Numbers
52/79
#inary to ctal Conversion
1011100101112 = ?8
101 110 010 111
5 6 2 7
-
8/16/2019 02 Binary Numbers
53/79
#inary to ctal Conversion
1011100101112 = ?8
101 110 010 111
5 6 2 7
Thus, 1011100101112 =
-
8/16/2019 02 Binary Numbers
54/79
-exadeci%al Syste% 4#ase 16
-
8/16/2019 02 Binary Numbers
55/79
-
8/16/2019 02 Binary Numbers
56/79
(he 1 -exadeci%al i!its
), 1, 2, 3, *, 5, , , 8, ;, A, #, C, , E,
1), 11, 12, 13, 1*, 15
-
8/16/2019 02 Binary Numbers
57/79
-exadeci%al to eci%al Conversion
-
8/16/2019 02 Binary Numbers
58/79
-exadeci%al to eci%al Conversion
-
8/16/2019 02 Binary Numbers
59/79
-exadeci%al to eci%al Conversion
#inary to -exadeci%al Conversion
-
8/16/2019 02 Binary Numbers
60/79
#inary to -exadeci%al Conversion
#inary to -exadeci%al Conversion
-
8/16/2019 02 Binary Numbers
61/79
#inary to -exadeci%al Conversion
#i t - d i l C i
-
8/16/2019 02 Binary Numbers
62/79
#inary to -exadeci%al Conversion
1011100101112 = ?16
#i t - d i l C i
-
8/16/2019 02 Binary Numbers
63/79
#inary to -exadeci%al Conversion
1011100101112 = ?16
1011 1001 0111
#i t - d i l C i
-
8/16/2019 02 Binary Numbers
64/79
#inary to -exadeci%al Conversion
1011100101112 = ?16
1011 1001 0111
B 9 7
#i t - d i l C i
-
8/16/2019 02 Binary Numbers
65/79
#inary to -exadeci%al Conversion
1011100101112 = ?16
1011 1001 0111
B 9 7
Thus, 1011100101112 = B9716
i l t - d i l C i
-
8/16/2019 02 Binary Numbers
66/79
eci%al to -exadeci%al Conversion
i l t - d i l C i
-
8/16/2019 02 Binary Numbers
67/79
eci%al to -exadeci%al Conversion
Si d i t li t d
-
8/16/2019 02 Binary Numbers
68/79
Si!ned inte!ers are %ore co%plicated
e will tal %ore a&out the% when we start withChapter 3 in a couple o' wees.
(he story with 'loats is even %ore co%plicated
-
8/16/2019 02 Binary Numbers
69/79
y p
IEEE 5*1;85 Standard
[http://en.wikipedia.org/wiki/IEEE_754]
-
8/16/2019 02 Binary Numbers
70/79
In the exa%ple shown a&ove, the sign is ero so sis 1, the exponent is 12* so e is J3, and thesi!ni'icand % is 1.)1 4in &inary, which is 1.25 indeci%al6. (he represented nu%&er is there'ore1.25 K 2J3, which is ).1525.
[http://en.wikipedia.org/wiki/IEEE_754]
n line IEEE 5* Con erters
-
8/16/2019 02 Binary Numbers
71/79
nline IEEE 5* Converters
• http://www.hsch%idt.net/loatApplet/IEEE5*.ht%l
• http://&a&&a!e.cs.Gc.edu/IEEE5*/eci%al.ht%l
• >ore a&out 'loatin! point nu%&ers in Chapter 3.
Storin! Characters
http://www.h-schmidt.net/FloatApplet/IEEE754.htmlhttp://babbage.cs.qc.edu/IEEE-754/Decimal.htmlhttp://babbage.cs.qc.edu/IEEE-754/Decimal.htmlhttp://www.h-schmidt.net/FloatApplet/IEEE754.html
-
8/16/2019 02 Binary Numbers
72/79
Storin! Characters
• (his reGuires so%e convention that %aps &inary
nu%&ers to characters.
• ASCII ta&le
• ?nicode
ASCII (a&le
-
8/16/2019 02 Binary Numbers
73/79
ASCII (a&le
Extended ASCII Codes
-
8/16/2019 02 Binary Numbers
74/79
Extended ASCII Codes
(he ?nicode Character Code
-
8/16/2019 02 Binary Numbers
75/79
(he ?nicode Character Code
• http://www.unicode.or!/charts/
-
8/16/2019 02 Binary Numbers
76/79
E!yptian
-iero!lyphs
http://www.unicode.org/charts/
Close up
-
8/16/2019 02 Binary Numbers
77/79
Close up
http://www.unicode.org/charts/
-
8/16/2019 02 Binary Numbers
78/79
Luestions@
-
8/16/2019 02 Binary Numbers
79/79
(-E E$
top related