当前位置:网站首页>How to understand that binary complement represents negative numbers
How to understand that binary complement represents negative numbers
2022-07-07 15:38:00 【sgmcy】
First , If it means a positive number
that N position , The maximum positive number expressed is 2^N -1
in other words , If it's a byte ,8bit, The maximum positive number is 255
If expressed as a negative number The maximum representation range is -2^(N-1) ~ 2^(N-1) - 1
in other words , If calculated in absolute value , The absolute value of a negative number plus the absolute value of a positive number ,
2^(N-1) + 2^(N-1) - 1 It becomes 2^N -1
Find negative numbers 2 Hexadecimal complement representation , First find the binary form of positive numbers , Then each bit is reversed , And then add 1 that will do .
In the computer , All data exists in the form of complement , Don't mention the original code , Inverse code or something , Remember to have a headache . Just remember the complement . Because all data exists in complement , Then just remember one .
Then why should it exist in the form of complement ? That genius came up with this storage method ?
Refer to this post , It's very detailed :
A clock chart One minute to understand Computer complement _ Travel great blog -CSDN Blog
The reason why I understand the way clocks express complement , When I was in Graduate School , Our teacher told us , When I finished speaking, it suddenly became clear .
边栏推荐
- 2. Heap sort "hard to understand sort"
- What is data leakage
- Unity之ASE实现卡通火焰
- 全日制研究生和非全日制研究生的区别!
- 使用cpolar建立一个商业网站(2)
- Configure mongodb database in window environment
- Ctfshow, information collection: web13
- Change win10 Screensaver
- Super signature principle (fully automated super signature) [Yun Xiaoduo]
- 连接ftp服务器教程
猜你喜欢

The bank needs to build the middle office capability of the intelligent customer service module to drive the upgrade of the whole scene intelligent customer service

Briefly describe the working principle of kept

有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小母牛。请编程实现在第n年的时候,共有多少头母牛?

2. 堆排序『较难理解的排序』
![[deep learning] image hyperspectral experiment: srcnn/fsrcnn](/img/84/114fc8f0875b82cc824e6400bcb06f.png)
[deep learning] image hyperspectral experiment: srcnn/fsrcnn

什么是数据泄露

Ctfshow, information collection: web6

【目标检测】YOLOv5跑通VOC2007数据集

Ctfshow, information collection: web1

Change win10 Screensaver
随机推荐
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
【兰州大学】考研初试复试资料分享
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
[original] all management without assessment is nonsense!
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
@ComponentScan
【數據挖掘】視覺模式挖掘:Hog特征+餘弦相似度/k-means聚類
Change win10 Screensaver
众昂矿业:萤石继续引领新能源市场增长
A need to review all the knowledge, H5 form is blocked by the keyboard, event agent, event delegation
MongoDB数据库基础知识整理
【搞船日记】【Shapr3D的STL格式转Gcode】
[deep learning] image hyperspectral experiment: srcnn/fsrcnn
Guangzhou Development Zone enables geographical indication products to help rural revitalization
What is data leakage
CTFshow,信息搜集:web2
【目标检测】YOLOv5跑通VOC2007数据集
leetcode 241. Different Ways to Add Parentheses 为运算表达式设计优先级(中等)
[quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
CTFshow,信息搜集:web12