当前位置:网站首页>Conversion between number systems

Conversion between number systems

2022-08-09 08:15:00 direction of light 79

One, number system conversion

Number system: A method of counting, which refers to a method of representing numerical values ​​with a set of fixed symbols and uniform rules
Digits: It refers to the number symbols in a number
Base: refers to the number of digital symbols that can be used on a digit in a certain carry counting system
Digit weight:Refers to the size represented by the digits in a certain carry counting system, that is, the size of the value represented by "1" in a certain position

Second, the numerical value of the computer

Binary, Octal, Decimal, Hexadecimal

High to bottom

0 0 0 0 1 1 1 1

7 6 5 4 3 2 1 0

In the number system, there is also a rule, that is, the N base must be rounded up by one every N.

Decimal is every decimal one

Binary is every two into one

Octal is every octal

Hexadecimal is every hexadecimal one

Three, Common binary:

11111111——255

11111110——254

11000000—192

10101000——168

01100100—100

011111111——127

10000000——128

11100000——224

11110000—240

4. Hexadecimal conversion method

Decimal to binary 175, 175=10101111(B)

Octal to binary 175O, 175O=(1 111 101)B

Hexadecimal to binary 175H, 175H=(1 0111 0101)B

2. Subnet divisionSubnettingspan>icon-default.png?t=M4ADhttps://so.csdn.net/so/search?q=%E5%AD%90%E7%BD%91%E5%88%92%E5%88%86&spm=1001.2101.3001.7020

IPv4 consists of 32-bit binary numbers, generally expressed in dotted decimal, divided into 4 groups of 8 bits each.For example: 11000000.10101000.00000000.00000010, usually expressed in decimal form for the convenience of configuration, for example: 192.168.0.2

IPv6 consists of 128 bits, usually separated by colons, expressed in hexadecimal.

IPv4 address consists of two parts: network part + host part 192.168.1.117
network part (192.168.1), host part (117), 192.168.1.0 (network address), 192.168.1.255 (broadcast address)

2. Subnetting

Example: 192.168.1.189/26

11000000.10101000.00000001.10111101 IP address

11111111 11111111 11111111 11000000 Subnet Mask

11000000 10101000 00000001 10000000 Network Address
192 . 168 . 1 . 128

11000000 10101000 00000001 10111111 Broadcast address
192 . 168 . 1 . 191
Number of subnets=2^n, where n is the number of bits in the subnet part (in class C addressesFor example, n is the number of 1 in the last 8 bits of the subnet mask)
Number of hosts (available IP)=2^N - 2, where Nis the number of bits in the host part (taking a class C address as an example, n is the number of 0 in the last 8 bits of the subnet mask)

Summary

Learn hexadecimal conversion, know how to convert octal and hexadecimal into binary, mainly memorize the hexadecimal comparison table and several common binary.The subnetting part understands the classification of IP addresses, and the conversion of network addresses and broadcast addresses.Familiar with the calculation of the number of subnets and the number of hosts.

原网站

版权声明
本文为[direction of light 79]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/221/202208090802284348.html