Presentation is loading. Please wait.

Presentation is loading. Please wait.

CENG536 Computer Engineering Department Çankaya University.

Similar presentations


Presentation on theme: "CENG536 Computer Engineering Department Çankaya University."— Presentation transcript:

1 CENG536 Computer Engineering Department Çankaya University

2 2 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

3 3 Number of bitsDynamic Range (db) 1060 1166 1272

4 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 4 2. Mathematical operations Processing the signal, result of arithmetical transforms will be truncated or rounded, because arithmetic unit has fixed number of bits. For example, product of multiplication of two n –bits numbers will be represented in 2n bits and the lower n bits of this result need to be discarded. Each truncation increases resulting error and decrease number of correct resulting bits. To have the same dynamic range of input and output signal, before the first arithmetic operation input sample should be expanded by adding additional bits to the left of the sign bit. Additional bits Sample of the signal from output of ADC Word format

5 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 5

6 6 Computation of the two point FFT is based on the “butterfly” operation of form Example of 8 point FFT: x1x1 x2x2 X1X1 X2X2

7 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 7 Magnitude of the complex function W N k fluctuates in range  1 and on each stage resulting magnitude may increases 2 times due to addition operation. Error on each stage of this algorithm is 0,5 bit. Because total number of stages for FFT algorithm is defined as Stages = log 2 (N), the number of additional bits in representation of data may be determined from the table For this example we select N=1024 or 2048. Samples in array of data N2565121024204840968192 Stages8910111213 Additio- nal bits 44,555,566,5 Word format 1415 16 17

8 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 8 On each stage result of multiplication should be discarded to 16 most significant bits and after addition data should be scaled by applying weighting coefficient ½. These operation prevent overflow and producing all operation on each stage in fixed-point format we always shall have data in input and output in 16 bit format. As error increases on each stage by 0,5 bit, total number correct bits in representation of output samples will be equal 10.

9 9 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

10 10 Dealing with numbers in RNS we process integer numbers and motivation for selecting of range of data representation should be applied on different way. Having ADC of 10 bits and determining array of data of 1024 samples we need to process data presented in 16 bit format. But after multiplication data will be represented in 32 bit format. Here result must be divided by 2 16 and will be added to another operand, according the logic of the algorithm. Then resulting output data on each stage will be in a twice larger range than range of data in input, that needs scaling coefficient of two to represent input and output data in the same range.

11 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 11 Execution of this algorithm in RNS will be realized in following way. 1. Initially x 1 and x 2 should be represented in main range of moduli, that must be twice larger, than its necessary to represent results. 2. Before the multiplication x 1 and x 2 should be expanded on additional set of moduli to avoid overflow of the product. 3. After multiplication product should be divided by range of expansion and it will be represented in main range. 4. Producing summation and then dividing result by 2 we shall have representation of X 1 and X 2 in main range. x1x1 x2x2 X1X1 X2X2

12 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 12 Set of moduli for main range should be selected to satisfy requirements of correct representation of input and output data. Selecting and denoting moduli of the main system as p 1, p 2,..., p i,..., p n we need to have range of data representation P that satisfies P  2 16. By adding modulo p 0 = 2 we have total main range 2 P  2  2 16 = 2 17. In addition, modulo p 0 = 2 is a good choice to represent negative numbers in artificial form. Moduli for range expansion  1,  2,...,  k,...,  m must give range P  2 16. Full range of data representation is 2 P  P  2 17  2 16 = 2 33.

13 13 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

14 14 Starting execution of any stage of data processing algorithm, the data need to be represented in total main range, for example number A will have form A  (  0,  1,...,  i,...,  n ) Before multiplication of this number by another one it should be expanded to full range A  (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) where residui by moduli of expansion range (  1,  2,...,  j,...,  m ) will be determined by using of range expanding algorithm. Let be introduced minimal pseudo-orthogonal numbers by moduli of total main range, and let in addition this numbers will be represented by moduli of expansion range

15 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 15 then summing numbers by selecting residui  i will be obtained number A  (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ). After all summations there may happens overflows over the range 2 P, but not over the full range.

16 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 16 Therefore, this result should be corrected. To realize correction there is necessary store in memory in parallel to minimal numbers in RNS their values in binary positional system. While adding minimal numbers in RNS must be realized binary summation by modulo 2 P to determine how many times T overflow occurs Correction should be realized by subtracting A = A – T = (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) – (0, 0,..., 0,..., 0,  T 1,  T 2,...,  T j,...,  T m ) = (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) Thus, this algorithm needs arithmetic operations in RNS and binary positional system.

17 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 17 Range expansion can be realized in another way. Let be introduced set of minimal by absolute value numbers of form

18 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 18 Selecting numbers by moduli p i and adding them according the rule (  i +  i ) (mod p i ) =  I will be obtained necessary result A = (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) In this case correction of number because of overflows by modulo 2 P will be realized like it was shown before. Final result will be of form A = A – T = (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) – (0, 0,..., 0,..., 0,  T 1,  T 2,...,  T j,...,  T m ) = (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m )

19 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 19 After multiplication of the two numbers is done, result C should be scaled to represent it in total main range 2 P (compressing of the range). For that may be applied method of zeroing. To have result in total main range, we realize division of number C by P (range expansion). For that must be introduced new set of minimal pseudo-orthogonal numbers of form

