IP Library › Granted Patent US 7,689,640
Granted Patent B2
US 7,689,640 · App. 11/146,253 · Granted Mar 30, 2010

Method and apparatus for formatting numbers in microprocessors

Assignee: Atmel Corporation
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 7,689,640
App. No.
11/146,253
Filed
Jun 6, 2005
Granted
Mar 30, 2010
Kind
B2
Art Unit
2193
USPC
708/104
Abstract

An apparatus for scaling numbers comprises register means for storing an operand to be scaled, bit shifting means for performing a right shift operation on the operand, rounding means, and decision means to test for the existence of at least one of an overflow and an underflow condition.

Claims (65)

1. A method for providing a number formatting operation on an operand to produce a result value in a microprocessor, the method comprising:

performing a right shift operation on the operand by a shift amount, the shift amount comprising zero or more bit positions, to produce a shifted result;

computing a rounding value on the basis of the shift amount and a most significant bit shifted out of the operand, the method of computing the rounding value further comprising setting the rounding value to one if the shift amount is not equal to zero and the most significant bit shifted out of the operand is equal to one, and setting the rounding value to zero if either of the shift amount and the most significant bit shifted out of the operand equals zero;

setting a rounded result value equal to a sum of the rounding value and the shifted result;

computing a decremented bit number value by subtracting a value of one from a bit number;

computing a masking value equal to one less than a power of two raised to an exponent equal to the bit number;

computing a mask application result value on the basis of a signed number flag bit value and a bit position of the rounded result value, the bit position corresponding to the decremented bit number value, the method of computing the mask application result value further comprising:

if the signed number flag is zero, setting the mask application result value equal to a bitwise “and” operation on the rounded result and the masking value;

if the signed number flag is one and the bit position of the rounded result value corresponding to the decremented bit number value is a one, setting the mask application result value equal to a bitwise “or” operation on the rounded result and a bitwise inversion of the masking value; and

if the signed number flag is one and the bit position of the rounded result value corresponding to the decremented bit number value is a zero, setting the mask application result equal value to a bitwise “and” operation on the rounded result and the masking value;

computing a saturated result value on the basis of the signed number flag bit value and a most significant bit position of the rounded result value, computing the saturated result value further comprising:

if the signed number flag is equal to zero and the most significant bit position of the rounded result value is equal to one, setting the saturated result value equal to zero;

if the signed number flag bit value is equal to zero and the most significant bit position of the rounded result value is equal to zero, setting the saturated result value equal to the masking value; and

if the signed number flag bit value is equal to one and the most significant bit position of the rounded result value is equal to one, setting the saturated result value equal to a bitwise inversion of a concatenation of a 1-bit zero and a portion of the masking value excluding a least significant bit of the masking value;

if the signed number flag bit value is equal to one and the most significant bit position of the rounded result value is not equal to one, setting the saturated result value equal to the concatenation of the 1-bit zero and the portion of the masking value excluding the least significant bit of the masking value; and

selecting the result value for the formatted operand, selecting further comprising:

if the mask application result value and the rounding result value are equal, setting the result value for the formatted operand equal to the rounding result value;

if the bit number is equal to zero, setting the result value for the formatted operand equal to the rounding result value; and

if the mask application result value and the rounding result value are not equal and the bit number is not equal to zero, setting the result value for the formatted operand equal to the saturated result value.

2. An apparatus comprising:

an arithmetic shift register comprising an operand input coupled to receive an operand, a shift amount input coupled to receive a shift amount, a shifter result output configured to provide a shifted result and a rounding value output configured to provide a rounding value, the arithmetic shift register further configured to shift the operand input by the shift amount, giving the shifted result, the arithmetic shift register further configured to compute the rounding value by one of setting the rounding value equal to a most significant bit shifted out of the operand input and by setting the rounding value equal to zero;

