Forum Discussion
Altera_Forum
Honored Contributor
15 years agoUse modelsim to simulate the hardware, feed it with inputs that vary from 0 to 360 in 0,1 degree steps, output the values of sin and cos to 2 .txt files (use vhdl.text_io package)
In Matlab do this: in=[0:0,1:360]; mcos=cos(in); msin=sin(in); Then read the two vhdl produced text files in Matlab something like: vsin=read_txt_file('your_hdl_sinfile.txt'); vcos=read_txt_file('your_hdl_cosfile.txt'); and compare then with the two arrays mcos and msin plot(msin-vsin); plot(mcos-vcos);