Download New Representation f..

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of logarithms wikipedia , lookup

Large numbers wikipedia , lookup

Real number wikipedia , lookup

Positional notation wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Elementary mathematics wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Location arithmetic wikipedia , lookup

Arithmetic wikipedia , lookup

Addition wikipedia , lookup

Transcript
--
Name : Amin Al-Ghamdy
ID : 900-11-4275
New Representation for Complex
Numbers
Summary for an article
“Complex Number Representation in RCBNS Form
For Arithmetic Operations and Conversion of the Result
Into Standard Binary Form”
ECE 5571 Digital System Design 1
Spring 2003
New Representation for Complex Numbers
Dealing with complex numbers needs a high performance method of computation. In the
article “Complex Number Representation in RCBNS Form for Arithmetic Operations and
Conversion of the Result in Standard Binary Form done proposed by Hatim Zaini and R.
G. Deshmukh, Florida Tech, 2003”, the complex number is treated as one unit, while in
other algorithms is treated as two parts, the real and imaginary parts. This kind of new
way of dealing with the complex numbers decreases the number of steps for doing
arithmetic operations thus will enhance the performance of the computations.
In Standard Binary Number (SBN), base 2 usually is used. In contrast, in CBNS, (-1+j) is
the base that is used instead of base 2, and it is represented as follows:
.......  a 2 (1  j ) 2  a1 (1  j )1  a 0 (1  j ) 0
(1)
ai takes value of 0 or 1. Let qi denotes the (-1+j)i , i >= 0.
A row of 4 bits is generated as follows:
q o,J = q 0,3 q 0,2 q 0,1 q 0,0 = (2+j2) (-j2) (-1+j) 1
Where q
i+1,J
=q
I,J
* (-4). In more details, multiplying row 0 by -4 gives the 1st row and
multiplying the 1st row also by (-4) gives the 2nd row and so on. See Table 1.
(1  j )11
R
(1  j )10
J
R
J
0
32
(1  j ) 9
32
R
-
(1  j ) 6  q1, 2
R
R
8
-
J
0
8
R
16
(1  j ) 5  q1,1
R
-
Row 2 = q 2
J
J
4
8
16
4)
(1  j ) 4  q1,0
Row 1= q1
R
-
4
J
-
0
4
(1  j ) 3  q0,3
(1  j ) 2  q0, 2
(1  j )1  q0,1
(1  j ) 0  q0,0
R
R
R
J
R
J
1
1
0
J
2
J
0
2
-
Row 1 * (-
0
16
(1  j ) 7  q1,3
-
J
-
32
J
(1  j ) 8
Row 0 * (4)
Row 0 = q 0
-1
2
Table 1
The value of an X number is follows the next equation:
n 1
X   x i (1  j ) i
i 0
X i  { ,...,  }
(2)
 = 3, Alpha (  ) is restricted to [( r  1) / 2]    (r  1) where r = 4.
In the next block diagram, it shows how the process of the proposed operation works. It
is only picking an example of subtraction and addition.
In this article, RCBNS uses radix (-1+j). Any complex number represented by 4 bit-rows
in radix of 4. As an example, the article shows a sample table for mapping complex
numbers from -3-j3 through 3+j3, Table 2.
No
(1  j ) 3
(1  j ) 2
(1  j )1
(1  j ) 0
-3 –j3
2 + j2
-1
- j2
1
-1 + j
1
1
0
-2 –j3
0
1
-1
-3
-1-j3
0
1
-1
-2
0-j3
0
1
-1
-1
1-j3
0
1
-1
0
2-j3
3-j3
0
0
1
1
-1
-1
1
2
-3 +j3
0
-1
1
-2
-2 +j3
0
-1
1
-1
-1+j3
0
-1
1
0
0+j3
0
-1
1
1
1+j3
0
-1
1
2
2+j3
1
-1
-1
-1
3+j3
1
-1
-1
0
-3 –j2
0
1
0
-3
-2 –j2
0
1
0
-2
-1-j2
0
1
0
-1
0-j2
0
1
0
0
1-j2
0
1
0
1
2-j2
0
1
0
2
3-j2
0
1
0
3
Table 2 Bit representation for a row in a 4 bit
The whole process works by testing the sign of both real and imaginary parts of the
complex numbers. If each is positive or negative, for positive numbers it will put a 0 in
front of each 2-bit digit (e.g. for 9 = 1 0 0 1  0 1 0 0 0 1), and putting a 1 in front of the
2-bit digit if the number is negative (e.g. for -9 = - 1 0 0 1  1 1 0 1 0 1). Then,
combining the 2 parts together with the imaginary parts is to form the LSB in the form of
qi. In other word, it is the grouping the right 3-bits of imaginary parts to the right 3-bits of
real parts. Here is an example for more clarification and details:
Example: If the complex number is 2+j7, then
Part 1 (J)  7 = 0 1 1 1  0 0 1 0 1 1
Part2 (R)  2 = 0 0 1 0  0 0 0 0 1 0
Also getting q0, and q1
q0  0 1 1 0 1 0
q1  0 0 1 0 0 0
Then looking to Table 3 for mapping,
q0 0 1 1 0 1 0 001 101 101 101  1 -1 -1 -1
(R + J)
RCBNS (-1+j),3
base10
J
2+j2
-j2
-1+j
1
S 0-3
S 0-3
S 0-3
S 0-3
R
0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1
0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0
0
0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1
0
0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1
0
0 1 0 0 1 0 0 0 0 0 0 0 0 1 0 1 0
0
0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 1
0
0 1 0 1 1 0 0 1 0 0 0 1 0 1 0 0 0
0
1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0
0
1 0 0 0 1 0 0 0 1 0 1 0 0 0 0 0 1
0
1 0 0 1 0 0 0 0 1 0 1 0 0 0 0 1 0
0
1 0 0 1 1 0 0 0 1 0 1 0 0 0 0 1 1
0
1 1 0 0 0 0 0 0 1 0 1 0 0 1 0 0 1
0
1 1 0 0 1 0 0 0 1 0 1 0 0 1 0 1 0
0
1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1
0
1 1 0 1 1 0 0 1 1 0 1 1 0 1 0 0 0
Table 3 An example of conversion from SBN to RCBNS
Finally, multiplying positive sign to even row and negative sign to odd row,
q0  1 -1 -1 -1 ( even)
q1  0 0 -1 -1 ( odd ) and combine the qi on the form of ……. q5, q4, q3, q2, q1, q0
using (-4)i * qi for each qi in the 4-bit row.
The objective of the whole operation is using this kind of representation in the
arithmetical operation. Addition example is introduced to show how the process works.
Assume 2 complex numbers X = 9 + j 11, Y = 35 + j 25.
9 + j 11 = X  1 0 -1 -1
0100
1 0 -1 0
35 + j 25 = Y  0 0 0 0
0 1 0 -2
0 -1 0 2
S1 : Sum
0 2 0 -2
1 -1 0 2
1 0 -1 -1
If the result is not from the set of { -3,……,+3}, normalization is needed as follows: S =
Normalization + Carry. After getting the result in RCBNS form, a conversion is needed
to get the Standard Binary Number (SBN). Two ways have proposed by the writers, one
of them to get the SBN in 2’S complement form. It uses 2 registers to retain the real and
imaginary part of the number.
If the RCBNS is 1 0 -1 -1
0 2 0 -2
1 -1 0 2, then the result is row0 (1 -1 0 2) – 4
* row1 (0 2 0 -2) + 16 * row2 (1 0 -1 -1) = 44 + j 36  the SBN.
Finally, in this proposed way of dealing with complex numbers two algorithms have
been combined, the Redundant Binary Numbers and the Binary Number System for
Complex Numbers that leads to RCBNS” Redundant Complex Binary Number System.”
This algorithm is a valuable compromise for the arithmetical operations. It will enhance
and improve the results especially in functions that deal with complex numbers and lose
most of time in computations. It reduces the overall number of steps being used in older
method of using operation with complex numbers. Although, here is the block diagram of
the proposed algorithm and is depicted below in Figure 1.
1st Complex
Number
R1
2nd Complex
Number
R2
J1
J2
Binary code to RCBNS Conversion form
1st
qn
2nd
qn
q1 q 0
q1 q 0
q1 q0  row0
qn
RCBNS Conversion form t0 Binary form
Rs
Js
Figure 1. Block diagram for the proposed algorithm