an adder having a first adder input coupled to the shifter result output and a second adder input coupled to the rounding value output, the adder having a rounded result output configured to provide a rounded result, the rounded result being computed by summing the shifted result and the rounding value;

a subtract block comprising a bit number input coupled to receive a bit number and a decremented bit number output configured to provide a decremented bit number, the subtract block configured to subtract a value of one from the bit number to produce the decremented bit number, the decremented bit number output coupled to a result masking block, the result masking block comprising a first masking block input coupled to the rounded result output configured to provide the rounded result, a second masking block input coupled to receive a signed number bit, a third masking block input coupled to the mask value output, and a fourth masking block input coupled to the decremented bit number output, the result masking block further having a masked result output configured to provide a masked result value, the masked result value being equal to one of a bitwise “and” operation performed on the rounded result and the mask value, and a bitwise “or” operation performed on the rounded result and bitwise inversion of the mask value;

a mask generator block comprising a mask generator input coupled to receive the bit number and coupled to the subtract block bit number input, the mask generator block further having a mask value output configured to provide a mask value, the mask value being computed by subtracting a value of one from a power of two raised to an exponent equal to the bit number;

a saturate logic block comprising a first saturate input coupled to the rounded result output, a second saturate input coupled to receive the signed number bit and coupled to the second masking block input, a third saturate input coupled to the mask value output, and a saturated result output configured to provide a saturated result, the saturated result being equal to one of zero, the mask value, a bitwise inversion of a concatenation of a 1-bit zero and a portion of the mask value excluding a least significant bit of the mask value, and the concatenation of the 1-bit zero and the portion of the mask value excluding the least significant bit of the mask value;

a comparator comprising a first comparator input coupled to the rounded result output, a second comparator input coupled to the masked result output, and a third comparator input coupled to receive the bit number and coupled to the mask generator input and to the bit number subtract block bit number input, the comparator further having a comparator output configured to provide an eq value, the eq value being set to a value of one when the masked result value is equal to the rounded result, the eq value further being set to a

value of one when the bit number is equal to zero, the eq value otherwise being set to a value of zero;

an output multiplexer having a first multiplexer input coupled to the rounded result output, a second multiplexer input coupled to the saturated result output, and a control input coupled to receive the value eq coupled to the comparator output, the output multiplexer further having a formatted result output configured to provide a value res, the output multiplexer configured to couple the rounded result output to the formatted result output when the value eq is equal to one, and further configured to couple the saturated result output to the formatted result output when the value eq is equal to zero.

3. A method to produce a value in a microprocessor, the method comprising:

performing a right shift operation on an operand by a shift amount to produce a shifted result, the shift amount being zero or more bit positions;

setting a rounding value to one if the shift amount is not equal to zero and a most significant bit shifted out of the operand is equal to one;

setting the rounding value to zero if either one of the shift amount and the most significant bit shifted out of the operand equals zero; and

setting a rounded result value equal to a sum of the rounding value and the shifted result;

computing a decremented bit number value by subtracting a value of one from a bit number;

computing a masking value equal to one less than a power of two raised to an exponent equal to the bit number;

computing a mask application result value based on a signed number flag bit value and a bit position of the rounded result value corresponding to the decremented bit number value including:

if the signed number flag is zero, setting the mask application result value equal to a bitwise “and” operation on the rounded result and the masking value;

if the signed number flag is one and the bit position of the rounded result value corresponding to the decremented bit number value is a one, setting the mask application result value equal to a bitwise “or” operation on the rounded result and a bitwise inversion of the masking value; and

if the signed number flag is one and the bit position of the rounded result value corresponding to the decremented bit number value is a zero, setting the mask application result equal value to a bitwise “and” operation on the rounded result and the masking value;

computing a saturated result value based on the signed number flag bit value and a most significant bit position of the rounded result value including:

if the signed number flag is equal to zero and the most significant bit position of the rounded result value is equal to one, setting the saturated result value equal to zero;

