Computer Laboratory

ECAD and Architecture Practical Classes

Exercise 2

Files Provided

FPMandelbrot.java
A Java version of the solution to this exercise.

Behaviour

Write a program in TTC assembly to compute membership of a point in the Mandelbrot Set. The program should repeat indefinitely, accepting three parameters from the input stream: the first is the real part (in 4.28 fixed point), the second the imaginary part (in 4.28 fixed point); the third parameter is the maximum number of iterations.

Implementation Advice

Download the provided file into the directory for this lablet. The required assembly is analogous to the mandelbrot_point method in the FPMandelbrot class.

Testing

Assemble your program using the rmb format. Modify the "do" script to simulate your machine code; you may need to increase the simulation runtime.

Use the TestTinyComp module in ttc_test.sv to test the following points for a maximum of 255 iterations:

(0,0)
Expected result is 255.
(0.5,1.0)
Expected result is 2.
(-0.5,0.5)
Expected result is 255.
(-1.0,-0.5)
Expected result is 5.

The Java solution can be used if more test cases are necessary. Once you are satisfied you have completed the exercise, assemble the program into the mif format ready for the synthesis stage.

Previous  |  Contents  |  Next - Lablet 2.2