当前位置:网站首页>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 .
边栏推荐
- Apache multiple component vulnerability disclosure (cve-2022-32533/cve-2022-33980/cve-2021-37839)
- What is the process of ⼀ objects from loading into JVM to being cleared by GC?
- 激光雷達lidar知識點滴
- FFmpeg----图片处理
- PAG体验:十分钟完成AE动效部署上线各平台!
- Classification of regression tests
- Emqx 5.0 release: open source Internet of things message server with single cluster supporting 100million mqtt connections
- Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
- 什么是云原生?这回终于能搞明白了!
- Bill Gates posted his resume 48 years ago: "it's not as good-looking as yours."
猜你喜欢
C 6.0 language specification approved
Leetcode one question per day (636. exclusive time of functions)
Yyds dry goods inventory # solve the real problem of famous enterprises: cross line
Base64 encoding
leetcode:648. 单词替换【字典树板子 + 寻找若干前缀中的最短符合前缀】
Xiaomi's path of chip self-development
智汀不用Home Assistant让小米智能家居接入HomeKit
15、文本编辑工具VIM使用
Navigation — 这么好用的导航框架你确定不来看看?
CTFshow,信息搜集:web13
随机推荐
Read PG in data warehouse in one article_ stat
Emqx 5.0 release: open source Internet of things message server with single cluster supporting 100million mqtt connections
MicTR01 Tester 振弦采集模塊開發套件使用說明
Computer win7 system desktop icon is too large, how to turn it down
《微信小程序-进阶篇》组件封装-Icon组件的实现(一)
CTFshow,信息搜集:web14
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
Promoted to P8 successfully in the first half of the year, and bought a villa!
Leetcode one question per day (636. exclusive time of functions)
CTFshow,信息搜集:web7
Niuke real problem programming - day13
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
asp.netNBA信息管理系统VS开发sqlserver数据库web结构c#编程计算机网页源码项目详细设计
PAG体验:十分钟完成AE动效部署上线各平台!
asp. Netnba information management system VS development SQLSERVER database web structure c programming computer web page source code project detailed design
electron remote 报错
电脑Win7系统桌面图标太大怎么调小
15、文本编辑工具VIM使用
一文读懂数仓中的pg_stat
Novel Slot Detection: A Benchmark for Discovering Unknown Slot Types in the Dialogue System