当前位置:网站首页>449-原码、补码、反码
449-原码、补码、反码
2022-07-02 00:23:00 【liufeng2023】
原码、补码、反码
- 计算机底层存储数据时使用的是二进制数字,但是计算机在存储一个数字时并不是直接存储该数字对应的二进制数字,而是存储该数字对应二进制数字的补码。
所以接下来我们需要来了解一下原码、反码和补码。
1、机器数
机器数:
- 一个数在计算机的存储形式是二进制数,我们称这些二进制数为机器数;
- 机器数是有符号,在计算机中用机器数的最高位存放符号位,0表示正数,1表示负数。
机器数的真值:
- 因为带有符号位,所以机器数的形式值不等于其真值;
- 以机器数1000 0111为例,其真正表示的值为-7,而形式值为135。
- 将带符号的机器数的真正表示的值称为机器数的真值。
2、原码
原码的表示与机器数真值表示的一样,即用第一位表示符号,其余位表示数值,例如的十进制的的正负1,用8位二进制的原码表示如下:
【+1】= 原:[ 0000 0001 ]
【-1】= 原:[ 1000 0001 ]
2、反码
反码的表示方法为:
- 正数</
边栏推荐
- leetcode96不同的二叉搜索樹
- Leetcode 96 différents arbres de recherche binaires
- 智能运维实战:银行业务流程及单笔交易追踪
- [template] adaptive Simpson integral
- Pytorch learning record
- 基于全志H3的QT5.12.9移植教程
- Leetcode96 different binary search trees
- 使用htaccess文件禁止目录里的脚本执行权限
- 在证券账户上买基金安全吗?哪里可以买基金
- Soft exam information system project manager_ Compiled abbreviations of the top ten management processes to help memory recitation - -- software test advanced information system project manager 054
猜你喜欢
Selectively inhibiting learning bias for active sampling
Openvino model performance evaluation tool DL workbench
Graduation season is both a farewell and a new beginning
SQL数据分析之流程控制语句【if,case...when详解】
Use es to realize epidemic map or take out order function (including code and data)
How to improve data quality
Key points of security agreement
智能运维实战:银行业务流程及单笔交易追踪
Heketi record
Difficult to get up syndrome (bit by bit greed)
随机推荐
智能运维实战:银行业务流程及单笔交易追踪
Multi table operation - one to one, one to many and many to many
[cmake] cmake configuration in QT Creator
Comprehensive usage and case questions of sub query of SQL data analysis [patient sorting]
Is it safe to buy funds in a securities account? Where can I buy funds
【QT】QtCreator卸载与安装(非正常状态)
时间复杂度与空间复杂度
ThreadLocal内存泄漏是什么,怎么解决
北京炒股开户选择手机办理安全吗?
【模板】自适应辛普森积分
PWN attack and defense world cgpwn2
leetcode96不同的二叉搜索樹
heketi 记录
What is the purpose of ERP project implementation plan?
Windows installation WSL (II)
What is ThreadLocal memory leak and how to solve it
【CTF】bjdctf_2020_babystack2
Halcon knowledge: an attempt of 3D reconstruction
攻防演练复盘
EMC circuit protection device for surge and impulse current protection