当前位置:网站首页>[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
边栏推荐
- jupyter更改主界面并且导入数据集
- 【软件开发规范三】【软件版本命名规范】
- 爬虫小操作
- 【RTOS训练营】课程学习方法和结构体知识复习 + 链表知识
- Small sample learning data set
- 腾讯员工晒出薪资:真实985毕业薪资,大家看我还有救吗?网友:日薪?
- C language_ The use and implementation of string comparison function StrCmp
- How can a team making facial mask achieve a revenue of more than 1 million a day?
- Set set learning
- What is the dynamic IP address? Why do you recommend dynamic IP proxy?
猜你喜欢

web中间件日志分析脚本3.0(shell脚本)

Small sample learning - getting started

【ctf】Crypto初步基础概要

985高校副教授晒年薪,公积金顶普通人月薪,网友:不愧是在上海

Win11打不开自带杀毒软件怎么办?win11自带杀毒功能打不开

1.30 upgrade bin file, add suffix and file length

Save unhappiness! My robot psychologist; KPI tracking of machine learning; Pytorch implementation of Yolo V7; Li Hang's new book "machine learning methods" open trial | showmeai Information Daily

【RTOS训练营】任务调度(续)、任务礼让、调度总结、队列和晚课提问
![[install software after computer reset] software that can search all files of the computer, the best screenshot software in the world, free music player, JDK installation, MySQL installation, installa](/img/d6/45f17c50f13d0bae1d14b317f9ae30.png)
[install software after computer reset] software that can search all files of the computer, the best screenshot software in the world, free music player, JDK installation, MySQL installation, installa
![[RTOS training camp] operation explanation, queue and ring buffer, queue - transmission data, queue - synchronization tasks and evening class questions](/img/59/0b671129e8cfaed28e2fe484ae0467.jpg)
[RTOS training camp] operation explanation, queue and ring buffer, queue - transmission data, queue - synchronization tasks and evening class questions
随机推荐
200 yuan a hair dryer, only a week, to achieve 2million?
Save unhappiness! My robot psychologist; KPI tracking of machine learning; Pytorch implementation of Yolo V7; Li Hang's new book "machine learning methods" open trial | showmeai Information Daily
It will be easier to implement MES system by doing well in these four stages
How to choose social e-commerce model in the early stage? Taishan crowdfunding
Four common simple and effective methods for changing IP addresses
[install software after computer reset] software that can search all files of the computer, the best screenshot software in the world, free music player, JDK installation, MySQL installation, installa
Unity get the animation being played
全国一半人跑长沙,长沙一半人跑哪?
如何mysql只要重复数据?
jupyter更改默认浏览器的方法
Unityvr -- robot arm scene 4- gifts and Christmas tree
What is the dynamic IP address? Why do you recommend dynamic IP proxy?
【RTOS训练营】站在更高的角度学习C语言
Download exclusively | Alibaba cloud maxcompute questions and answers to unlock SaaS mode cloud data warehouse in this electronic manual!
El table scroll bar settings
什么是信息化?什么是数字化?这两者有什么联系和区别?
[Code] refers to the repeated number in the offer 03 array
LVGL官方+100ASK合力打造的中文输入(拼音输入法)组件,让LVGL支持中文输入!
Diablo: immortality mobile game how to open more brick moving and novice introduction brick moving strategy
Microwave oven rectifier diode cl01-12