Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/135.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么赢了';这个Verilog代码不能编译吗?_Verilog - Fatal编程技术网

为什么赢了';这个Verilog代码不能编译吗?

为什么赢了';这个Verilog代码不能编译吗?,verilog,Verilog,引起问题的部分是c[1]=p[0]+g[0]&c0。怎么了 module CLA_gen(p, g, c0, c); input [3:0] p; input [3:0] g; input c0; output reg [4:1] c; begin c[1] = p[0] + g[0] & c0; end endmodule 您可能需要使用您可能需要使用您最想更改的: begin 致: 每个开始/结束都必须是另一个构造的一部分,例如始终,初始,等等。您最有可能要更改: begin

引起问题的部分是
c[1]=p[0]+g[0]&c0。怎么了

module CLA_gen(p, g, c0, c);
input [3:0] p;
input [3:0] g;
input c0;
output reg [4:1] c;
begin
c[1] = p[0] + g[0] & c0;
end
endmodule

您可能需要使用您可能需要使用您最想更改的:

begin
致:


每个
开始/结束
都必须是另一个构造的一部分,例如
始终
初始
,等等。

您最有可能要更改:

begin
致:


每个
开始/结束
必须是另一个构造的一部分,例如
始终
初始
,等等。

您缺少始终块及其敏感度列表

always @(*)
  c[1] = p[0] + g[0] & c0;

在上面发布的代码中,您不一定需要开始/结束,因为您只有一行。但将其添加到其中并没有什么坏处。

您缺少了“始终”块及其敏感度列表

always @(*)
  c[1] = p[0] + g[0] & c0;
在上面发布的代码中,您不一定需要开始/结束,因为您只有一行。但是,将其添加到其中并没有什么坏处。

删除开头和结尾 仅将c声明为输出

照此

module CLA_gen(p, g, c0, c);
input [3:0] p;
input [3:0] g;
input c0;
output [4:1] c;
assign c[1] = p[0] + g[0] & c0;
endmodule
拆下起点和终点 仅将c声明为输出

照此

module CLA_gen(p, g, c0, c);
input [3:0] p;
input [3:0] g;
input c0;
output [4:1] c;
assign c[1] = p[0] + g[0] & c0;
endmodule

它会引起什么问题?您会遇到什么编译器错误?同意,一般来说,包含输出错误是一种好的形式。它会导致什么问题?你得到了什么编译器错误?同意,一般来说,包含输出错误是一种好的形式。我们不知道他此时在建模什么,所以我们还不能做出判断。我们不知道他此时在建模什么,所以我们还不能做出判断。