Altera Embedded Systems Development Kit, Cyclone III Edition User Manual
Page 65

9–7
Development Board Version 1.0.
Altera Corporation
Altera Embedded Systems Development Kit, Cyclone III Edition
July 2010
Altera Mandelbrot C2H Demo
xsqr = x * x;
ysqr = y * y;
y = ((2 * x * y) + ci) >> 28;
x = (xsqr - ysqr + cr) >> 28;
iter++;
}
return(iter);
}
The implementation is fixed point with all values pre-scaled by
0x10000000. The loop will continue until the number of iterations reaches
‘max_iter’ or x2+ y2 converges to the value of 4. This function is called for
each pixel so for this design that would be 384000 times per frame since
the screen resolution is 800x480. The value of ‘iter’ is used as the index
into the color palette which picks the color of the pixel displayed on the
screen. Even though the main processor supports dynamic branch
prediction and contains cache memory, this operation of filling the screen
can be very time consuming.
The approach taken for the C2H accelerated version is to offload this
algorithm to pipelined and parallel hardware. The hardware accelerator
contains dedicated multiply, addition, and subtraction logic to perform
multiple operations in parallel. The hardware accelerator is only called
once per frame and operates on up to sixteen coordinates in parallel. The
workload is evenly distributed on a pixel basis by implementing the same
algorithm sixteen times. Sixteen neighboring coordinates in a single row
are operated on in a sliding window fashion.
Mandelbrot
Engine Pixel Interleaving