20 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 20 This numbers like for algorithm of range expanding should be represented in both forms – in RNS and in positional binary. Let we apply zeroing to number C  (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) Selecting minimal numbers that satisfies rule  j +  j (mod  j )  0, and summing them we get C+  C=C  (  0,  1,...,  i,...,  n, 0, 0,..., 0,..., 0) In parallel we count overflows by modulo P in positional binary

21 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 21 Then we correct the result by subtracting C  = C – R = (  0,  1,...,  i,...,  n, 0, 0,..., 0,..., 0) – (  R 0,  R 1,...,  R i,...,  R n, 0, 0,..., 0,..., 0) = (  0,  1,...,  i,...,  n, 0, 0,..., 0,..., 0) Second stage of range compression is formal division by P for moduli of total main range. This operation gives where symbol * indicates indefiniteness of division 0 by 0. These indefinites may be opened by applying of algorithm of range expanding.

22 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 22 The same result may be obtained in another way. We want transform number C  (  0,  1,...,  i,...,  n,  1,  2,...,  j,...,  m ) to form C+  C=C  (  0,  1,...,  i,...,  n, 0, 0,..., 0,..., 0). Let be introduced another set of minimal by absolute value numbers

23 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 23 Using the same rule we realize zeroing of residues by moduli  j  j +  j (mod  j )  0. Minimal numbershave smaller magnitude, comparing to that, but here as result of zeroing there may happens overflow by modulo P. That is why we need to accompany computation in RNS by those in positional binary to count number of overflows. Realization of second stage of this algorithm, that is division by P, is identical to that analyzed before.

24 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 24 To transform analog signal to binary code there may be used traditional ADC, produced by industry. Then, this binary positional code need to be transform to RNS. Typical way is using of constants of form 2 i ≡ ( β 0 i, β 1 i, … β n i ) Having k-bit ADC, transform from binary to RNS will takes k summation. Here we have small set of k constants, but its necessary spent too much time for this transform. Analyzing 10-bit ADC, lets represent binary number (signal sample) in another form as A = (a 9 a 8 a 7 a 6 a 5 )2 5 + (a 4 a 3 a 2 a 1 a 0 )2 0 where a i – is binary digit (0, 1) that has weight 2 i. Number of such groups and number of bits in each group of real ADC should be selected by the system designer.

25 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 25 Realizing operations for 10-bit ADC, we need to introduce two sets of constants of form (a 9 a 8 a 7 a 6 a 5 )2 5 ≡ ( β 0 5, β 1 5, … β n 5 ) and (a 4 a 3 a 3 a 3 a 3 )2 0 ≡ ( β 0 0, β 1 0, … β n 0 ), totally 32  2 = 64 constants. Increasing number of constants we reduce number of arithmetic operations from 10 to 2. These constants may be represented not only in residui by moduli of total main range, but in residui of expansion range. In this case, starting first stage of FFT algorithm expanding of the range may be skiped.

26 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 26 Finalizing computations, result must be converted rom RNS to positional binary for further displaying. For this purposes we need orthogonal bases of form B α 1 = (α 1, 0,..., 0,..., 0) B α 2 = (0, α 2,..., 0,..., 0)....... B α i = (0, 0,..., α i,..., 0)....... B α n = (0, 0,..., 0,..., α n ) _______________________________ A (mod P ) ≡ ( α 1, α 2,..., α i,..., α n ) that need to be represented in binary positional system. Summing selected constants by mod P will be determined representation of the number in positional system.

27 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 27 Having, for example, 6 moduli we need constants and to produce this conversion will be realized 6 additions. To minimize conversion time there we can introduce another set of orthogonal bases not for the only modulo, but for pair of moduli. For our example these constants will be of form B α 1 α 2 = (α 1, α 2, 0, 0, 0, 0) B α 3 α 4 = (0, 0, α 3, α 4, 0, 0) B α 5 α 6 = (0, 0, 0, 0, α 5, α 6 ) ________________________________ A (mod P ) ≡ ( α 1, α 2, α 3, α 4, α 5, α 6 ) Here we need to realize 3 additions by modulo P to obtain necessary result. Moduli to create these orthogonal bases may be combined in different order. Here we need (p 1 – 1)(p 2 – 1) + (p 3 – 1)(p 4 – 1) + (p 5 – 1)(p 6 – 1) constants.

28 28 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV

29 29 Practical implementation of the algorithms can be realized in RAM or ROM memory of the computer. Simplified representation of memory is shown in figure To the input (address lines) are applied residues of operands or different kinds of constants. On the outputs (data lines) will be obtained result of arithmetic or other operation.

30 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 30 To realize all algorithms analyzed there must be prepared different tables of data, that is -Addition table -Subtraction table -Multiplication table -Orthogonal bases table -Minimal numbers table -Table of numbers minimal by absolute value... and the other tables, depending of algorithm. Access to each of this tables may be organized by setting individual address code on most significant bits of address lines. These bits will be responsible for selecting of operation code (OpCode) in RNS. Lower address lines will carry information about residue of one or two operands.

31 CENG 536 - Spring 2012-2013 Dr. Yuriy ALYEKSYEYENKOV 31 If special external ROM memory is used for storing of tables, there may be organized necessary width of data bus to represent information in residues of all moduli in one word. If standard RAM memory of computer is used – there may be necessary to store output data in two or more memory locations. In any way, no standard methodology for designing of systems in RNS. Realizing a project, designer needs to analyze different ways to find an optimal solution.


Download ppt "CENG536 Computer Engineering Department Çankaya University."

Similar presentations


Ads by Google