the building blocks of number system
Post on 03-Jun-2018
218 Views
Preview:
TRANSCRIPT
-
8/12/2019 The Building Blocks of Number System
1/64
1
The Building Blocks:Binary Numbers, Boolean
Logic, and Gates
Chapter 4
-
8/12/2019 The Building Blocks of Number System
2/64
2
urpose o! Chapter
Learn ho" computers represent andstore in!ormation#
Learn "hy computers represent
in!ormation that "ay# Learn "hat the basic building de$ices in
a computer are, and ho" those de$icesare used to store in!ormation#
Learn ho" to build more comple%de$ices using the basic de$ices#
-
8/12/2019 The Building Blocks of Number System
3/64
&
'%ternal (epresentation o! )n!ormation
*hen "e communicate "ith each other, "eneed to represent the in!ormation in anunderstandable notation, e#g# *e use digits to represent numbers#
*e use letters to represent te%t# +ame applies "hen "e communicate "ith a
computer: *e enter te%t and numbers on the keyboard,
The computers displays te%t, images, and numberson the screen#
*e re!er to this as an e%ternal representation# But ho" do humanscomputers store the
in!ormation -internally./
-
8/12/2019 The Building Blocks of Number System
4/64
4
0umans:
Computers:
Te%t, numbers,
images, sounds
Te%t, numbers,
sounds
Te%t, numbers,images, sounds
Binary Numbers
+ynapsesNeurons
Te%t, numbers,images, sounds
'%ternal (epresentation o! )n!ormation
-
8/12/2019 The Building Blocks of Number System
5/64
)n!ormation "e need to represent
Numbers )ntegers 2&4, 43
ositi$enegati$e $alue 5166, 52&
7loating point numbers 12#&4,
Te%t Characters letters, digits, symbols
9ther Graphics, +ound, ideo, ;
-
8/12/2019 The Building Blocks of Number System
6/64
3
Numbering +ystems
*e use the decimal numbering system 16 digits: 6, 1, 2, &, 4, , 3, 1 > ? >16 L >6,
C>166
?)) > 12, entium )
*hat i! "e only had one symbol/ ))))) ))))) )) > 12
-
8/12/2019 The Building Blocks of Number System
7/64 1%2> 1%211 1%2 1%21414 ### 1%2 ### 1%211 1%2 1%266> 3,&> 3,&
-
8/12/2019 The Building Blocks of Number System
13/641&
(epresenting +igned )ntegers
0o" does the computer represent signed$alues/
Three schemes ha$e been used:
+igned magnitude
1Es complement
2Es complement
*hile unsigned binary is in some sense -natural.signed binary arithmetic is a human construct
There isa best "ay 5 "hich is "hat "e all use today
-
8/12/2019 The Building Blocks of Number System
14/6414
(epresenting +igned )ntegers
+igned Fagnitude
7irst bit is the signbit: 6> $e 1> 5$e
(emainder is the magnitudei#e# numeric $alue
14 in signed magnitude representation
514 in signed magnitude representation
roblems @rithmetic logic is comple%
There are t"o Heros:
6666666666666666
1666666666666666
6111666666666666
+ign bit#
6111666666666661
-
8/12/2019 The Building Blocks of Number System
15/641
(epresenting +igned )ntegers 1Es Complement
There is no signbit but an algorithm:
To con$ert !rom $e to 5$e and $ice $ersa:
in$ert E!lipE all the bits
14 in 1Es complement representation
514 in 1Es complement representation
roblems
@lthough arithmetic is much simpler, there aret"o Heros:
6666666666666666
1111111111111111
6111666666666666
1666111111111111
-
8/12/2019 The Building Blocks of Number System
16/64
13
(epresenting +igned )ntegers 2Es Complement
There is no signbit but an algorithm:
To con$ert !rom $e to 5$e and $ice $ersa:
in$ert E!lipE all the bits
then add 1
14 in 2Es complement representation
514 in 2Es complement representation
+imple arithmetic like 1Es complement 9nly one Hero:
6666666666666666 -6., con$ert:
1111111111111111
1
6666666666666666
6111666666666666
6166111111111111
-
8/12/2019 The Building Blocks of Number System
17/64
1 #
-
8/12/2019 The Building Blocks of Number System
19/64
18
2# Dsing normaliHed scienti!ic notation
+cienti!ic notation : K F % B K' B is the base, F is the mantissa , ' is the e%ponent#
'%ample: decimal, base>16 & > & % 166 e#g# & 1
266 > 2#6 % 16& e#g# 2#6 1666
'asy to con$ert to scienti!ic notation: 161#11 % 26
NormaliHe to get the -#. in !ront o! !irst
le!tmost 1 digit )ncrease e%ponent by one !or each location -#.
mo$es le!t decreases i! "e ha$e to mo$e right
161#11 % 26> #16111 % 2&
-
8/12/2019 The Building Blocks of Number System
20/64
26
+tore the normaliHed number
1166666666111616
#16111 % 2 #16111 % 2&&
'%ponent 3 bitsFantissa 16 bits
@ssumed binary point
Base 2 implied, not stored
-
8/12/2019 The Building Blocks of Number System
21/64
21
(epresenting Te%t
0o" can "e represent te%t in a binary!orm/ @ssign to each character a positi$e integer $alue
!or e%ample, @ is 3, B is 33, ;
Then "e can store the numbers in their binary
!ormM
The mapping o! te%t to numbers Code mapping
Need standard code mappings "hy/: @+C)) @merican +tandard Code !or )n!ormation
)nterchange > each letter =5bits
only 23 di!!erent characters can be represented 2=
Dnicode > each letter 135bits sometimes
-
8/12/2019 The Building Blocks of Number System
22/64
22
@+C)) Code mapping Table
;
H
y
%
;C
B
@
Char
;
122
121
126
;316 @NA ?R
?6 @NA ?O26 True
7alse
-
8/12/2019 The Building Blocks of Number System
36/64
&3
? is 16 and R is 1'%amples
?>16 9( ?R
?6 9( ?O26
Truth Table !or 9(
Let a and b be any Boolean e%pressions, then
TrueTrueTrue
True7alseTrue
TrueTrue7alse
7alse7alse7alse
a 9( bba
True
True
h bl !
-
8/12/2019 The Building Blocks of Number System
37/64
& a 9( b
d> N9T a 9( b @NA N9T b
Circuits Aiagram and Boolean
-
8/12/2019 The Building Blocks of Number System
55/64
g'%pr
Aeri$ing Boolean e%pressions !or theoutput#
NOT ((a OR b) AND (NOT b))
(a OR b) (a OR b)a
b
(a OR b) AND (NOT b)
(NOT b)
Circuits Aiagram and Boolean '%pr
-
8/12/2019 The Building Blocks of Number System
56/64
3
Circuits Aiagram and Boolean '%pr
(emember, "hen "riting Booleane%pressions !or circuit diagrams, "e canuse a di!!erent notationM
(a + b) (a + b)a
b
b
(a + b) b
(a + b) b
'%ample
-
8/12/2019 The Building Blocks of Number System
57/64
Transistor
*e sa" ho" to build logic gates @NA, 9(,
N9T: Transistors
Gates
Boolean logic
top related