官术网_书友最值得收藏!

Bases

The place value of a digit in a number determines its value at that position. In the standard decimal numbers, the value of a place is ten times the value of the place on its right. The decimal number system is also called base-10, which is composed of digits from 0 to 9.

Let's say that position 1 is at the right-most digit of the whole number, as follows:

2018
Place value at position 1 is 1 multiplied by 8 represents 8.
Place value at position 2 is 10 multiplied by 1 represents 10.
Place value at position 3 is 100 multiplied by 0 represents 0.
Place value at position 4 is 1000 multiplied by 2 represents 2000.

The sum of all represented numbers is the actual value. Following this concept will help us to read or convert into other number bases.

In base-2 numbers, the value of a place is 2 times the value of the place on its right. Base-2 uses only 2 digits, composed of 0 and 1. In this book, we will append a small b to denote that the number is of base-2 format. Base-2 numbers are also called binary numbers. Each digit in a binary string is called a bit. Consider the following as an example:

11010b
Place value at position 1 is 1 multiplied by 0 represents 0.
Place value at position 2 is 2 multiplied by 1 represents 2.
Place value at position 3 is 4 multiplied by 0 represents 0.
Place value at position 4 is 8 multiplied by 1 represents 8.
Place value at position 5 is 16 multiplied by 1 represents 16.

The equivalent decimal value of 11010b is 26.

In base-16 numbers, the value of a place is 16 times the value of the place on its right. It is composed of digits 0 to 9 and letters A to F where A is equivalent to 10, B is 11, C is 12, D is 13, E is 14, and F is 15. We will denote base-16 numbers, also known as hexadecimal numbers, with the letter h. In this book, hexadecimal numbers with an odd number of digits will be prefixed with 0 (zero). Hexadecimal numbers can also instead be prefixed with "0x" (zero and a lowercase x). The 0x is a standard used on various programming languages denoting that the number next to it is of hexadecimal format:

BEEFh
Place value at position 1 is 1 multiplied by 0Fh (15) represents 15.are
Place value at position 2 is 16 multiplied by 0Eh (14) represents 224.
Place value at position 3 is 256 multiplied by 0Eh (14) represents 3584.
Place value at position 4 is 4096 multiplied by 0Bh (11) represents 45056.

The equivalent decimal value of BEEFh is 48879.
主站蜘蛛池模板: 理塘县| 延吉市| 平邑县| 开化县| 东乡族自治县| 南和县| 金阳县| 广河县| 林甸县| 临湘市| 若羌县| 靖宇县| 华阴市| 彩票| 大石桥市| 伊金霍洛旗| 措美县| 澎湖县| 盱眙县| 石门县| 衡东县| 雅江县| 保山市| 沐川县| 舞钢市| 临桂县| 秭归县| 乐昌市| 田阳县| 松滋市| 虹口区| 襄垣县| 若尔盖县| 南充市| 沈阳市| 贺兰县| 北海市| 东丰县| 陇西县| 汶川县| 琼海市|