Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECE 448: Spring 2016 Lab 5 Julia Set Fractal.

Similar presentations


Presentation on theme: "ECE 448: Spring 2016 Lab 5 Julia Set Fractal."— Presentation transcript:

1 ECE 448: Spring 2016 Lab 5 Julia Set Fractal

2 Introduction to Lab5 2

3 Benoit Mandelbrot Mandelbrot was born in Poland in 1924.
Father of fractal geometry. He showed how fractals can occur in many different places in both mathematics and elsewhere in nature.

4 What is a Fractal? Fractals are mathematical structures defined by two properties Iterative Self-similar Zooming in or out on the image reveals deep repetition of patterns

5 The Julia Set Julia Set was named for the early twentieth century French mathematician Gaston Julia The Julia set is a set of points in the complex plane, the boundary of which forms a fractal. Mathematically, the Julia set can be generated using a very simple iterative formula, called the quadratic recurrence equation, applied to points in complex plane  zn+1 = zn2 + zn + c  we start with z0=0 and apply the iteration repeatedly, The absolute number depends on c, however large n gets.

6 The Julia Set

7 Pseudocode In the pseudocode below, Z0=z0x+i·z0y, corresponds to one pixel of the display region. The plotted region should have the following limits -2 ≤ z0x=Re[Z0] ≤ 2 -1.5 ≤ z0y=Im[Z0] ≤ 1.5 for z0y = -1.5 to 1.5, step 3/400 do for z0x = -2 to 2, step 4/600 do { iteration = 0 zx = z0x zy = z0y z and c are complex numbers. One begins by assigning a fixed value to c, letting z = 0 and calculating the output. One then repeatedly recalculates, or iterates, the equation, substituting each new output for z. Some values of c, when plugged into this iterative function, produce outputs that swiftly soar toward infinity. Other values of c produce outputs that eternally skitter about within a certain boundary. This latter group of c‘s, or complex numbers, constitutes the Mandelbrot set.

8 Pseudocode Cont… // z = z2 + z + c = (zx2 – zy2 +zx + cx) + i · //(2 · zx · zy + zy + cy) while (zx2 + zy2 < 4 && iteration < MAX_ITER ){ zxtemp = zx2 – zy2 + zx + cx zytemp = 2 · zx · zy + zy + cy zx = zxtemp zy = zytemp iteration++ }

9 Pseudocode Cont… x = x_conv(z0x) // conversion to the x-coordinate of a pixel y = y_conv(z0y) // conversion to the y-coordinate of a pixel if zx2 + zy2 < 4 color(x,y) = fractal_color else color(x,y) = background_color }

10 x_conv() and y_conv The functions x_conv() and y_conv() are used to convert the coordinates of the complex number Z0 into x and y coordinates of the pixel. x = x_conv(z0x) = 20 + (z0x-(-2))*(600/4) = *(z0x+2) y = y_conv(z0y) = (z0y-(-1.5))*(400/3)= 440 – *(z0y+1.5)

11 Fixed Point Representation
You can use Q4.28 representation 4 integer bits 28 fractional bits Addition/Subtraction performed as usual Multiplication of two Q4.28 numbers results in a Q8.56 number, which should be converted back to Q4.28

12 VGA Display Area Use a rectangular area of the size (600 x 400) to display the Julia set fractal. Left and Right border = 20 pixels each Top and Bottom border = 40 pixels each

13 Cont.. Top border should display “THE JULIA SET” in the center.
Bottom border should display Percentage of the display area, increasing every 0.5%. Progress bar Total execution time with the step 0.1 s.

14 Input/Output Scheme Use BTNS as the Start/Pause button to start/pause the computations. The color of the fractal and background should also change, depending on the positions of switches

15 Final VGA Display Outlook
THE JULIA SET 33.1 s 95.5%

16 Bonus Tasks color = iteration mod 8
Increase the speed of calculations, by evaluating 4 values of Z0 in parallel. Determine the maximum speed-up possible by evaluating N values of Z0 in parallel, where N is limited only by the available FPGA resources. Add colors by assigning a different color to each value of Z0, based on the number of iterations required for the decision based on the following formula: color = iteration mod 8


Download ppt "ECE 448: Spring 2016 Lab 5 Julia Set Fractal."

Similar presentations


Ads by Google