当前位置:网站首页>[secsha concept] original reverse supplement
[secsha concept] original reverse supplement
2022-07-26 01:07:00 【Pink ink white Ling】
Catalog
Seckill concept , Programming is so simple ! Click to subscribe !
Positive numbers
A positive number 、 back 、 The complement is the same
negative
Original code
Directly translate numbers into binary in the form of positive and negative numbers
Inverse code
Change the sign bit of the original code , The other bits can be inverted in turn
Complement code
Inverse code +1 You get the complement
For plastic surgery : The form of data in memory is actually complement
In computer system , Integer type value Always use complement to represent and store
Because subtraction can be achieved by adding complements , therefore CPU There is no need to implement a subtracter , Reduced hardware costs
and The complement of the complement is the original code , therefore CPU You only need to implement the complement and adder to realize the addition, subtraction, multiplication and division of integers
Multiplication is adding more times , Division is to subtract several times , When you want to output a negative number, turn the complement in memory into the source code and then output
Subtraction example :
1 - 1 = 1 + (-1)because int The size of the type is 8 Bytes ,1 Bytes 8 A bit , So there is 32 A bit
1 :
1 The source code of is
0000 0000 0000 0000 0000 0000 0000 0001
1 The inverse of is
0000 0000 0000 0000 0000 0000 0000 0001
1 The complement of is
0000 0000 0000 0000 0000 0000 0000 0001
-1:
-1 The source code of is
1000 0000 0000 0000 0000 0000 0000 0001
-1 The inverse of is
1111 1111 1111 1111 1111 1111 1111 1110
-1 The complement of is
1111 1111 1111 1111 1111 1111 1111 1111
Complement addition equals
(1) 0000 0000 0000 0000 0000 0000 0000 0000
In the front brackets 1 Beyond the 4 Bytes 32 A bit , So it was lost , therefore 1 + (-1) As the result of the 0
边栏推荐
- typing‘ has no attribute ‘_ SpecialForm‘
- Docker高级篇-Mysql主从复制
- It will be easier to implement MES system by doing well in these four stages
- MMOCR使用指南
- Upload local file trial version using SAP ui5 fileuploader control
- 如何才能修炼成一名不可替代的程序员?
- How to switch IP and move bricks with mobile game simulator
- 手游多开用模拟器多开游戏如何切换IP搬砖
- jupyter更改主界面并且导入数据集
- Detailed explanation of at and crontab commands of RHCE and deployment of Chrony
猜你喜欢

腾讯员工晒出薪资:真实985毕业薪资,大家看我还有救吗?网友:日薪?

Microwave oven rectifier diode cl01-12

全国一半人跑长沙,长沙一半人跑哪?

游戏思考17:寻路引擎recast和detour学习二:recast导航网格生成流程及局限性

Half of the people in the country run in Changsha. Where do half of the people in Changsha run?

【RTOS训练营】继续程序框架、tick中断补充、预习、课后作业和晚课提问

Set set learning

【RTOS训练营】课程学习方法和结构体知识复习 + 链表知识

Lock upgrade: no lock, bias lock, lightweight lock, heavyweight lock

Detailed explanation of at and crontab commands of RHCE and deployment of Chrony
随机推荐
MMOCR使用指南
How to switch IP and move bricks with mobile game simulator
[RTOS training camp] ring buffer, at instruction, preview arrangement and evening class questions
What is the dynamic IP address? Why do you recommend dynamic IP proxy?
Test the concept of left shift and right shift
Open download! Alibaba Devops Practice Manual
ZABBIX monitoring host and resource alarm
It will be easier to implement MES system by doing well in these four stages
The bumpy road of referencing jar package json-path.jar in jmeter/idea
How accurate is the IP address? What are dynamic IP and static IP? The most common method of switching IP
腾讯员工晒出薪资:真实985毕业薪资,大家看我还有救吗?网友:日薪?
The Chinese input (Pinyin input method) component created by lvgl official +100ask enables lvgl to support Chinese input!
[RTOS training camp] GPIO knowledge and preview arrangement + evening class questions
【软件开发规范四】《应用系统安全编码规范》
Nanjie's embarrassment
手游多开用模拟器多开游戏如何切换IP搬砖
【秒杀概念】原反补
【Code】剑指offer 03数组中重复的数字
[CTF] crypto preliminary basic outline
# 浏览器开发使用技巧