- 使用Modelsim 10.2d以verilog編寫此代碼。下面的錯誤表明{cout,l3}賦值存在一些問題。連續分配verilog
module alu(a,b,bin,cin,op,cout,res);
input [31:0] a,b;
input [1:0] op;
input bin,cin;
reg [31:0] l1,l2,l3;
output cout;
output [31:0] res;
assign l1 = a & b;
assign l2 = a | b;
initial
if(bin == 1'b0)
assign {cout,l3} = a + b + cin;
else
assign {cout,l3} = a - b + cin;
mux4to1(l1,l2,l3,op,res);
endmodule
Error-
v(14): LHS in procedural continuous assignment may not be a net: cout.
v(16): LHS in procedural continuous assignment may not be a net: cout.