当前位置:网站首页>Bits and Information & integer notes
Bits and Information & integer notes
2022-07-07 14:53:00 【weixin_ forty-five million seven hundred and fifty thousand fou】
Basic knowledge of machine operation :
1、 Binary system because :a. Switch circuit characteristics ;b. The operation mode is simple ;c. Anti interference ;d. Matching Boolean algebra , And become the number system used by electronic computers .
Binary system 、 Hexadecimal 、 The conversion between the three decimal systems ( Bottom weight formula 、 Power splicing and so on ), Hexadecimal addition and subtraction operations will be applied to memory address operations .
2、 Bit operation and logic operation :
Note that bit operations expand parameters into bit vectors , Then operate by bit , The result is still a bit vector ; Logical operations only judge whether operands are non 0 Only judge whether it is not 0, by 0 Then it's false , Not 0 It is true . The result is either 0x00( false ), Either for 0x01( really ).
3、 Shift operation :
Shift operation can be realized very conveniently 2 Multiplication and division to the power of ( But this is not the only use of displacement ). Logical left shift and arithmetic left shift are complemented on the right after the shift 0; Logical shift right , Left complement 0,; Logical shift right , On the left is the sign bit ( Nonnegative complement 0, Negative numbers make up 1).
4、 Memory Is a linear combination of bytes , Memory is addressed by bytes , That is, one address corresponds to one byte , The storage of data in memory follows two patterns ( Big end method and small end method ).
Small end method keyword : Small 、 low 、 low ( The small endian method is to put the low order byte on the low order of the data ); Or a pithy formula : high and low ( High data to high address , Low data to low address )
Signed numbers and their relationship with unsigned numbers :
1、 Complement code : The definition of complement is to take the first place as the sign bit and turn it into a negative weight , So as to realize the expression of negative numbers ; In essence , The complement is to set the highest digit to 1 Binary number of “ translation ”2w To negative half axis , A negative number used to express a complementary relationship with it .eg:w=4, 1010 Originally +10, Changing to complement means and +10 stay 24=16 Complementary in scope -6.
2、 The value and range of complement : Use the complement value box , Or use complementary relationships , Or directly use the bottom weight formula that defines the complement , Find the value of complement . By observing the value range of complement, we can find , Different from the original code and inverse code , There is only one complement 0, It is convenient to confirm the calculation results . Also because of being alone 0 The existence of , The range of complement is asymmetric .w Signed number of bits ( Complement code ) The range of phi is zero :-2w-1—2w-1-1.
3、 Ask for a complement Methods : To reverse directly +1;|X| First from the right 1 And its right side remains unchanged , The left side is reversed .( The sign bit is also reversed )
4、 Mutual mapping and transformation :
Signed numbers and unsigned numbers are mapped one by one , The key point of mapping , It is also the only connection point , Is their binary expression . A binary vector , It can be explained as signed number and unsigned number respectively , Between the two numbers explained separately , If it is a non negative number, they are the same ( The complement of a nonnegative number makes itself ), If one of them is negative, the difference between the two is 2w. stay C In language, the two can be forcibly converted to each other .
边栏推荐
- Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
- Navigation — 这么好用的导航框架你确定不来看看?
- Demis hassabis talks about alphafold's future goals
- How to enable radius two factor / two factor (2fa) identity authentication for Anheng fortress machine
- Andriod --- JetPack :LiveData setValue 和 postValue 的区别
- Pytorch model trains practical skills and breaks through the bottleneck of speed
- Stm32cubemx, 68 sets of components, following 10 open source protocols
- [server data recovery] a case of RAID data recovery of a brand StorageWorks server
- Promoted to P8 successfully in the first half of the year, and bought a villa!
- 华为云数据库DDS产品深度赋能
猜你喜欢

13 ux/ui/ue best creative inspiration websites in 2022

大厂做开源的五大痛点

⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?

How to enable radius two factor / two factor (2fa) identity authentication for Anheng fortress machine

Pytorch model trains practical skills and breaks through the bottleneck of speed

Yyds dry goods inventory # solve the real problem of famous enterprises: cross line

Deformable convolutional dense network for enhancing compressed video quality

MicTR01 Tester 振弦采集模塊開發套件使用說明

IDA pro逆向工具寻找socket server的IP和port

Ian Goodfellow, the inventor of Gan, officially joined deepmind as research scientist
随机推荐
EfficientNet模型的完整细节
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
Niuke real problem programming - Day12
ES日志报错赏析-- allow delete
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
JSON解析实例(Qt含源码)
Cocoscreator resource encryption and decryption
Concurrency Control & NoSQL and new database
Niuke real problem programming - Day10
JS image to Base64
Promoted to P8 successfully in the first half of the year, and bought a villa!
华为云数据库DDS产品深度赋能
PD虚拟机教程:如何在ParallelsDesktop虚拟机中设置可使用的快捷键?
缓冲区溢出保护
Delete a whole page in word
Niuke real problem programming - Day9
Cocoscreator operates spine for animation fusion
CPU与chiplet技术杂谈
MicTR01 Tester 振弦采集模塊開發套件使用說明
PAG experience: complete AE dynamic deployment and launch all platforms in ten minutes!