当前位置:网站首页>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 .
边栏推荐
- Integer learning
- [target detection] yolov5 Runtong voc2007 data set
- CTFshow,信息搜集:web12
- Ctfshow, information collection: web4
- TypeScript 发布 4.8 beta 版本
- [Data Mining] Visual Pattern Mining: Hog Feature + cosinus Similarity / K - means Clustering
- 【深度学习】图像超分实验:SRCNN/FSRCNN
- 【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
- Pit avoidance: description of null values in in and not in SQL
- Pat grade a 1103 integer factorizatio
猜你喜欢
【数字IC验证快速入门】23、SystemVerilog项目实践之AHB-SRAMC(3)(AHB协议基本要点)
使用cpolar建立一个商业网站(2)
CTFshow,信息搜集:web13
[quick start of Digital IC Verification] 20. Basic grammar of SystemVerilog learning 7 (coverage driven... Including practical exercises)
【数字IC验证快速入门】24、SystemVerilog项目实践之AHB-SRAMC(4)(AHB继续深入)
Configure mongodb database in window environment
全日制研究生和非全日制研究生的区别!
What is data leakage
15. Using the text editing tool VIM
Guangzhou Development Zone enables geographical indication products to help rural revitalization
随机推荐
【数字IC验证快速入门】25、SystemVerilog项目实践之AHB-SRAMC(5)(AHB 重点回顾,要点提炼)
CTFshow,信息搜集:web2
2022 all open source enterprise card issuing network repair short website and other bugs_ 2022 enterprise level multi merchant card issuing platform source code
HPDC smart base Talent Development Summit essay
leetcode 241. Different ways to add parentheses design priority for operational expressions (medium)
【数字IC验证快速入门】22、SystemVerilog项目实践之AHB-SRAMC(2)(AMBA总线介绍)
【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
【数字IC验证快速入门】20、SystemVerilog学习之基本语法7(覆盖率驱动...内含实践练习)
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
Stream learning notes
CTFshow,信息搜集:web3
Connecting FTP server tutorial
【OBS】RTMPSockBuf_Fill, remote host closed connection.
Briefly describe the working principle of kept
【数字IC验证快速入门】26、SystemVerilog项目实践之AHB-SRAMC(6)(APB协议基本要点)
【数字IC验证快速入门】29、SystemVerilog项目实践之AHB-SRAMC(9)(AHB-SRAMC SVTB Overview)
Change win10 Screensaver
Ctfshow, information collection: Web3
CTFshow,信息搜集:web4
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)