关于二进制补码运算如何解决溢出问题探究.docVIP

  • 211
  • 0
  • 约3.13千字
  • 约 6页
  • 2017-06-07 发布于福建
  • 举报

关于二进制补码运算如何解决溢出问题探究.doc

关于二进制补码运算如何解决溢出问题探究

关于二进制补码运算如何解决溢出问题探究   摘要:计算机中用补码来表示和存储数值,而在进行数值的算术运算时由于机器字长的限制往往会出现补码溢出,导致计算结果错误。针对这个问题,提出了一种根据溢出结果得到正确结果的计算方法:两个正数相加溢出时,将错误解加上2n+1即为正确解;两个负数相加溢出时,将错误解减去2n+1即为正确解,并给出了一般性证明 关键词:二进制;有符号数;补码;溢出;求补运算 中图分类号:TP301 文献标识码:A 文章编号:1009-3044(2016)33-0208-02 Abstract:Complement is used to represent and store the value in computers.But the problem of complement overflow often happens in numerical arithmetic because of the limit of word length, which leads to calculation errors. To solve this problem, a new method is proposed to get the correct result according to the overflow result,in which the e

文档评论(0)

1亿VIP精品文档

相关文档