Efficient hardware handling of positive and negative overflow resulting from arithmetic operations
First Claim
1. A computing system comprising:
- first arithmetic operation means for performing a first arithmetic operation on a first n-bit unsigned binary operand and a second n-bit signed binary operand to produce an n-bit unsigned binary result;
first positive overflow means, coupled to the first arithmetic operation means, for assigning a value of 2n -1 to the n-bit unsigned binary result when there is a positive overflow; and
,first negative overflow means, coupled to the first arithmetic operation means, for assigning a value of 0 to the n-bit unsigned binary result when there is a negative overflow.
3 Assignments
0 Petitions
Accused Products
Abstract
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 within the arithmetic logic unit detects positive overflow or negative overflow resulting from the arithmetic operation. When there is a positive overflow, saturation logic replaces the output of the two'"'"'s complement adder with a value of 2n-1. When there is a negative overflow, the saturation logic replaces the output of the two'"'"'s complement adder with a value of 0. In an alternate embodiment, a first arithmetic operation is performed on a first n-bit signed binary operand and a second n-bit signed binary operand to produce an n-bit positive signed binary result. For example the arithmetic operation is an addition or subtraction performed by a two'"'"'s complement adder. In the alternate embodiment, overflow detection logic circuitry within the arithmetic logic unit detects positive overflow or negative overflow resulting from the arithmetic operation. When there is a positive overflow, saturation logic replaces the output of the two'"'"'s complement adder with a value of 2n-1 -1. When there is a negative overflow, the saturation logic replaces the output of the two'"'"'s complement adder with a value of 0.
76 Citations
27 Claims
-
1. A computing system comprising:
-
first arithmetic operation means for performing a first arithmetic operation on a first n-bit unsigned binary operand and a second n-bit signed binary operand to produce an n-bit unsigned binary result; first positive overflow means, coupled to the first arithmetic operation means, for assigning a value of 2n -1 to the n-bit unsigned binary result when there is a positive overflow; and
,first negative overflow means, coupled to the first arithmetic operation means, for assigning a value of 0 to the n-bit unsigned binary result when there is a negative overflow. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. A method within a computer implemented by hardware logic components, the method comprising the following steps:
-
(a) performing, within an arithmetic logic unit, a first arithmetic operation on a first n-bit unsigned binary operand and a second n-bit signed binary operand to produce an n-bit unsigned binary result; (b) checking to determine whether there is a positive overflow in the n-bit unsigned binary result; (c) when the check is step (b) determines there is a positive overflow, assigning a value of 2n -1 to the n-bit unsigned binary result; (d) checking to determine whether there is a negative overflow in the n-bit unsigned binary result; and
,(e) when the check is step (d) determines there is a negative overflow, assigning a value of 0 to the n-bit unsigned binary result. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22, 23, 24, 25)
-
-
26. A computing system comprising:
-
arithmetic operation means for performing a first arithmetic operation on a first n-bit signed binary operand and a second n-bit signed binary operand to produce an n-bit positive signed binary result; positive overflow means, coupled to the arithmetic operation means, for assigning a value of 2n-1 -1 to the n-bit positive signed binary result when a most significant bit of the first n-bit signed binary operand is equal to 0, a most significant bit of the second n-bit signed binary operand is equal to 0 and a most significant bit of the n-bit positive signed binary result is equal to 1; and
,negative overflow means, coupled to the arithmetic operation means, for assigning a value of 0 to the n-bit positive signed binary result when the most significant bit of the n-bit positive signed binary result is equal to 1 and one of either the most significant bit of the first n-bit signed binary operand or the most significant bit of the second n-bit signed binary operand is equal to 1 and for assigning a value of 0 to the n-bit positive signed binary result when the most significant bit of both the most significant bit of the first n-bit signed binary operand and the most significant bit of the second n-bit signed binary operand are equal to 1.
-
-
27. A method within a computer implemented by hardware logic components, the method comprising the following steps:
-
(a) performing, within an arithmetic logic unit, a first arithmetic operation on a first n-bit signed binary operand and a second n-bit signed binary operand to produce an n-bit positive signed binary result; (b) determining whether a most significant bit of the first n-bit signed binary operand is equal to 0, a most significant bit of the second n-bit signed binary operand is equal to 0 and a most significant bit of the n-bit positive signed binary result is equal to 1 indicating there is a positive overflow in the n-bit positive signed binary result; (c) when the check is step (b) indicates there is a positive overflow, assigning a value of 2n-1 -1 to the n-bit positive signed binary result; (d) determining there is a negative overflow in the n-bit positive signed binary result when the most significant bit of the n-bit positive signed binary result is equal to 1 and one of either the most significant bit of the first n-bit signed binary operand or the most significant bit of the second n-bit signed binary operand is equal to 1 and determining there is a negative overflow when both the most significant bit of the first n-bit signed binary operand and the most significant bit of the second n-bit signed binary operand are equal to 1; and
,(e) when the check is step (d) determines there is a negative overflow, assigning a value of 0 to the n-bit positive signed binary result.
-
Specification