二进制文件签名

Prerequisite: Number systems

先决条件: 数字系统

Until now, we have only talked about positive numbers and have already discussed their mathematical operations. But there also exists negative numbers in the number system, in this article we are going to learn about how to represent negative numbers in the binary format?

到目前为止,我们仅讨论正数,并且已经讨论了它们的数学运算。 但是数字系统中也存在负数,在本文中,我们将学习如何用二进制格式表示负数?

签名号码 (Signed Numbers)

In decimal number system, we have (+) sign to represent the positive number and (-) sign to represent a negative number. But in digital logic, we have two symbols 0 and 1, so we use these symbols to represent the sign of the number.

在十进制数字系统中,我们用( + )号代表正数,用( - )号代表负数。 但是在数字逻辑中,我们有两个符号01 ,因此我们使用这些符号来表示数字的符号

There are two ways of representing signed numbers,

有两种表示带符号的数字的方式

  1. Signed Magnitude Form

    签名幅度表

  2. Complement Form

    补表

1)签署幅度表 (1) Signed Magnitude Form)

In signed magnitude form, an additional bit is placed to the extreme left (MSB) of the number to represent the sign; thus, it is known as the sign bit.

在带符号的幅度形式中,在数字的最左端(MSB)处放置一个附加位来表示符号。 因此,它被称为符号位。

We use 0 to represent the positive numbers and 1 to represent the negative numbers. The extra bit is isolated from the magnitude of binary numbers using a comma.

我们用0代表正数,用1代表负数。 使用逗号将多余的位与二进制数的大小隔离。

Under the signed-magnitude system, a great amount of manipulation is required to add a positive number to a negative number. Thus, representation is possible but still, it is impractical in nature.

在有符号幅度系统下,需要大量的操作才能将正数添加到负数。 因此,表示是可能的,但在本质上仍然是不切实际的。

Example1: Represent 13 and -13 in signed magnitude form

示例1:以带符号的幅度形式表示13和-13

Solution:

解:

     (13)10 = (0,1101)2   sign-bit 0 is used to represent the positive number
(-13)10 = (1,1101)2  sign-bit 1 is used to represent the negative number

Complement Form: Since performing arithmetic operations using a signed magnitude form is very complex. Digital computers use the complement form to perform these calculations.

补码形式:由于使用带符号的幅度形式执行算术运算非常复杂。 数字计算机使用补码形式来执行这些计算。

There are two complement forms - 1's complement form and 2's complement form.

有两种补码形式-1的补码形式和2的补码形式。

If the number is positive then, the magnitude is represented in its true binary form and a sign bit 0 is added to the LHS of the MSB. For a positive number, the representation is the same in signed magnitude, 1's and 2's complement form.

如果该数字为正,则以其真正的二进制形式表示幅度,并将符号位0添加到MSB的LHS。 对于正数,表示形式在带符号的幅度,1和2的补码形式上相同。

The advantage of using a complement form to perform arithmetic operations is the reduction in the hardware. Instead, of having separate hardware for addition and subtraction only additional adders are needed.

使用补码形式执行算术运算的优点是减少了硬件。 取而代之的是,没有用于加法和减法的单独硬件,仅需要附加的加法器。

