当前位置:网站首页>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 .
边栏推荐
- 智汀不用Home Assistant让小米智能家居接入HomeKit
- MicTR01 Tester 振弦采集模塊開發套件使用說明
- 【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
- 缓冲区溢出保护
- ES日志报错赏析-trying to create too many buckets
- Demis hassabis talks about alphafold's future goals
- What is the process of ⼀ objects from loading into JVM to being cleared by GC?
- 「2022年7月」WuKong编辑器更版记录
- Navigation - are you sure you want to take a look at such an easy-to-use navigation framework?
- PAG experience: complete AE dynamic deployment and launch all platforms in ten minutes!
猜你喜欢
暑期安全很重要!应急安全教育走进幼儿园
Niuke real problem programming - day16
上半年晋升 P8 成功,还买了别墅!
潘多拉 IOT 开发板学习(HAL 库)—— 实验12 RTC实时时钟实验(学习笔记)
拼多多败诉,砍价始终差0.9%一案宣判;微信内测同一手机号可注册两个账号功能;2022年度菲尔兹奖公布|极客头条...
Computer win7 system desktop icon is too large, how to turn it down
Apache多个组件漏洞公开(CVE-2022-32533/CVE-2022-33980/CVE-2021-37839)
⼀个对象从加载到JVM,再到被GC清除,都经历了什么过程?
Niuke real problem programming - day13
Five pain points for big companies to open source
随机推荐
PG基础篇--逻辑结构管理(锁机制--表锁)
Promoted to P8 successfully in the first half of the year, and bought a villa!
2022云顾问技术系列之高可用专场分享会
解析PHP跳出循环的方法以及continue、break、exit的区别介绍
buffer overflow protection
AWS learning notes (III)
Instructions d'utilisation de la trousse de développement du module d'acquisition d'accord du testeur mictr01
Computer win7 system desktop icon is too large, how to turn it down
Cocoscreator resource encryption and decryption
Niuke real problem programming - day14
Attribute keywords serveronly, sqlcolumnnumber, sqlcomputecode, sqlcomputed
electron remote 报错
时空可变形卷积用于压缩视频质量增强(STDF)
回归测试的分类
电脑Win7系统桌面图标太大怎么调小
Attribute keywords ondelete, private, readonly, required
Niuke real problem programming - day16
缓冲区溢出保护
广州开发区让地理标志产品助力乡村振兴
用于增强压缩视频质量的可变形卷积密集网络