if the signed number flag bit value is equal to zero and the most significant bit position of the rounded result value is equal to zero, setting the saturated result value equal to the masking value;

if the signed number flag bit value is equal to one and the most significant bit position of the rounded result value is equal to one, setting the saturated result value equal to a bitwise inversion of a concatenation of a 1-bit zero and a portion of the masking value excluding a least significant bit of the masking value; and

if the signed number flag bit value is equal to one and the most significant bit position of the rounded result value is not equal to one, setting the saturated result value equal to the concatenation of the 1-bit zero and the portion of the masking value excluding the least significant bit of the masking value; and

selecting a result value for a formatted operand including:

if the mask application result value and the rounding result value are equal, setting the result value for the formatted operand equal to the rounding result value;

if the bit number is equal to zero, setting the result value for the formatted operand equal to the rounding result value; and

if the mask application result value and the rounding result value are not equal and the bit number is not equal to zero, setting the result value for the formatted operand equal to the saturated result value.

4. The method of claim 3 , further comprising loading the operand into a register before performing the right shift operation on the operand.

5. The method of claim 3 , wherein performing a right shift operation includes performing a right shift operation on a signed operand.

6. An apparatus comprising:

an arithmetic shift register including:

an operand input coupled to receive an operand;

a shift amount input coupled to receive a shift amount;

a shifter result output configured to generate a shifted result; and

a rounding value output configured to generate a rounding value;

wherein the arithmetic shift register is configured to:

shift the operand by the shift amount to generate the shifted result; and

compute the rounding value by one of setting the rounding value equal to a most significant bit shifted out of the operand input and by setting the rounding value equal to zero;

an adder having a first adder input coupled to the shifter result output and a second adder input coupled to the rounding value output, the adder having a rounded result output configured to provide a rounded result, the rounded result being computed by summing the shifted result and the rounding value;

a subtract block including a bit number input coupled to receive a bit number and a decremented bit number output configured to provide a decremented bit number, the subtract block configured to subtract a value of one from the bit number to produce the decremented bit number, the decremented bit number output coupled to a result masking block, the result masking block including a first masking block input coupled to the rounded result output configured to provide the rounded result, a second masking block input coupled to receive a signed number bit, a third masking block input coupled to the mask value output, and a fourth masking block input coupled to the decremented bit number output, the result masking block further having a masked result output configured to provide a masked result value, the masked result value being equal to one of a bitwise “and” operation performed on the rounded result and the mask value, and a bitwise “or” operation performed on the rounded result and bitwise inversion of the mask value;

a mask generator block including a mask generator input coupled to receive the bit number and coupled to the subtract block bit number input, the mask generator block further having a mask value output configured to provide a mask value, the mask value being computed by subtracting a value of one from a power of two raised to an exponent equal to the bit number;

a saturate logic block including a first saturate input coupled to the rounded result output, a second saturate input coupled to receive the signed number bit and coupled to the second masking block input, a third saturate input coupled to the mask value output, and a saturated result output configured to provide a saturated result, the saturated result being equal to one of zero, the mask value, a bitwise inversion of a concatenation of a 1-bit zero and a portion of the mask value excluding a least significant bit of the mask value, and the concatenation of the 1-bit zero and the portion of the mask value excluding the least significant bit of the mask value;

a comparator including a first comparator input coupled to the rounded result output, a second comparator input coupled to the masked result output, and a third comparator input coupled to receive the bit number and coupled to the mask generator input and to the bit number subtract block bit number input, the comparator further having a comparator output configured to provide an eq value, the eq value being set to a value of one when the masked result value is equal to the rounded result, the eq value further being set to a value of one when the bit number is equal to zero, the eq value otherwise being set to a value of zero; and

