(精品)ch-02.ppt
《(精品)ch-02.ppt》由会员分享,可在线阅读,更多相关《(精品)ch-02.ppt(50页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、2 2Number Number SystemsSystems1q Understand the concept of number systems.q Distinguish between non-positional and positional number systems.q Describe the decimal,binary,hexadecimal and octal system.qConvert a number in binary,octal or hexadecimal to a number in the decimal system.q Convert a numb
2、er in the decimal system to a number in binary,octal and hexadecimal.q Convert a number in binary to octal and vice versa.q Convert a number in binary to hexadecimal and vice versa.q Find the number of digits needed in each system to represent a particular value.ObjectivesAfter studying this chapter
3、,the student should be able After studying this chapter,the student should be able to:to:22-1 INTRODUCTIONA A number number systemsystem defines defines how how a a number number can can be be represented represented using using distinct distinct symbols.symbols.A A number number can can be be repre
4、sented represented differently differently in in different different systems.systems.For For example,example,the the two two numbers numbers(2A)(2A)1616 and and(52)(52)8 8 both both refer refer to to the the same same quantity,quantity,(42)(42)1010,but but their their representations representations
5、 are are different.different.Several Several number number systems systems have have been been used used in in the the past past and and can can be be categorized categorized into into two two groups:groups:positionalpositional and and non-positionalnon-positional systems.systems.Our Our main main g
6、oal goal is is to to discuss discuss the the positional positional number number systems,systems,but but we we also also give give examples examples of of non-positional systems.non-positional systems.32-2 POSITIONAL NUMBER SYSTEMSIn In a a positional positional number number systemsystem,the the po
7、sition position a a symbol symbol occupies occupies in in the the number number determines determines the the value value it it represents.In this system,a number represented as:represents.In this system,a number represented as:has the value of:has the value of:in which S is the set of symbols,b is
8、the in which S is the set of symbols,b is the basebase(or (or radixradix).).4S=0,1,2,3,4,5,6,7,8,9The decimal system(base 10)The word decimal is derived from the Latin root decem(ten).In this system the base b=10 and we use ten symbolsThe symbols in this system are often referred to as decimal digit
9、s or just digits.5IntegersFigure 2.1 Place values for an integer in the decimal system6Example 2.1The The following following shows shows the the place place values values for for the the integer integer+224+224 in in the the decimal system.decimal system.Note Note that that the the digit digit 2 2
10、in in position position 1 1 has has the the value value 20,20,but but the the same same digit digit in in position position 2 2 has has the the value value 200.200.Also Also note note that that we we normally normally drop the plus sign,but it is implicit.drop the plus sign,but it is implicit.7Examp
11、le 2.2The The following following shows shows the the place place values values for for the the decimal decimal number number 7508.7508.We We have have used used 1,1,10,10,100,100,and and 1000 1000 instead instead of of powers powers of of 10.10.Note Note that that the the digit digit 2 2 in in posi
12、tion position 1 1 has has the the value value 20,20,but but the the same same digit digit in in position position 2 2 has has the the value value 200.200.Also Also note note that that we we normally normally drop the plus sign,but it is implicit.drop the plus sign,but it is implicit.()Values8RealsEx
13、ample 2.3The following shows the place values for the real number+24.13.The following shows the place values for the real number+24.13.9The word binary is derived from the Latin root bini(or two by two).In this system the base b=2 and we use only two symbols,The binary system(base 2)S=0,1The symbols
14、 in this system are often referred to as binary digits or bits(binary digit).10IntegersFigure 2.2 Place values for an integer in the binary system11Example 2.4The The following following shows shows that that the the number number(11001)(11001)2 2 in in binary binary is is the the same as 25 in deci
15、mal.The subscript 2 shows that the base is 2.same as 25 in decimal.The subscript 2 shows that the base is 2.The equivalent decimal number is N=16+8+0+0+1=25.The equivalent decimal number is N=16+8+0+0+1=25.12RealsExample 2.5The The following following shows shows that that the the number number(101.
16、11)(101.11)2 2 in in binary binary is is equal equal to the number 5.75 in decimal.to the number 5.75 in decimal.13The word hexadecimal is derived from the Greek root hex(six)and the Latin root decem(ten).In this system the base b=16 and we use sixteen symbols to represent a number.The set of symbol
17、s isThe hexadecimal system(base 16)S=0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Note that the symbols A,B,C,D,E,F are equivalent to 10,11,12,13,14,and 15 respectively.The symbols in this system are often referred to as hexadecimal digits.14IntegersFigure 2.3 Place values for an integer in the hexadecimal syste
18、m15Example 2.6The The following following shows shows that that the the number number(2AE)16(2AE)16 in in hexadecimal hexadecimal is is equivalent to 686 in decimal.equivalent to 686 in decimal.The equivalent decimal number is N=512+160+14=686.The equivalent decimal number is N=512+160+14=686.16The
19、word octal is derived from the Latin root octo(eight).In this system the base b=8 and we use eight symbols to represent a number.The set of symbols isThe octal system(base 8)S=0,1,2,3,4,5,6,7 17IntegersFigure 2.3 Place values for an integer in the octal system18Example 2.7The The following following
20、 shows shows that that the the number number(1256)(1256)8 8 in in octal octal is is the the same same as 686 in decimal.as 686 in decimal.Note that the decimal number is N=512+128+40+6=686.Note that the decimal number is N=512+128+40+6=686.19Table 2.1 shows a summary of the four positional number sy
21、stems discussed in this chapter.Summary of the four positional systems20Table 2.2 shows how the number 0 to 15 is represented in different systems.21We need to know how to convert a number in one system to the equivalent number in another system.Since the decimal system is more familiar than the oth
22、er systems,we first show how to covert from any base to decimal.Then we show how to convert from decimal to any base.Finally,we show how we can easily convert from binary to hexadecimal or octal and vice versa.Conversion22Any base to decimal conversionFigure 2.5 Converting other bases to decimal23Ex
23、ample 2.8The The following following shows shows how how to to convert convert the the binary binary number number(110.11)(110.11)2 2 to decimal:(110.11)to decimal:(110.11)2 2=6.75.=6.75.24Example 2.9The The following following shows shows how how to to convert convert the the hexadecimal hexadecima
24、l number number(1A.23)(1A.23)1616 to decimal.to decimal.Note Note that that the the result result in in the the decimal decimal notation notation is is not not exact,exact,because because 3 3 161622 =0.01171875.0.01171875.We We have have rounded rounded this this value value to to three three digits
25、 digits(0.012).(0.012).25Example 2.10The following shows how to convert(23.17)The following shows how to convert(23.17)8 8 to decimal.to decimal.This This means means that that(23.17)8(23.17)8 19.234 19.234 in in decimal.decimal.Again,Again,we we have have rounded up 7 8rounded up 7 822=0.109375.=0.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 精品 ch 02
限制150内