IP Library Granted Patent US 8,972,472
Granted Patent B2
US 8,972,472 · App. 12/595,961 · Granted Mar 3, 2015

Apparatus and methods for hardware-efficient unbiased rounding

Inventors: Ofir Avraham Kanter (Yoqneam, IL); Ilan Bar (Kiryat Motzkin, IL)
Assignee: Densbits Technologies Ltd.
G06F7/49963
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,972,472
App. No.
12/595,961
Granted
Mar 3, 2015
Kind
B2
Abstract

A system and method for unbiased rounding away from, or toward, zero by truncating N bits from a M bit input number to provide a M−N bit number, and adding the equivalent value of ‘½’ to the M−N bit number unless the input number is negative, or positive, respectively, and the N truncated bits represent exactly ½. The method for rounding away from zero may include outputting a (M−N) bit truncated number if the M-bit input number is negative and the sequence of N truncated bits comprises a most significant bit of 1, followed by zeros; and otherwise, computing and outputting a sum of (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical operation on the most significant bit of the sequence of truncated bits and (b) the (M−N) bit truncated number.

Claims (14)

1. A method for rounding two's complement represented signed numbers away from zero, the method comprising: providing an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; truncating N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; if the M-bit two's complement represented signed number is negative and the sequence of N truncated bits comprises a most significant bit of 1 , followed by zeros, outputting the (M−N) bit truncated number; and otherwise, computing and outputting a sum of (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical operation on the most significant bit of the sequence of truncated bits and (b) the (M−N) bit truncated number; rounding two's complement represented signed numbers away from zero by a circuit that essentially consists of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate, an inverter; wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate; wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

2. The method according to claim 1 and also comprising providing special treatment for a largest positive number, represented by a ‘0’, followed by M−1 replicas of ‘1’, to prevent said largest positive number from wrapping around zero and rounding toward a lowest negative number.

3. The method according to claim 2 comprising checking if the M-bit two's compliment represented signed number is the largest positive number by the (M−N) input NAND gate.

4. A method for rounding two's complement represented signed numbers toward zero, the method comprising: providing an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; truncating N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; if the M-bit two's complement represented signed number is positive and the sequence of N truncated bits comprises a most significant bit of 1, followed by zeros, outputting the (M−N) bit truncated number; and otherwise, computing and outputting a sum of (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical function on the most significant bit of said sequence of truncated bits and (b) the (M−N) bit truncated number; rounding two's complement represented signed numbers towards zero by a circuit that essentially consists of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate, an inverter; wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate; wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

5. A method according to claim 4 and also comprising providing special treatment for a largest positive number, represented by a ‘0’, followed by M−1 replicas of ‘1’, to prevent said largest positive number from wrapping around zero and rounding toward a lowest negative number.

6. A system for rounding two's complement represented signed numbers away from zero, the system comprising: a receiver operative to receive an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; a truncator operative to truncate N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; a clipped and a selector operative, if the M-bit two's complement represented signed number is negative and the sequence of N truncated bits comprises a most significant bit of 1, followed by zeros, to output said (M−N) bit truncated number; and otherwise, to compute and to output a sum of (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical function on the most significant bit of said sequence of truncated bits and (b) the (M−N) bit truncated number; wherein the clipper and the selector essentially consist of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate, an inverter; wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate; wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

7. The system according to claim 6 wherein selector is arranged to check if the M-bit two's compliment represented signed number is a largest positive number by a (M−N) input NAND gate arranged to receive an inverted most significant bit of the M-bit two's compliment represented signed number and to receive non-inverted second till (M−N−1)'th significant bits of the M-bit two's compliment represented signed number.

8. A system according to claim 6 wherein the clipper is arranged to providing special treatment for a largest positive number, represented by a ‘0’, followed by M−1replicas of ‘1’, to prevent said largest positive number from wrapping around zero and rounding toward a lowest negative number.

9. A system for rounding two's complement represented signed numbers toward zero, the system comprising: a receiver operative to receive an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; a truncator operative to truncate N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; a clipper and a selector operative, if the M-bit two's complement represented signed number is positive and the sequence of N truncated bits comprises a most significant bit of 1, followed by zeros, to output said (M−N) bit truncated number; and otherwise, to compute and to output a (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical function on the most significant bit of said sequence of truncated bits and (b) the (M−N) bit truncated number; wherein the clipper and the selector essentially consist of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate an inverter wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate; wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

10. A system according to claim 9 wherein the clipper provides special treatment for a largest positive number, represented by a ‘0’, followed by M−1 replicas of ‘1’, to prevent said largest positive number from wrapping around zero and rounding toward a lowest negative number.

11. A 2's complement arithmetic based hardware device including a system for rounding, wherein the system for rounding comprises a receiver operative to receive an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; a truncator operative to truncate N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; a clipped and a selector operative, if the M-bit two's complement represented signed number is negative and the sequence of N truncated bits comprises a most significant bit of 1 followed by zeros, to output said (M−N) bit truncated number; and otherwise, to compute and to output a sum of (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical function on the most significant bit of said sequence of truncated bits and (b) the (M−N) bit truncated number; wherein the clipper and the selector essentially consist of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate, an inverter; wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

12. A 2's complement arithmetic based hardware device including a system for rounding that comprises a receiver operative to receive an M-bit two's complement represented signed number to be rounded to an (M−N) bit two's-complement represented signed number; a truncator operative to truncate N bits from the right of the M-bit two's complement represented number, thereby to generate an (M−N) bit truncated number and thereby to define a sequence of N truncated bits; a clipper and a selector operative, if the M-bit two's complement represented signed number is positive and the sequence of N truncated bits comprises a most significant bit of 1, followed by zeros, to output said (M−N) bit truncated number; and otherwise, to compute and to output a (a) a number that has an equivalent value of one followed by (N−1) replicas of zero, the one provided by applying a logical function on the most significant bit of said sequence of truncated bits and (b) the (M−N) bit truncated number; wherein the clipper and the selector essentially consist of a (N−1) input NOR gate, a first NAND gate, a first AND gate, an adder, a (M−N) input NAND gate, an inverter; wherein the inverter is arranged to receive the most significant bit of the M-bit two's complement represented signed number and to invert it to provide an inverted signal; wherein the a (M−N) input NAND gate is arranged to receive the inverted signal and the second till (M−N−1)'th most significant bits of the M-bit two's complement represented signed number; wherein the (N−1) input NOR gate is arranged to receive (N−2) least significant bits of the M-bit two's complement represented signed number and having an output that is coupled to a first input of a first NAND gate: wherein the first NAND gate has a second input of the first NAND gate arranged to receive the most significant bit of the M-bit two's complement represented signed number; wherein the first AND gate is arranged to receive an output signal of the first NOR gate, a most significant bit of the sequence of truncated bits and an output signal of the (M−N) input NAND gate; wherein the adder is arranged to add an output signal of the first OR gate to the (M−N) bit truncated number.

13. A digital signal processing system including a 2's complement arithmetic based hardware device according to claim 11 .

14. A digital signal processing system including a 2's complement arithmetic based hardware device according to claim 12 .

Assignments (9)
MERGER Recorded Mar 3, 2023
From: AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE. LIMITED; BROADCOM INTERNATIONAL PTE. LTD.
To: AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE. LIMITED
Reel/Frame 062952/0850 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 14, 2020
From: AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE. LIMITED
To: BROADCOM INTERNATIONAL PTE. LTD.
Reel/Frame 053771/0901 →
CORRECTIVE ASSIGNMENT TO CORRECT THE EXECUTION DATE PREVIOUSLY RECORDED AT REEL: 047422 FRAME: 0464. ASSIGNOR(S) HEREBY CONFIRMS THE MERGER. Recorded Mar 6, 2019
From: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD.
To: AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE. LIMITED
Reel/Frame 048883/0702 →
MERGER Recorded Oct 5, 2018
From: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD.
To: AVAGO TECHNOLOGIES INTERNATIONAL SALES PTE. LIMITED
Reel/Frame 047422/0464 →
RELEASE OF SECURITY INTEREST Recorded Jan 11, 2017
From: KREOS CAPITAL IV (EXPERT FUND) LIMITED
To: DENSBITS TECHNOLOGIES LTD.
Reel/Frame 041339/0921 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 27, 2016
From: DENSBITS TECHNOLOGIES LTD.
To: AVAGO TECHNOLOGIES GENERAL IP (SINGAPORE) PTE. LTD.
Reel/Frame 037622/0224 →
SECURITY INTEREST Recorded Mar 18, 2015
From: DENSBITS TECHNOLOGIES LTD.
To: KREOS CAPITAL IV (EXPERT FUND) LIMITED
Reel/Frame 035222/0547 →
SECURITY INTEREST Recorded Jul 30, 2014
From: DENSBITS TECHNOLOGIES LTD.
To: KREOS CAPITAL IV (EXPERT FUND) LIMITED
Reel/Frame 033444/0628 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 19, 2011
From: KANTER, OFIR AVRAHAM; BAR, ILAN
To: DENSBITS TECHNOLOGIES LTD.
Reel/Frame 025658/0723 →
Continuity (3)
Provisional Application 61064760 · Mar 25, 2008
Provisional Application 61071404 · Apr 28, 2008
Related Publication 20100131580A1 · May 27, 2010