1的补码表示 (1's Complement Representation)

The 1's complement of a number can be obtained by replacing each "0 bit with 1 bit" and "1 bit with 0 bit" in the binary number.

可以通过将二进制数中的每个“ 0位加1位”“ 1位加0位”替换来获得数字的1的补码。

Example: Represent (-15)10 in its 1's complement form

示例:以其1的补码形式表示(-15) 10

Solution:

解:

(15)10 in binary form can be represented as (1111)2.

(15) 10的二进制形式可以表示为(1111) 2

Now, to represent its negative sign, we will add a sign bit 1.

现在,为了表示它的负号,我们将添加一个符号位1。

Thus, (-15)10 = (1,1111)2. To represent it in 1's complement form, we will replace each 1 with 0 (excluding the sign bit, because if we replace sign bit then its sign will be changed to positive which is not correct). Therefore,

因此,(-15) 10 =(1,1111) 2 。 为了用1的补码形式表示它,我们将每个1替换为0(不包括符号位,因为如果替换符号位,则其符号将变为正数,这是不正确的)。 因此,

2的补码表示 (2's Complement Representation)

We can get the 2's complement of a number by finding the 1's complement of number and adding 1 to the LSB of the respective 1's complement.

我们可以通过找到数字的1的补码并将1加到相应的1的补码的LSB上来获得数字的2的补码。

Example: Represent (-15)10 in its 2's complement form.

示例:以2的补码形式表示(-15) 10

Solution:

解:

As we have discussed above, the 1's complement representation of (-15)10 is given as 10000. Now, we have to add a bit 1 to the LSB in the above 1's complement form i.e., we will get,

如上所述,(-15) 10的1的补码表示为10000 。 现在,我们必须以上述1的补码形式在LSB上加一位,即,

Which is the required 2's complement representation of (-15)10.

这是(-15) 10的必填2的补码表示形式。

Example: Represent (-51)10 in its signed magnitude, 1's complement and 2's complement form.

示例:以(-51) 10的有符号幅度,1的补码和2的补码形式表示。

Solution:

解:

翻译自: https://www.includehelp.com/basics/signed-representation-of-binary-numbers.aspx

二进制文件签名

二进制文件签名_二进制数的签名表示相关推荐

  1. 手机之家在线签名_手写签名在线生成器在线-手写签名在线生成器在线

    签名设计地址:www.mgs2s.com(复制到浏览器打开)工具集成签名设计免费版下载,签名设计免费版在线立即生成,简单简体签名设计免费版.最新方便设计公文签名设计颜色保存分享免费版 1.真笔网推出的 ...

  2. laya 怎么生成签名_手写签名在线生成器一笔签-手写签名在线生成器微信

    签名设计地址:www.mgs2s.com(复制到浏览器打开)工具集成签名设计免费版下载,签名设计免费版在线立即生成,简单简体签名设计免费版.最新方便设计公文签名设计颜色保存分享免费版 1.个别字体样式 ...

  3. 进程与服务的签名_苹果app签名需要注意哪几点

    现在部分的智能手机系统设备和工作一个应用软件,都需求证书的签名认证.未经任何签名的程序是不能在智能手机上设备和工作的.验证签名的底子进程则:智能手机操作系统或软件渠道对收到的原始数据选用相同的杂凑运算 ...

  4. 以下内容仅对你可见个性签名_微信个性签名居中以下内容仅对你可见

    我的青春路上少不了那一群疯子(签名类型:姐妹) 带着闺蜜闯天下(签名类型:姐妹) 明天上语文可以看他背书了(签名类型:心情) 爱过我就好. 我爱过就好.(签名类型:那些年) 今天没吃药 感觉自己萌萌哒 ...

  5. 苹果企业证书_IOS_苹果企业签名_企业签名的圈外证书 拒绝频繁掉签!

    IOS_苹果企业签名_企业签名的圈外证书 拒绝频繁掉签! 苹果企业签名目前分为:共享签名.独立签名.圈外签名,也有叫做普通签名.稳定签名.超稳签名,其实性质是一样的只是叫法上不同而已. 谈到企业签名大 ...

  6. 微信朋友圈营销如何做好头像_昵称_签名_背景基础设置?

    微信朋友圈营销如何做好头像_昵称_签名_背景基础设置? 微信作为营销推广的重要渠道,凭借其出色的私域属性.互动型受到了大家的广泛喜爱.有人做过一项调查,同样的卖货软文信息,在公众号转化率低于20%,可 ...

  7. java1.7 apk 签名_【keytool jarsigner工具的使用】Android 使用JDK1.7的工具 进行APK文件的签名,以及keystore文件的使用...

    你看到的这个文章来自于http://www.cnblogs.com/ayanmw 一个android apk的编译过程 请参考: http://www.2cto.com/kf/201312/26147 ...

  8. java1.7 apk 签名_【keytool jarsigner工具的使用】Android 使用JDK1.7的工具 进行APK文件的签名,以及keystore文件的使用...

    一个android apk的编译过程 请参考: http://www.2cto.com/kf/201312/261475.html 典型的编译过程: aapt( Android Asset Packa ...

  9. 手机之家在线签名_选择苹果企业签名的原因有哪些?

    ios开发者在没有苹果开发者账号的情况下,只能够选择苹果签名商进行代签名,但是市场上签名的种类在不断的上新,我们应该怎么进行选择呢? 微导流-苹果ios企业签名|TF签名|内测分发托管|免费APP封装 ...

最新文章

  1. Console-算法-一个偶数总能表示为两个素数之和
  2. kali2017添加国内更新源 + 配置并开启sshd
  3. UI   控件 —UITextFile
  4. 数据库的这些性能优化,你做了吗
  5. Android Service 生命周期
  6. iPhone Xs发布会其实是苹果计算机视觉技术发布会!
  7. mysql sql_log_bin怎么看_MySQL数据库之开启和查看mysql的bin-log日志
  8. Competitive Programming专题题解(1)
  9. 前端页面加载速度优化---Ngnix之GZIP压缩
  10. ts540服务器安装win7系统,解决本机不支持Win7系统安装问题[图文教程]
  11. 8086cpu 计算机,基于8086 CPU 的单芯片计算机系统的设计
  12. win10系统无法开启远程服务器配置,win10系统无法连接远程服务器的方案介绍...
  13. 秋天的第一杯奶茶,没喝到?那这个你绝对不能再错过
  14. BlendMask 论文学习
  15. vue下载后端返回的压缩包
  16. 腾讯地图Api 实现拾取坐标功能示例
  17. 电子发票全流程电子化管理指南-摘要
  18. 【原创】2009年太白山穿越
  19. tws真无线蓝牙耳机隐藏的冷知识
  20. 【软件工程实践】Hive研究-Blog5

热门文章

  1. java线程代码实现_Java 实现线程的2种方法的具体代码实例
  2. 微软MS11-050漏洞的利用
  3. 11. mysql锁机制_深入探讨MySQL锁机制
  4. java定义list_我的Java Web之路59 - Java中的泛型
  5. 深入理解DOM节点类型第六篇——特性节点Attribute
  6. 关于常用的编码工具如何引入jar包
  7. 洛谷 P3835: 【模板】可持久化平衡树
  8. Android Service、IntentService,Service和组件间通信
  9. django F和Q 关键字使用
  10. SCREEN屏幕编程时候必须保证SCREN中词典的字段格式必须和数据表中字段的类型长度一致!...