软硬件系统编程PPT (13).pdf
计算机中的信息表示小结Summary:Information representation in the computerAfter finishing this weeks course,I hope you can answer.Why computers use binary numeral system?Besides numbers why can a computer understand other information?How are numbers,characters,music,and images represented on the computer?Since computers only understand binary,why do we need other numeral systems?How to represent the sign of a number in the computer?Why computers use complement?What is the main difference between a analog signal and a digital signal?3After finishing this weeks course,I hope you can understand.E.g.For a twos complement hex number A8H,is it positive or negative?What is the corresponding decimal number?Conversion methods between different numeral systemsRepresentation of original code,inverse code and complementArithmetic operations of machine numbersThe process of converting from analog audio signals or continuous image signals to digital signalsExercise 1.4Suppose:X=1010010,Y=-1100110.Calculation:the original code,inverse code and complement of X and Y,and X+Y complement=?Solution:Because X0,X original=X anti=X complement=01010010,Because Y0,Y original=11100110,Y anti=10011001,Y complement=10011010X+Y complement=01010010+10011010=11101100X+Y=10010100=-10100BExercise 2.What is the decimal number corresponding to the twos complement hex number A8H?solution:Because:A8H=10101000BSo:the number is negativeFor the complement of a negative number,to get its true value,we have to take the complement of the complement:A8H complement=10101000 complement=11011000,the true value is:-1011000The corresponding decimal number is:88