20.11.2014 Views

PPKE ITK PhD and MPhil Thesis Classes

PPKE ITK PhD and MPhil Thesis Classes

PPKE ITK PhD and MPhil Thesis Classes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.3 Testing Methodology 73<br />

In fixed-point case, the precision means the length of the whole number, where<br />

2 bits represents the integer part <strong>and</strong> the rest is for the fraction, because the numbers<br />

are between 0 <strong>and</strong> 1. In the floating point the exponent length is constant<br />

11 bit wide <strong>and</strong> the rest is the mantissa, which will be varied during the examination.<br />

Current computing architectures are supporting 32 bit floating point or 64<br />

bit double precision numbers for computations. Fixed-point computations can be<br />

carried out by using 32 or 64 bit integers. The precision of the fixed- <strong>and</strong> floating<br />

point numbers on FPGA can be defined in much smaller steps. For the computer<br />

simulation of the algorithm we used the Mentor Graphics Algorithmic C<br />

Datatypes [64], which is a class-based C++ library that provides arbitrary-length<br />

fixed-point data types. For different types of floating-point numbers the GNU<br />

MPFR library [65] can be used. Despite of the fact, the MPFR contains low-level<br />

routines, the first floating-point computations, which we planned to make, took<br />

a very long time. Therefore an efficient arithmetic unit were created on FPGA to<br />

overcome the slow speed of the arbitrary precision floating-point computations,<br />

where the floating point operators from Xilinx CoreGenerator Library [37] are<br />

used.<br />

The initial condition is a sinus wave <strong>and</strong> periodic boundary condition is used.<br />

The initial conditions was tested because of the simplicity of the sinus function<br />

with different precisions, where the result function should match the initial condition<br />

after one period. The resolution of the grid is from 100 to 100000 point,<br />

the speed of advection is 12/13 <strong>and</strong> ∆T is 16/17 times the optimal ∆T , which<br />

can be computed by the CFL condition. These parameters are selected to meet<br />

some critical property, namely it shall not be represented in finite length binary<br />

number, on the other h<strong>and</strong> the number of time steps to compute one period shall<br />

be an integer to overcome phase errors. The result was simply compared to the<br />

initial condition. The error of the solution is measured by the L ∞ (infinity) norm<br />

defined by the following equation:<br />

|x| ∞<br />

= max<br />

i<br />

|x i | (3.11)<br />

The method to find a minimal bit width of the arithmetic unit is heuristic.<br />

Investigation of different precision operating units are done empirically. With the<br />

increase of the bit width a more accurate result can be achieved as can be seen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!