Method and apparatus for an efficient square-root computation
AssigneeTelefonaktiebolaget LM Ericsson
InventorJohn Philipsson
Life of this patent
Estimating the term…
Abstract
The number X is a number whose square root is to be computed efficiently. A first register of a processor is set to the number X. A second register of the processor is set to a number L, wherein the number L indicates a number of significant bits of X. The number L is shifted right in the second register by one bit to produce a number N. The number X is shifted right in the first register by N bits to produce a number X1. A third register of the processor is set to 1 and shifted left by N bits to produce the result N1 in the third register. The results N1 and X1 are added and shifted right by one bit to produce an approximation to the square root of X.
Claims17
A method for computing a square root of a number in a processor, the method comprising the steps of:
- setting a first register of the processor to a number X, wherein the number X is a number whose square root is to be computed;
- setting a second register of the processor to a number L, wherein the number L indicates a number of significant bits of the number X;
- shifting right the number L in the second register by one bit to produce a number N;
- shifting right the number X in the first register by N bits to produce a number X1;
- shifting left a third register of the processor set to 1 by N bits to produce a result N1 in the third register;
- adding the results N1 and X1 to produce an intermediate result;
- and
- shifting right by 1 bit the intermediate result to produce an approximation to the square root of X.
An apparatus for computing a square root of a number X, the apparatus comprising:
- a first register for storing the number X;
- a second register for storing a number L, wherein the number L indicates a number of significant bits of the number X;
- a third register for storing a number 1;
- and
- a computing unit configured to:
- shift right the number L in the second register by one bit to produce a number N;
- shift right the number X in the first register by N bits to produce a result X1;
- shift left the number 1 in the third register by N bits to produce the result N1;
- add the results X1 and N1 to produce an intermediate result;
- and
- shift right by 1 bit the intermediate result to produce an approximation to the square root of X.
An article of manufacture for computing a squire root, comprising:
- a first register for storing a number X, wherein X is a number whose square root is to be computed;
- a first shift right unit operating on the first register;
- a second register for storing a number L, wherein the number L indicates, a number of significant bits of the number X,
- a second shift right unit operating on the second register for shifting right the number L in the second register by one bit yielding the number N, the first shift right unit shifting right the number X in the first register by the number N;
- a third register for holding a binary form of the number 1;
- a shift left unit for shifting left the number 1 of the third register by N bits;
- and
- an adder adding the first register and the third register to produce an intermediate result;
- and
- a third shift right unit for shifting right the intermediate result by one bit to produce an approximation to the square root of X.
An article of manufacture, comprising:
- a computer readable storage medium;
- and
- computer programming stored on the storage medium;
- wherein the stored computer programming is configured to be readable from the computer readable storage medium by at least one computer and thereby cause the at least one computer to operate so as to:
- store a number X in a first register, wherein X is a number whose square root is to be computed;
- store a number L is a second register, wherein the number L indicates a number of significant bits of the number X;
- shift right the number L in the second register by 1 bit resulting in a number N;
- shift right the number X in the first register by N bits;
- store a number 1 in a third register;
- shift left the number 1 in the third register by N bits;
- add the first register and the third register to produce an intermediate result;
- and
- shift right by one bit the intermediate result to produce and approximation to the square root of X.
Dependencies are inferred from the claim text.