当前位置:网站首页>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>https://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.
边栏推荐
猜你喜欢
随机推荐
204. 数素数
Matlab, and nonlinear equations solving linear equations
Database MySQL installation and uninstallation
pip3换源提升速度
继承中的运算符重载:输入输出的传奇
pc端ncnn搭建与测试
C language: adjust the order of odd and even numbers
File Handling (IO)
配置本地yum源仓库
EMQ X 消息服务器学习记录——为后面的毕设做准备
OpenHarmony轻智能产品开发直播笔记
欧几里和游戏
权限(下)
SOLIDWORKS 2022新功能直播揭秘!速来围观!
实现弹簧柔性状态的2种方式 | Solidworks教程
Non-decreasing Array
权限(上)
Shell之函数与数组
三层交换机原理及配置
Result consisted of more than one row