integer dout_file1;
integer dout_file2;
initial begin
dout_file1=$fopen("C:/Users/lenovo/Desktop/sin.txt"); //打开所创建的文件
dout_file2=$fopen("C:/Users/lenovo/Desktop/cos.txt"); //打开所创建的文件
if(dout_file1 ==0)begin
$display("can not open the file!"); //创建文件失败,显示can not open the file!$stop;
end
end
always @(posedge aclk)
begin
$fdisplay(dout_file1,"%d",$signed(sin_reg)); //保存有符号数据
end
always @(posedge aclk)
begin
$fdisplay(dout_file2,"%d",$signed(dout_all)); //保存有符号数据
end