Académique Documents
Professionnel Documents
Culture Documents
BY MNNIT ALLAHABAD
Team Name Trinity
Abhijeet Singh Katiyar Ashish Srivastava Aaquib Ishtiyaq Sumit Kumar Verma
Problem Statememt
To implement a Gaussian Random Number Generator in verilog, such that the mean and the variance of the Gaussian distribution can be reconfigured. The output obtained should be plotted using some plotting tool like MATLAB.
Our Approach
We have made a Uniform Random Number Generator using Linear Feedback Shift Registers. These Uniform Random Numbers are then converted to Gaussian Distribution using the Box Muller Transformation.
It is commonly expressed in two forms. The basic form as given by Box and Muller takes two samples from the uniform distribution on the interval (0, 1] and maps them to two standard, normally distributed samples.
To change the Standard Deviation of our distribution, we multiply the required SD to every sample.
E[(AX)2] = A2 E[X2] = A2 (since E[X2] = 1)
Synthesis Report
Device utilization summary:
-------------------------- Selected Device : 3s100evq100-5 Number of Slices: 883 out of 960 91% Number of Slice Flip Flops: 229 out of 1920 11% Number of 4 input LUTs: 1610 out of 1920 83% Number used as logic: 1609 Number used as Shift registers: 1 Number of IOs: 131 Number of bonded IOBs: 99 out of 66 150% (*) Number of MULT18X18SIOs: 2 out of 4 50% Number of GCLKs: 1 out of 24 4%
Timing
Total 23.166ns (17.479ns logic, 5.687ns route) (75.5% logic, 24.5% route)
A Sample Output, generated by the GRNG module for Mean- 2392 SD- 291 and no. of Test cases are 327676.
length(y); for i=1:length(z) p(i)=(1/power((2*pi*sd*sd),0.5))*exp(-(power((z(i)mean),2))/(2*sd*sd)); end stem(z,p); q=sort (z); for i=1:length(z) if q(i)<0 fprintf(tp,'%lx\n',1); fprintf(tp,'%lx\n',-(q(i))); else fprintf(tp,'%lx\n',0); fprintf(tp,'%lx\n',q(i)); end end
j=j+1; end ph=normcdf(z,mean,sd); hijan=0; stem(z,ph); length(z) for i=1:length(z) hijan= hijan+((2*i)-1)*log(ph(i))+((2*(length(z)i)+1)*log(1-ph(i))); end hijan=(hijan/length(z)); out=-(hijan+length(z)) fclose(fp);
sd = 63
out =
1.1579
Thank you