11 · Introducing the TCP_IP Internet Layer, IPv4 Addressing, and Subnets認識 TCP/IP 網際網路層、IPv4 定址與子網路

Decimal and Binary Number Systems十進位與二進位數字系統

Most people are accustomed to the decimal numbering system. The decimal (base 10) system is the numbering system used in everyday mathematics. On the other hand, the binary (base 2) system is the foundation of computer operations.

大多數人都習慣使用十進位數字系統。十進位(以 10 為基數)系統是日常數學中使用的數字系統。另一方面,二進位(以 2 為基數)系統則是電腦運算的基礎。

Network device addresses also use the binary system to define their location in the network. IPv4 addresses are based on a dotted-decimal notation of a binary number: four 8-bit fields (octets) converted from binary to decimal numbers, separated by dots. An example of an IPv4 address written in a dotted-decimal notation is 192.168.10.22. The binary equivalent of this number is 11000000.10101000.00001010.00010110. You can use any number of bits for a binary number, but for IPv4 addresses, you will always use 8 bits when converting each of the decimal numbers to binary. You must have a basic understanding of the mathematical properties of a binary system to understand networking.

網路裝置位址也使用二進位系統來定義其在網路中的位置。IPv4 位址是以點分十進位表示法呈現二進位數字:四個 8 位元欄位(八位元組)由二進位轉換為十進位數字,並以點號分隔。以點分十進位表示法寫出的 IPv4 位址範例為 192.168.10.22,其對應的二進位表示為 11000000.10101000.00001010.00010110。二進位數字可以使用任意位元數,但在 IPv4 位址中,每個十進位數字轉換為二進位時一律使用 8 位元。要理解網路知識,你必須具備二進位系統數學特性的基本概念。

Some numbering systems, such as Roman Numerals, use symbols indicating the value of the number. If the smaller value symbol is positioned before the larger value, then that is calculated by subtracting the values of the symbols. The addition of the combined values of symbols results in the final number. Roman Numerals are an example of a numeric system that is based on position but with different rules and logic of base numeric systems, such as decimal, binary or hexadecimal.

某些數字系統(例如羅馬數字)使用符號來表示數值。若較小值的符號位於較大值符號之前,則以較大值減去較小值來計算。符號組合值相加後便得出最終數字。羅馬數字是一種以位置為基礎、但採用不同規則與邏輯的數字系統範例,有別於十進位、二進位或十六進位等基數系統。

While the base number is important in any numbering system, it is the position of a digit that confers value. In the decimal numbering system, the number 10 is represented by a 1 in the tens position and a 0 in the ones position. The number 100 is represented by a 1 in the hundreds position, a 0 in the tens position, and a 0 in the ones position. In the decimal system, the digits are 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. When quantities higher than 9 are required, the decimal system begins with 10 and continues to 99. When quantities higher than 99 are required the decimal system begins again with 100, and so on, with each column to the left raising the exponent by 1. All these tens, hundreds, thousands, and so on are all powers of 10.

雖然基數在任何數字系統中都很重要,但真正賦予數值意義的是數字所在的位置。在十進位系統中,數字 10 是以「十位」上的 1 與「個位」上的 0 表示;數字 100 則是以「百位」上的 1、「十位」上的 0,以及「個位」上的 0 表示。在十進位系統中,數字為 0、1、2、3、4、5、6、7、8、9。當需要表示大於 9 的數量時,十進位系統從 10 開始,一路到 99;當需要表示大於 99 的數量時,十進位系統再從 100 開始,依此類推,每往左一欄,指數就增加 1。這些十、百、千等等,都是 10 的次方。

For example, a decimal number 27398 represents the sum (2 x 10,000) + (7 x 1000) + (3 x 100) + (9 x 10) + (8 x 1). If you write this with exponents the sum would look like: (2 x 104) + (7 x 103) + (3 x 102) + (9 x 101) + (8 x 100).

舉例來說,十進位數字 27398 代表總和 (2 x 10,000) + (7 x 1000) + (3 x 100) + (9 x 10) + (8 x 1)。若以指數表示,這個總和會寫成:(2 x 104) + (7 x 103) + (3 x 102) + (9 x 101) + (8 x 100)。

The binary system uses only the digits 0 and 1. Therefore, the first digit is 0, followed by 1. If a quantity higher than 1 is required, the binary system goes to 10, followed by 11. The binary system continues with 100, 101, 110, 111, then 1000, and so on. The following figure shows the binary equivalent of the decimal numbers 0 through 19.

二進位系統只使用數字 0 和 1。因此第一個數字是 0,接著是 1。若需要表示大於 1 的數量,二進位系統就會進到 10,接著是 11。二進位系統會繼續以 100、101、110、111,然後是 1000 的方式遞增,依此類推。下圖顯示十進位數字 0 到 19 所對應的二進位表示。

Building a binary number follows the same logic as building a decimal number, with the only difference that the base is 2 so the exponents represent the power of 2. If you take the binary number 10011 for example, it represents a sum of (1 x 24) + (0 x 23) +(0 x 22) +(1 x 21) +(1 x 20), which is equal to (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2) + (1 x 1) = 19.

建立二進位數字的邏輯與建立十進位數字相同,唯一的差異在於基數為 2,因此指數代表的是 2 的次方。以二進位數字 10011 為例,它代表總和 (1 x 24) + (0 x 23) +(0 x 22) +(1 x 21) +(1 x 20),等於 (1 x 16) + (0 x 8) + (0 x 4) + (1 x 2) + (1 x 1) = 19。

Which number system is the foundation of all computer operations?哪一種數字系統是所有電腦運算的基礎?

To make sure that you have an understanding of how to convert decimal values to binary and vice versa, you can play the Cisco Binary Game.

為確保你了解如何將十進位數值轉換為二進位,以及反向轉換,你可以玩玩看 Cisco Binary Game。

The Cisco Binary Game is accessible on the following link: https://learningnetwork.cisco.com/s/binary-game

你可以透過以下連結進入 Cisco Binary Game:https://learningnetwork.cisco.com/s/binary-game