Reputation: 1
I am just starting out in Verilog, and can't seem to find the error in the code below, thank you in advance!
module sortTwo(input logic signed [15:0] A[1:0],
output logic signed [15:0] B[1:0]);
always @* begin
if (A[0]>A[1])
begin
assign B[1] = A[0];
assign B[0] = A[1];
end
else
begin
assign B[1] =A [1];
assign B[0] = A[0];
end
end
endmodule //end sortTwo
Upvotes: 0
Views: 2974
Reputation: 42673
IcarusVerilog does not support most of SystemVerilog, and may require a switch to enable what it does support. logic
is a SystemVerilog keyword. Try adding -g2012
Upvotes: 2
Reputation: 19
You can't use assign in always blocks. To fix your problem you need replace assign B[1] = A[0];
to B[1] = A[0];
Upvotes: 1