an output multiplexer having a first multiplexer input coupled to the rounded result output, a second multiplexer input coupled to the saturated result output, and a control input coupled to receive the value eq coupled to the comparator output, the output multiplexer further having a formatted result output configured to provide a value res, the output multiplexer configured to couple the rounded result output to the formatted result output when the value eq is equal to one, and further configured to couple the saturated result output to the formatted result output when the value eq is equal to zero.

Assignments (17)
RELEASE OF SECURITY INTEREST Recorded Mar 14, 2022
From: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
To: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 060894/0437 →
RELEASE OF SECURITY INTEREST Recorded Mar 11, 2022
From: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
To: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 059363/0001 →
RELEASE OF SECURITY INTEREST Recorded Mar 10, 2022
From: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
To: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 059863/0400 →
RELEASE OF SECURITY INTEREST Recorded Mar 9, 2022
From: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
To: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 059358/0001 →
RELEASE OF SECURITY INTEREST Recorded Feb 28, 2022
From: JPMORGAN CHASE BANK, N.A., AS ADMINISTRATIVE AGENT
To: ATMEL CORPORATION
Reel/Frame 059262/0105 →
RELEASE OF SECURITY INTEREST Recorded Feb 25, 2022
From: JPMORGAN CHASE BANK, N.A., AS ADMINISTRATIVE AGENT
To: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 059333/0222 →
SECURITY INTEREST Recorded Jun 4, 2021
From: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
Reel/Frame 057935/0474 →
SECURITY INTEREST Recorded Dec 24, 2020
From: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS COLLATERAL AGENT
Reel/Frame 055671/0612 →
SECURITY INTEREST Recorded Jun 5, 2020
From: MICROCHIP TECHNOLOGY INC.; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: WELLS FARGO BANK, NATIONAL ASSOCIATION
Reel/Frame 053468/0705 →
RELEASE OF SECURITY INTEREST Recorded May 30, 2020
From: JPMORGAN CHASE BANK, N.A, AS ADMINISTRATIVE AGENT
To: MICROCHIP TECHNOLOGY INC.; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
Reel/Frame 053466/0011 →
SECURITY INTEREST Recorded Apr 24, 2020
From: MICROCHIP TECHNOLOGY INC.; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: JPMORGAN CHASE BANK, N.A., AS ADMINISTRATIVE AGENT
Reel/Frame 053311/0305 →
SECURITY INTEREST Recorded Sep 18, 2018
From: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: WELLS FARGO BANK, NATIONAL ASSOCIATION, AS NOTES COLLATERAL AGENT
Reel/Frame 047103/0206 →
SECURITY INTEREST Recorded Jun 25, 2018
From: MICROCHIP TECHNOLOGY INCORPORATED; SILICON STORAGE TECHNOLOGY, INC.; ATMEL CORPORATION; MICROSEMI CORPORATION; MICROSEMI STORAGE SOLUTIONS, INC.
To: JPMORGAN CHASE BANK, N.A., AS ADMINISTRATIVE AGENT
Reel/Frame 046426/0001 →
SECURITY INTEREST Recorded Feb 10, 2017
From: ATMEL CORPORATION
To: JPMORGAN CHASE BANK, N.A., AS ADMINISTRATIVE AGENT
Reel/Frame 041715/0747 →
TERMINATION AND RELEASE OF SECURITY INTEREST IN PATENT COLLATERAL Recorded Apr 7, 2016
From: MORGAN STANLEY SENIOR FUNDING, INC.
To: ATMEL CORPORATION
Reel/Frame 038376/0001 →
PATENT SECURITY AGREEMENT Recorded Jan 3, 2014
From: ATMEL CORPORATION
To: MORGAN STANLEY SENIOR FUNDING, INC. AS ADMINISTRATIVE AGENT
Reel/Frame 031912/0173 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 12, 2005
From: RENNO, ERIK K.; PEDERSEN, RONNY; STROM, OYVIND
To: ATMEL CORPORATION
Reel/Frame 016968/0742 →
Continuity (1)
Related Publication 20060277244A1 · Dec 7, 2006