首页> 外国专利> Efficient handling due to the positive and negative of the overflow of hardware that occurs as a result of an arithmetic operation

Efficient handling due to the positive and negative of the overflow of hardware that occurs as a result of an arithmetic operation

机译:由于算术运算导致的硬件溢出的正面和负面影响,有效处理

摘要

A computer system provides handling of positive and negative overflow. A first arithmetic operation is performed on a first n-bit unsigned binary operand and a second n-bit signed binary operand to produce an n-bit unsigned binary result. Overflow detection logic circuitry (300,310,320,330) within the arithmetic logic unit (26) detects positive overflow or negative overflow resulting from the arithmetic operation. When there is a positive overflow, saturation logic (340,341,350,351) replaces the output of the two's complement adder (60,61,65,66,69) with a value of 2n-1. When there is a negative overflow, the saturation logic (340,341,350,351) replaces the output of the two's complement adder (60,61,65,66,69) with a value of 0. In the same embodiment, a second arithmetic operation is performed on two n-bit signed binary operands to produce an n-bit signed binary result. The arithmetic operation is for example an addition or subtraction performed by a two's complement adder (60,61,65,66,69). Overflow detection logic circuitry (300,310,320,330) within the arithmetic logic unit (26) detects positive overflow or negative overflow resulting from the arithmetic operation. When there is a positive overflow, saturation logic (340,341,350,351) replaces the output of the two's complement adder (60,61,65,66,69) with a value of 2n-1-1. When there is a negative overflow, the saturation logic (340,341,350,351) replaces the output of the two's complement adder (60,61,65,66,69) with a value of -2n-1. IMAGE
机译:计算机系统提供对正向和负向溢出的处理。对第一个n位无符号二进制操作数和第二个n位有符号二进制操作数执行第一算术运算,以产生n位无符号二进制结果。算术逻辑单元(26)内的溢出检测逻辑电路(300,310,320,330)检测由算术运算导致的正溢出或负溢出。当出现正溢出时,饱和逻辑(340,341,350,351)将2的补码加法器(60,61,65,66,69)的输出替换为2 n-1。当出现负溢出时,饱和逻辑(340,341,350,351)将值0替换为二进制补码加法器(60,61,65,66,69)的输出。在同一实施例中,对两个n位带符号的二进制操作数,以产生n位带符号的二进制结果。算术运算例如是由二进制补码加法器(60、61、65、66、69)执行的加法或减法。算术逻辑单元(26)内的溢出检测逻辑电路(300,310,320,330)检测由算术运算导致的正溢出或负溢出。当出现正溢出时,饱和逻辑(340,341,350,351)将2的补码加法器(60,61,65,66,69)的输出替换为2 n-1。当出现负溢出时,饱和逻辑(340,341,350,351)用值-2 代替二进制补码加法器(60,61,65,66,69)的输出。 <图像>

著录项

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号