当前位置:网站首页>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 .
边栏推荐
- [quick start of Digital IC Verification] 29. Ahb-sramc (9) (ahb-sramc svtb overview) of SystemVerilog project practice
- [quick start of Digital IC Verification] 18. Basic grammar of SystemVerilog learning 5 (concurrent threads... Including practical exercises)
- How to create Apple Developer personal account P8 certificate
- Steps to create P8 certificate and warehousing account
- Oracle控制文件丢失恢复归档模式方法
- Qu'est - ce qu'une violation de données
- Jacobo code coverage
- 【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
- Implementation of crawling web pages and saving them to MySQL using the scrapy framework
- [server data recovery] data recovery case of raid failure of a Dell server
猜你喜欢
CTFshow,信息搜集:web13
CTFshow,信息搜集:web12
简述keepalived工作原理
Win10 or win11 taskbar, automatically hidden and transparent
"Baidu Cup" CTF competition 2017 February, web:include
Super simple and fully automated generation super signature system (cloud Xiaoduo minclouds.com cloud service instance), free application in-house test app distribution and hosting platform, maintenan
众昂矿业:萤石继续引领新能源市场增长
Ctfshow, information collection: web13
MySQL bit type resolution
Ctfshow, information collection: web8
随机推荐
Stream learning notes
如何在opensea批量发布NFT(Rinkeby测试网)
STM32F103C8T6 PWM驱动舵机(SG90)
【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
微信小程序 01
使用Scrapy框架爬取网页并保存到Mysql的实现
Why do we use UTF-8 encoding?
【數字IC驗證快速入門】20、SystemVerilog學習之基本語法7(覆蓋率驅動...內含實踐練習)
连接ftp服务器教程
How to deploy the super signature distribution platform system?
Ctfshow, information collection: web6
Use cpolar to build a business website (2)
Ctfshow, information collection: web12
Change win10 Screensaver
【OBS】RTMPSockBuf_ Fill, remote host closed connection.
Ida Pro reverse tool finds the IP and port of the socket server
2. Basic knowledge of golang
[deep learning] semantic segmentation experiment: UNET network /msrc2 dataset
[quick start of Digital IC Verification] 22. Ahb-sramc of SystemVerilog project practice (2) (Introduction to AMBA bus)
Qu'est - ce qu'une violation de données