0

我已经定义

reg bricks[0:3][0:7]

在 Verilog 模块中。如何将此二维数组分配为

{{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1},{1,1,1,0,1,1,1}}.

请帮忙

4

1 回答 1

3
reg bricks [0:3][0:7];     //creates an unpacked array 
                           // It means you can access individual bits

bricks[1][0] = 0 ;         // Assigns 0 to the bit referenced by 1 and 0 

bricks [2] = 0 ;           // Illegal Syntax

bricks [1][0:3] = 0 ;      //Illegal Syntax

系统verilog提供了更多的灵活性

于 2013-04-10T23:01:59.423 回答