Appendix B Number Systems 1283 Next (Web design portfolio) we work
Appendix B Number Systems 1283 Next we work from the leftmost column to the right. We divide 64 into 103 and observe that there is one 64 in 103 with a remainder of 39, so we write 1 in the 64 column. We divide 8 into 39 and observe that there are four 8s in 39 with a remainder of 7 and write 4 in the 8 column. Finally, we divide 1 into 7 and observe that there are seven 1s in 7 with no remainder so we write 7 in the 1 column. This yields: Positional values: 648 1 Symbol values: 147 and thus decimal 103 is equivalent to octal 147. To convert decimal 375 to hexadecimal, we begin by writing the positional values of the columns until we reach a column whose positional value is greater than the decimal number. We do not need that column, so we discard it. Thus, we first write Positional values: 4096 256 16 1 Then we discard the column with positional value 4096, yielding: Positional values: 25616 1 Next we work from the leftmost column to the right. We divide 256 into 375 and observe that there is one 256 in 375 with a remainder of 119, so we write 1 in the 256 column. We divide 16 into 119 and observe that there are seven 16s in 119 with a remainder of 7 and write 7 in the 16 column. Finally, we divide 1 into 7 and observe that there are seven 1s in 7 with no remainder so we write 7 in the 1 column. This yields: Positional values: 25616 1 Symbol values: 177 and thus decimal 375 is equivalent to hexadecimal 177. B.6 Negative Binary Numbers: Two s Complement Notation The discussion in this appendix has been focussed on positive numbers. In this section, we explain how computers represent negative numbers using two s complement notation. First we explain how the two s complement of a binary number is formed, and then we show why it represents the negative value of the given binary number. Consider a machine with 32-bit integers. Suppose int number = 13; The 32-bit representation of numberis 00000000 00000000 00000000 00001101 To form the negative of number we first form its one s complement by applying C# s ^ operator: onesComplement = number ^ 0×7FFFFFFF; Internally, onesComplement is now number with each of its bits reversed ones become zeros and zeros become ones as follows:
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.