How to Clear a 2D array back to 0

Guest
Hello,

I have a 2D array that I am using to put data into, that will keep
track of differnt points of data while a certain pin is driven high.
When that pin falls to 0, I would like to clear that 2D array out
completly. Is there any eay way to do this without have to do is this
way?

begin
twoDarray[0] = 0;
twoDarray[1] = 0;
twoDarray[2] = 0;
twoDarray[3] = 0;
....
end

I would assume it would be simple, but I have not found any code or
tutorial about arrays that go over this method. I can do it the way
that I listed above, but I was wondering if there may be an easier
path. If i try to just set 'twoDarray = 0;', it tells me "Illegal left
hand side of blocking assignment" The link for the error from ISE is
this:

http://www.xilinx.com/xlnx/xil_ans_display.jsp?iLanguageID=1&iCountryID=1&getPagePath=18362

Thanks for any help, it would be greatly appreciated.
 
Try this one:
for(i=0;i<ArrayDimention;i=i+1) twoDarray = 0;

mwiesbock@gmail.com wrote:
Hello,

I have a 2D array that I am using to put data into, that will keep
track of differnt points of data while a certain pin is driven high.
When that pin falls to 0, I would like to clear that 2D array out
completly. Is there any eay way to do this without have to do is this
way?

begin
twoDarray[0] = 0;
twoDarray[1] = 0;
twoDarray[2] = 0;
twoDarray[3] = 0;
...
end

I would assume it would be simple, but I have not found any code or
tutorial about arrays that go over this method. I can do it the way
that I listed above, but I was wondering if there may be an easier
path. If i try to just set 'twoDarray = 0;', it tells me "Illegal left
hand side of blocking assignment" The link for the error from ISE is
this:

http://www.xilinx.com/xlnx/xil_ans_display.jsp?iLanguageID=1&iCountryID=1&getPagePath=18362

Thanks for any help, it would be greatly appreciated.
 
Or, initialize the 2D array by calling $readmemb/h with a text file
containing everything zero, at the expense of File I/O transaction.

Utku.

Michael wrote:
Try this one:
for(i=0;i<ArrayDimention;i=i+1) twoDarray = 0;

mwiesbock@gmail.com wrote:
Hello,

I have a 2D array that I am using to put data into, that will keep
track of differnt points of data while a certain pin is driven high.
When that pin falls to 0, I would like to clear that 2D array out
completly. Is there any eay way to do this without have to do is this
way?

begin
twoDarray[0] = 0;
twoDarray[1] = 0;
twoDarray[2] = 0;
twoDarray[3] = 0;
...
end

I would assume it would be simple, but I have not found any code or
tutorial about arrays that go over this method. I can do it the way
that I listed above, but I was wondering if there may be an easier
path. If i try to just set 'twoDarray = 0;', it tells me "Illegal left
hand side of blocking assignment" The link for the error from ISE is
this:

http://www.xilinx.com/xlnx/xil_ans_display.jsp?iLanguageID=1&iCountryID=1&getPagePath=18362

Thanks for any help, it would be greatly appreciated.
 
Thank a lot for both of your help! Its good to know the available
options that I can use.
Thanks again!


utku.ozcan@gmail.com wrote:
Or, initialize the 2D array by calling $readmemb/h with a text file
containing everything zero, at the expense of File I/O transaction.

Utku.

Michael wrote:
Try this one:
for(i=0;i<ArrayDimention;i=i+1) twoDarray = 0;

mwiesbock@gmail.com wrote:
Hello,

I have a 2D array that I am using to put data into, that will keep
track of differnt points of data while a certain pin is driven high.
When that pin falls to 0, I would like to clear that 2D array out
completly. Is there any eay way to do this without have to do is this
way?

begin
twoDarray[0] = 0;
twoDarray[1] = 0;
twoDarray[2] = 0;
twoDarray[3] = 0;
...
end

I would assume it would be simple, but I have not found any code or
tutorial about arrays that go over this method. I can do it the way
that I listed above, but I was wondering if there may be an easier
path. If i try to just set 'twoDarray = 0;', it tells me "Illegal left
hand side of blocking assignment" The link for the error from ISE is
this:

http://www.xilinx.com/xlnx/xil_ans_display.jsp?iLanguageID=1&iCountryID=1&getPagePath=18362

Thanks for any help, it would be greatly appreciated.
 

Welcome to EDABoard.com

Sponsor

Back
Top