topic 1a numbering system
TRANSCRIPT
-
8/11/2019 TOPIC 1A Numbering System
1/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
NUMBERING SYSTEMS
1.0 INTRODUCTION
Many number systems are in use in diita!"ana!#ue te$%n#!#y& T%e m#st $#mm#n are:
'e$ima!'e$ima!
BinaryBinary
(e)ade$ima!(e)ade$ima!
Understandin t%ese numberin systems is im*#rtant be$ause t%eir use sim*!i+ies #t%er
$#m*!e) t#*i$s in$!udin b##!ean a!ebra and !#i$ desin, sined numeri$ re*resentati#n,
$%ara$ter $#des, and *a$-ed data&
1.1 The Decimal Number Base Systems
T%e 'e$ima! Number System uses base 1.& It in$!udes t%e diits +r#m . t%r#u% /& T%e
'e$ima! Number System %as a *#siti#n 0a!ue $%ara$teristi$& T%e ei%ted 0a!ues +#r ea$%
*#siti#n is as +#!!#s:
10! 10" 10# 101 100 10$1 10$# 10$"
10000 1000 100 10 1 .1 .01 .001
T%e number 123 re*resents:
1 % 10# & # % 101 & " % 100 '
1 % 100 & # % 10 & " % 1 '
100 & #0 & " '
1#"
Ea$% diit a**earin t# t%e !e+t #+ t%e de$ima! *#int re*resents a 0a!ue beteen 4er# and
nine times *#er #+ ten re*resented by its *#siti#n in t%e number& 'iits a**earin t# t%e
5555555555555555555555555555555555555555555555555555555555555555555555'iita! E!e$tr#ni$s 6 BE'121.3
1
-
8/11/2019 TOPIC 1A Numbering System
2/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
ri%t #+ t%e de$ima! *#int re*resent a 0a!ue beteen 4er# and nine times an in$reasin
neati0e *#er #+ ten&
7#r e)am*!e, t%e 0a!ue 829&1/ is re*resented as +#!!#s:
( % 10# & # % 101 & ) % 100 & 1 % 10$1 & * % 10$# & ! % 10$" '
( % 100 & # % 10 & ) % 1 & 1 % 0.1 & * % 0.01 & ! % 0.001 '
(00 & #0 & ) & 0.1 & 0.0* & 0.00! '
(#).1*!
1.# The Bi+ary Number Base Systems
T%e binary number system #r-s !i-e t%e de$ima! number system e)$e*t t%e Binary
Number System:
uses base 2
in$!udes #n!y t%e diits . and 1 ;any #t%er diit #u!d ma-e t%e number an
in0a!id binary numberu#tient by 2 and dr#**in t%e *re0i#us remainder unti! t%e
>u#tient is .& ?%en *er+#rmin t%e di0isi#n, t%e remainders %i$% i!! re*resent t%e binary
e>ui0a!ent #+ t%e de$ima! number are ritten beinnin at the least significant digit (right)
and ea$% ne diit is ritten t# more significant digit (the left)#+ t%e *re0i#us diit&
C#nsider t%e number @3&
Di/isi+ 3utie+t Remai+4er Bi+ary Number
-" 5 # !1 1 1
!1 5 # #0 1 11
#0 5 # 10 0 011
10 5 # ) 0 0 011
) 5 # # 1 10 011
# 5 # 1 0 010 011
1 5 # 0 1 1010 011
5555555555555555555555555555555555555555555555555555555555555555555555'iita! E!e$tr#ni$s 6 BE'121.3
3
-
8/11/2019 TOPIC 1A Numbering System
4/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
1.#.# Bi+ary Number rmats
?e ty*i$a!!y rite binary numbers as a se>uen$e #+ bits ;bits is s%#rt +#r binary diits
-
8/11/2019 TOPIC 1A Numbering System
5/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
(b) 1... (d) 1.11
(e) 1111 ;+< .111
2& C#n0ert t%e +#!!#in binary numbers t# t%eir de$ima! e>ui0a!ents:
(a) !....... (b) ...1....
(b) ..11..11 ;d< .11..1..
(e) ...11111 ;+< 11111111
3& C#n0ert t%e +#!!#in de$ima! numbers t# t%eir binary e>ui0a!ents:
(a) 8 (b) @
;$< 29 ;d< 18/3
#.0 BIN>RY >RIT?METIC
T# e)*!#re t%e basi$ *rin$i*!es t%at are needed t# understand %# diita! systems *er+#rm
t%e basi$ arit%meti$ #*erati#n su$% as additi#n, subtra$ti#n, mu!ti*!i$ati#n and di0isi#n&
#.1 BIN>RY >DDITION
5555555555555555555555555555555555555555555555555555555555555555555555'iita! E!e$tr#ni$s 6 BE'121.3
9
-
8/11/2019 TOPIC 1A Numbering System
6/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
Ge+eral @ri+ci2les=
. . D .
1 . D 1
1 1 D 1. D . $arry #+ 1 int# ne)t *#siti#n
1 1 1 D 11 D 1 $arry #+ 1 int# ne)t *#siti#n
(a) Rules for binary addition (b)Binary addition problem
i:ure= 1
#.# BIN>RY SUBTRCTION
T%e ru!es +#r binary subtra$ti#n are s%#n in 7iure 2;a). T%e +irst t%ree ru!es are t%e same
as in de$ima! subtra$ti#n& T%e !ast ru!e re>uires a borrow +r#m t%e ne)t m#re sini+i$ant
*!a$e ;t%e 2s *!a$e
-
8/11/2019 TOPIC 1A Numbering System
7/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
1.
. 1. . 1. 8 1
Minuend . 1 1 . . 1 . 1 . 1 . 1 @9Subtra%end 6 . 6 1 6 . 6 1 6 . . 1 1 1 . 1 1 6 98
'i++eren$e . . 1 1 . . . 1 1 1 . . 2 2@1. (a) Ru!es +#r binary subtra$ti#n (b) Binary subtra$ti#n *r#b!em
i:ure= #
#." BIN>RY MU;TI@;IC>TION
T%e ru!es +#r binary mu!ti*!i$ati#n are s%#n in 7iure: 3. T%e +irst t# ru!es need n#
e)*!anati#n& T%e mu!ti*!ier is 1 in t%e !atter t# ru!es& ?%en t%e mu!ti*!ier is 1 in binary
mu!ti*!i$ati#n, t%e multiplicand is copied as t%e *r#du$t& ?%en t%e mu!ti*!ier is ., t%e*r#du$t is a!ays .&
Mu!ti*!i$and 11.1 13Mu!ti*!ier F 1.1 F 9
Mu!ti*!i$and . 1 . 1 7irst *artia! *r#du$t 11.1 91.Mu!ti*!ier ) . ) . ) 1 ) 1 Se$#nd *artia! *r#du$t ....'i++eren$e . . . 1 T%ird *artia! *r#du$t 11.1
7ina! *r#du$t 1.....12
;a< Ru!es +#r binary mu!ti*!i$ati#n (b) Binary mu!ti*!i$ati#n *r#b!em
i:ure="
#.! BIN>RY DIAISION
T%e *r#$ess +#r di0idin #ne binary number ;di0idend< by an#t%er ;di0is#r< is t%e same as
t%at %i$% is +#!!#ed +#r de$ima! numbers i&e usinlong division
&
I+ t%e di0is#r is !ess t%an #r e>ua! t# t%e di0idend, t%e >u#tient is 1 in t%at *#siti#n=
#t%erise, t%e >u#tient is .&
..11 >u#tient
di0is#r 11 1..1 di0idend
.11
..11
..11
.... remainder
5555555555555555555555555555555555555555555555555555555555555555555555'iita! E!e$tr#ni$s 6 BE'121.3
8
-
8/11/2019 TOPIC 1A Numbering System
8/8
UniKL BMI TOPIC 1: NUMBERING SYSTEMS
Eercises=
a