IP Library Granted Patent US 8,539,015
Granted Patent B2
US 8,539,015 · App. 12/235,213 · Granted Sep 17, 2013

Performing a binary coded decimal (BCD) calculation

Inventor: Cyrille De Brebisson (Boise, ID)
Assignee: Hewlett-Packard Development Company, L.P.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,539,015
App. No.
12/235,213
Filed
Sep 22, 2008
Granted
Sep 17, 2013
Kind
B2
Art Unit
2193
USPC
708/490
Abstract

To perform a binary-coded decimal (BCD) calculation, a processor receives values on which the BCD calculation is to be performed. A carry resulting from the BCD calculation is stored in a flag register of the processor, and the carry stored in the flag register is used to compute a result of the BCD calculation.

Claims (44)

1. A method of performing a binary-coded decimal (BCD) addition, comprising:

receiving, in a processor, first and second values on which the BCD addition is to be performed;

adding the first value to a sequence of constant digits to produce a modified first value;

adding the modified first value and the second value to produce a sum having BCD digits;

determining which of the BCD digits of the sum is not associated with a carry, wherein the determining comprises performing an operation on the modified first value, the second value, and the sum, and using a result of the operation to identify which of the BCD digits of the sum is not associated with a carry;

storing a carry resulting from the adding of the modified first value and the second value in a flag register of the processor, where the carry stored in the flag register is a value to be transferred to a next most significant BCD digit;

using the carry stored in the flag register to compute a result of the BCD addition; and

subtracting corresponding constant digits from BCD digits of the result of the BCD addition for those BCD digits of the result that are not associated with a carry as identified by the determining.

2. The method of claim 1 , wherein storing the carry in the flag register comprises maintaining the carry in the flag register as the processor performs various instructions in performing the BCD addition, wherein the maintained carry is made available to compute the result of the BCD addition.

3. The method of claim 1 , wherein storing the carry in the flag register comprises storing the carry in the flag register of a register set of the processor.

4. The method of claim 3 , wherein storing the carry in the flag register of the register set of the processor comprises storing the carry in the flag register of the register of an ARM processor.

5. The method of claim 1 , further comprising invoking instructions to perform the BCD addition, wherein the instructions are instructions specifying that any carry from the BCD addition is stored in the flag register.

6. The method of claim 1 , wherein performing the operation comprises performing an exclusive-OR operation.

7. A processor comprising:

a flag register; and

a processing core to:

receive first and second operands for a binary-coded decimal (BCD) addition, the first and second operands having corresponding BCD digits;

add the first operand with a sequence of constant digits to produce a modified first operand;

add the modified first operand and the second operand to produce a sum having BCD digits;

determine which of the BCD digits of the sum is not associated with a carry, wherein the determining comprises performing an operation on the modified first operand, the second operand, and the sum, and using a result of the operation to identify which of the BCD digits of the sum is not associated with a carry;

store a carry resulting from the adding of the modified first operand and the second operand in the flag register, where the carry stored in the flag register is a value to be transferred to a next most significant BCD digit; and

use the carry stored in the flag register to compute a result of the BCD addition; and

subtract corresponding constant digits from BCD digits of the result of the BCD addition for those BCD digits of the result that are not associated with a carry as identified by the determining.

8. The processor of claim 7 , wherein the processing core is enabled to maintain the carry in the flag register as the processor core performs various instructions in performing the BCD addition.

9. The processor of claim 7 , wherein performing the operation comprises performing an exclusive-OR operation.

10. An article comprising at least one non-transitory processor-readable storage medium containing instructions that when executed cause a processor to:

receive first and second operands on which a binary-coded decimal (BCD) addition is to be performed, the first and second operands having corresponding BCD digits;

add the first operand with a sequence of constant digits to produce a modified first operand;

add the modified first operand and the second operand to produce a sum having BCD digits;

determine which of the BCD digits of the sum is not associated with a carry, wherein the determining comprises performing an operation on the modified first operand, the second operand, and the sum, and using a result of the operation to identify which of the BCD digits of the sum is not associated with a carry;

store a carry resulting from the adding of the modified first operand and the second operand in a flag register of the processor, where the carry stored in the flag register is a value to be transferred to a next most significant BCD digit;

use the carry stored in the flag register to compute a result of the BCD addition; and

subtract corresponding constant digits from BCD digits of the result of the BCD addition for those BCD digits of the result that are not associated with a carry as identified by the determining.

11. The article of claim 10 , wherein performing the operation comprises performing an exclusive-OR operation.

12. An article comprising at least one non-transitory processor-readable storage medium containing instructions that when executed cause a processor to:

receive operands on which a binary-coded decimal (BCD) addition is to be performed, the operands having corresponding BCD digits;

pre-adjust one of the operands by adding predefined constant values;

add the pre-adjusted operand and at least another of the operands as part of the BCD addition;

store a carry resulting from the BCD addition in a flag register of the processor, where the carry is a value to be transferred to a next most significant BCD digit;

use the carry stored in the flag register to compute a result of the BCD addition,

subsequently determine which of BCD digits of the result of the BCD addition are not associated with a carry, wherein the determining comprises performing an operation on the pre-adjusted operand, the at least another operand, and a sum of the pre-adjusted operand and the at least another operand, and using a result of the operation to identify which of the BCD digits of the result of the BCD addition is not associated with a carry; and

for those BCD digits of the result of the BCD addition not associated with a carry as identified by the determining, subtract the predefined constant values from those BCD digits.

13. The method of claim 1 , wherein the carry stored in the flag register is to be transferred to the next most significant BCD digit due to a sum of less significant digits of the modified first value and the second value exceeding a value of nine.

14. The article of claim 10 , wherein the carry stored in the flag register is to be transferred to the next most significant BCD digit due to a sum of less significant digits of the modified first operand and the second operand exceeding a value of nine.

Assignments (5)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 28, 2014
From: HEWLETT-PACKARD COMPANY; HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.; PALM, INC.
To: QUALCOMM INCORPORATED
Reel/Frame 032132/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2013
From: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
To: PALM, INC.
Reel/Frame 031837/0544 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2013
From: PALM, INC.
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 031837/0239 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 18, 2013
From: PALM, INC.
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 031837/0659 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 14, 2013
From: DE BREBISSON, CYRILLE
To: HEWLETT-PACKARD DEVELOPMENT COMPANY, L.P.
Reel/Frame 031008/0621 →
Continuity (2)
Provisional Application 61085459 · Aug 1, 2008
Related Publication 20100030834A1 · Feb 4, 2010