当前位置:网站首页>Representation of base and number 2
Representation of base and number 2
2022-07-28 20:20:00 【Good life experience Officer】
Learning notes :
Carry system : It is a counting method that uses a set of fixed symbols and unified rules to represent the size of numerical values .
base : The number of digits used in the number system
Position right : Represents the weight at different positions
Carry counting system
- Decimal system
Definition :10 An ordered number :0、1、2、3 …… 9 And a decimal symbol “."
usage : Add “ Dot into one “, Subtraction ” Take a step back “
Any decimal number can be expressed as a polynomial with a power based on ten
Binary system
Definition : Binary digital symbols ,0 and 1, The base number is 2
usage : On the two into one , take a temporary measure 2n
octal
Definition : have 8 A different number symbol 0、1、2…… 7, The base number is 8
usage : Every eight enters one. , take a temporary measure 8n
Hexadecimal
Definition : have 16 A different number symbol 0、1、2…… 9、A、B、C、D、E、F, The base number is 16
usage : Every 16 to one , take a temporary measure 16n
The representation of carry digits
Subscript marks :(1110)₂
The suffix letter indicates : Binary system (B)、 octal (Q)、 Decimal system (D)、 Hexadecimal (H)
Hexadecimal conversion
R Base number → Decimal system
The law of expansion by right : Find the sum of the product of each bit and its weight
Decimal system →R Base number
Integral part : Divide the base and take the remainder
The fractional part : Multiply by Radix to round
Binary system → 8、 ... and / Hexadecimal
Centered on the decimal point , Divide to the left and right 3/4 position , In the middle of the 0 Don't omit . If the highest / The lowest position is insufficient 3/4 position , Separately supplement 0 that will do
8、 ... and / Hexadecimal → Binary system
General eight / Each number in hexadecimal is expanded to 3/4 Bit binary number , The order of arrangement and the position of the decimal point remain unchanged , And remove the redundant at both ends 0
octal → Hexadecimal
Take binary as the bridge
Signed digits
Number of machines : Use in the machine , Number digitized with the sign
There are three representations of machine number : Original code , Inverse code , Complement code ( The length of the number of machines is limited by the word length )
Original code
- Definition : Numerical bits are expressed in absolute values ,0( Plus sign )、1( Minus sign ). The original code is the absolute value of digital symbol bits plus numbers
operation :
Same number : Add the values
Different sign : Compare the absolute value , Large number minus decimal , Finally, choose the appropriate symbol
Inverse code
- Definition : The value bits of positive and inverse codes are the same as the true value bits ( That is, the same as the original code ), The sign bit of negative inverse code remains unchanged , The rest is reversed
Complement code
- Complement allows the sign bit to directly participate in the operation , Simplify operations , It can be reduced to plus
Positive complement is the same as the original , A negative complement is a sign bit invariant , The rest is reversed , Finally add 1
When the calculation result does not exceed the range of the machine , The addition of complement is still complement , Complement subtraction and change addition operation , Symbol bits participate in operations ,
The representation of numbers
Fixed point representation
Fixed-point number : The decimal point position is fixed
Fixed point decimals : The position of the decimal point is after the sign digit , Before the highest order of the significant value part
- Set the word length of a machine 8 position , A sign bit
The maximum number of fixed-point decimals :0.1111 111 Minimum non-zero positive number :0.0000 001
The maximum number of fixed-point positive numbers :0111 1111 Minimum positive number :0000 0001
overflow
underflow : If the data is less than the minimum value that the fixed-point number can represent , Computer work 0 Handle
Overflow : When the data is greater than the maximum value that the fixed-point number can represent , The computer cannot express
Floating point number means
- The range of values represented by fixed-point numbers is small , And it is easy to overflow during operation , Therefore, real numbers are more represented in a way similar to scientific counting , Floating point numbers
General expression :F=M*2^p
Pure decimal M It's the mantissa , Precision of representation number ,P It's an order code , Determine the position of the decimal point , Represents the range of numbers
边栏推荐
- C语言简单实例 1
- [C language] comprehensively analyze the pointer and sort out the pointer knowledge points
- flask_ Mail source code error
- 1. C language variable type, global variable, local variable
- HSETNX KEY_NAME FIELD VALUE 用法
- Basic mathematical knowledge (update)
- Raspberry connects EC20 for PPP dialing
- C language operators and input and output
- [C language] Fibonacci sequence [recursion and iteration]
- Raspberry pie 3b ffmpeg RTMP streaming
猜你喜欢
83.(cesium之家)cesium示例如何运行
Tencent cloud deployment lamp_ Experience of building a station
Saltstack advanced
【CodeForces】Educational Codeforces Round 132 (Rated for Div. 2)
The results of the second quarter online moving people selection of "China Internet · moving 2022" were announced
Communication learning static routing across regional networks
Multi-Modal Knowledge Graph Construction and Application: A Survey
[C language] initial C language reflection and summary
弹出模态框
In the second half of 2022, the system integration project management engineer certification starts on August 20
随机推荐
MySQL command statement (personal summary)
Two methods to judge the size end
Zfoo adds routes similar to mydog
私有化部署的即时通讯平台,为企业移动业务安全保驾护航
ssm中项目异常处理
最大交换[贪心思想&单调栈实现]
C language pointer and two-dimensional array
zfoo增加类似于mydog的路由
Multi-Modal Knowledge Graph Construction and Application: A Survey
Using typedef in C language to change the name of data type
Token verification program index.php when configuring wechat official account server
Simple use of robobrowser
WUST-CTF2021-re校赛wp
[C language] step jumping problem [recursion]
Using Lex (Flex) to generate lexical analyzer of PL language
Raspberry connects EC20 for PPP dialing
Raspberrypico serial communication
[C language] random number generation and `include < time. H > 'learning
Solve flask integration_ Error reporting in restplus
Array out of bounds