资源描述:
《微机原理ch01introductiontocomputer》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、1INTRODUCTIONTOCOMPUTER1.1NUMBERINGANDCODINGSYSTEMS1.1.1DecimalandbinarynumbersystemsWhereashumanbeingsuse10(decimal)arithmetic,computersusethebase2(binary)system.Thebinarysystemisusedincomputersbecause1and0representthetwovoltagelevelsofonandoff.Inbase10t
2、hereare10distinctsymbols,0,1,2,3,4,5,6,7,8,9.Inbase2thereareonlytwo,0and1,withwhichtogeneratenumbers.Thesetwobinarydigits,0and1,arecommonlyreferredtoasbits.1.1.2ConvertingfromdecimaltobinaryOnemethodofconvertingfromdecimaltobinaryisdividethedecimalnumberb
3、y2repeatedly,keepingtrackoftheremainders.Thisprocesscontinuesuntilthequotientbecomestozero.Theremaindersarethenwritteninreverseordertoobtainthebinarynumber.Example:Convert2510tobinarySolution:Quotient(商)Remainder(余数)25/2=121LSB(leastsignificantbit)12/2=60
4、6/2=303/2=111/2=01MSB(mostsignificantbit)Therefore,2510=1100121.1.3ConvertingfrombinarytodecimalToconvertfrombinarytodecimal,itisimportanttounderstandtheconceptofweightassociatedwitheachdigitposition.First,asanalogy,recalltheweightofnumbersinbase10system.
5、74068310=3x100= 38x101= 806x102= 6000x103= 00004x104= 400007x105=700000------740683Bythesometoken,eachdigitpositioninanumberinbase2hasaweightassociatedwithit:1101012=DecimalBinary1x20=1x1= 1 10x21=0x2= 0 001x22=1x4= 4 1000x23=0x8= 0 00
6、001x24=1x16=16 100001x25=1x32=32100000--------53110101Knowingtheweightofeachbitinabinarynumbermakesitsimpletoaddthemtogethertogetitsdecimalequivalent.20=128=25621=229=51222=4210=10241K23=8211=204824=16212=409625=32213=819226=64214=1638427=128215=32768216=
7、65536220=10485761M230=10737418241G1.1.1HexadecimalsystemBase16,thehexadecimalsystemasitiscalledincomputerliterature,isusedasconvenientrepresentationofbinarynumbers.Forexample,itismucheasierforhumanbeingtorepresentastring0sand1sas100010010110asitshexadecim
8、alequivalentof896H.Thebinarysystemhas2digits,0and1.Thebase10systemhas10digits,0through9.Thehexadecimal(16base)systemmusthave16digits.Inbase16system,thefirst10digits,0to9,arethesameasindecimal,andfortheremainingsixdi