verilog 10137错误
代码如下modulekai(a,clk,b,c,d,h,inv);input[3:0]a;inputclk;output[3:0]b,c,d;outputinv,h;re...
代码如下
module kai (a ,clk ,b,c,d,h,inv);
input [3:0] a ;
input clk ;
output [3:0] b,c ,d;
output inv,h;
reg [3:0] b,c,d ;
wire h,inv;
always @(posedge clk)
begin
if (inv==0)
b<=a;
else
b<=~a;
end
always @(posedge clk)
begin
c<=b;
end
always @(posedge clk)
begin
d[0] = a[0] ^ c[0];
d[1] = a[1] ^ c[1];
d[2] = a[2] ^ c[2];
d[3] = a[3] ^ c[3];
end
always @(posedge clk)
begin
h=d[0]+d[1]+d[2]+d[3];
end
always @(posedge clk)
begin
if (h>2)
inv=0;
else
inv=1;
end
endmodule
Error (10137): Verilog HDL Procedural Assignment error at kai.v(32): object "h" on left-hand side of assignment must have a variable data type
Error (10137): Verilog HDL Procedural Assignment error at kai.v(37): object "inv" on left-hand side of assignment must have a variable data type
Error (10137): Verilog HDL Procedural Assignment error at kai.v(39): object "inv" on left-hand side of assignment must have a variable data type
Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 0 warnings
Error: Quartus II Full Compilation was unsuccessful. 5 errors, 0 warnings 展开
module kai (a ,clk ,b,c,d,h,inv);
input [3:0] a ;
input clk ;
output [3:0] b,c ,d;
output inv,h;
reg [3:0] b,c,d ;
wire h,inv;
always @(posedge clk)
begin
if (inv==0)
b<=a;
else
b<=~a;
end
always @(posedge clk)
begin
c<=b;
end
always @(posedge clk)
begin
d[0] = a[0] ^ c[0];
d[1] = a[1] ^ c[1];
d[2] = a[2] ^ c[2];
d[3] = a[3] ^ c[3];
end
always @(posedge clk)
begin
h=d[0]+d[1]+d[2]+d[3];
end
always @(posedge clk)
begin
if (h>2)
inv=0;
else
inv=1;
end
endmodule
Error (10137): Verilog HDL Procedural Assignment error at kai.v(32): object "h" on left-hand side of assignment must have a variable data type
Error (10137): Verilog HDL Procedural Assignment error at kai.v(37): object "inv" on left-hand side of assignment must have a variable data type
Error (10137): Verilog HDL Procedural Assignment error at kai.v(39): object "inv" on left-hand side of assignment must have a variable data type
Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 0 warnings
Error: Quartus II Full Compilation was unsuccessful. 5 errors, 0 warnings 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询