Altera_Forum
Honored Contributor
16 years agoProblem with Array Operation
Hi,
I'm having a problem with the following code:module learning(datain,address,datawrite,dataread,
dataout,dataout_,a1,a2,temp1,temp3,temp2);
parameter length_of_data = 16;
parameter bits_of_address = 4;
input datain;
input address;
input datawrite,dataread;
output dataout,dataout_;
output a1,a2;
output temp1,temp2,temp3;
reg a1,a2;
reg arr ;
reg arr_ ;
reg temp1,temp2,temp3;
assign dataout =dataread? arr : 0;
assign dataout_=dataread? arr_ : 0;
always@(posedge datawrite)
begin
arr=datain;
a1=datain;
a2=datain;
temp1=arr;
temp2=temp1*a1;
temp3=temp2/a2;
arr_=temp3;
end
endmodule i cannot understand why 'temp3' is showing unusual values. Please help...