Computer Representation of Numbers and Computer Arithmetic.pdfVIP

  • 12
  • 0
  • 约9.4万字
  • 约 43页
  • 2015-10-01 发布于河南
  • 举报

Computer Representation of Numbers and Computer Arithmetic.pdf

Computer Representation of Numbers and Computer Arithmetic.pdf

Computer Representation of Numbers and Computer Arithmetic c Adrian Sandu, 1998–2007 February 5, 2008 1 Binary numbers In the decimal system, the number 107.625 means 107.625 = 1 102 + 7 100 + 6 10−1 + 2 10−2 + 5 10−3 . Such a number is the sum of terms of the form {a digit times a different power of 10} - we say that 10 is the basis of the decimal system. There are 10 digits (0,...,9). All computers today use the binary system. This has obvious hardware advantages, since the only digits in this system are 0 and 1. In the binary system the number is represented as the sum of terms of the form {a digit times a different power of 2}. For example, (107.625)10 = 26 + 25 + 23 + 21 + 20 + 2−1 + 2−3 = (1101011.101)2 . Arithmetic operations in the binary system are performed similarly as in the decimal system; since there are only 2 digits, 1+1=10. 1 1 1 × 1 1 0 1 1 1 1 0 0 0 0 + 1 1 0 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 0 Decimal to binary conversion. For the integer part, we divide by 2 repeatedly (using integer division); the remainders are the successive digits of the number in base 2, from least 1 A. Sandu. Computer Arithmetic

文档评论(0)

1亿VIP精品文档

相关文档