

% f(x) = sqrt(2)*sqrt(-log(x1))
% f(x) is represented with 3+m bits, 3 for the integer part to get sigma = 4.5 and 8 for the fractional part
% use 6 ramblocks configured as ROM read-only. The upper 5 bits of the RAMB are unused.
%

x = [1:31];
x1 = x/32;
x2 = x/(32)^2;
x3 = x/(32)^3;
x4 = x/(32)^4;
x5 = x/(32)^5;
x6 = x/(32)^6;
y1 = sqrt(-log(x1));
y2 = sqrt(-log(x2));
y3 = sqrt(-log(x3));
y4 = sqrt(-log(x4));
y5 = sqrt(-log(x5));
y6 = sqrt(-log(x6));
plot(x1,y1);
hold;
plot(x2,y2);
plot(x3,y3);
plot(x4,y4);
plot(x5,y5);
plot(x6,y6);

%The ROM values are computed here for each of the six tables.
z1 = dec2hex(floor(y1*256*sqrt(2.0) + 0.5),4);
z2 = dec2hex(floor(y2*256*sqrt(2.0) + 0.5),4);
z3 = dec2hex(floor(y3*256*sqrt(2.0) + 0.5),4);
z4 = dec2hex(floor(y4*256*sqrt(2.0) + 0.5),4);
z5 = dec2hex(floor(y5*256*sqrt(2.0) + 0.5),4);
z6 = dec2hex(floor(y6*256*sqrt(2.0) + 0.5),4);

