I've read data from txt file(containing pixels of image),Binarize it.Now i want the binarized output to be written into another txt file.Below is my coding.When i run it, i get the following error.
"# ** Error: (vsim-8323) D:/G/Reference materials/Sample codes/Iris Localization/imgbinary.v(25): $fwrite : Argument number 3 is an unpacked type, and may only be printed with the '%p' format.
# Error loading design" .What's wrong in this code??
Code:
reg [7:0] data_th [0:1023];
initial begin
bin=$fopen("lena_binthresh.txt","w");
$fwrite(bin,"%h\n",[COLOR="#FF0000"][B]data_th[/B][/COLOR]);
$fclose(bin);
end
endmodule