Verilog array assigned to an other array

Status
Not open for further replies.

FboDigit

Member level 1
Joined
Jun 19, 2012
Messages
38
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Canada
Activity points
1,502
Hi all !

I am currently programming in verilog/systemverilog and I want to know if there is a way to assigne an array to an other!!!

I know that you can not access an entire array and you can not access a slice of an array.
But is there a way to copy a part of an array into an other like this

Code:
task....
     integer array1[7:0];
     integer array2[7:0];
     begin

          array1[3:2] = array2[3:2];

     end
endtask

OR like this

Code:
task....
     integer array1[7:0];
     integer array2[7:0];
     reg [7:0] number
     begin
          number = 3
          array1[number-:1] = array2[number-:1];

     end
endtask

Please help me !!!!
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…