verilog中(v22)near text: "["; expecting ";"?,为啥老会报错,本人初学者

module shiyan05alu01 (clkin,rst,ain,bin,sel,result,cout);input clkin;input [5:0]ain;input [3:0]bin;input [1:0]sel;reg y;output reg cout;output reg [9:0]result;always @ (posedge clkin or negedge rst)case (sel) 2'b00:y=y1; 2'b01:y=y2; 2'b11:y=y3; 2'b10:y=y4;endcasealways @ (posedge clkin or negedge rst) begin if (rst<=0) result<=0; else case (sel) y1:[cout,result]=ain+bin; y2:[cout,result]=ain-bin; y3:[cout,result]=ain*bin; y4:[cout,result]=ain/bin; endcase endendmodule

第1个回答  2020-04-08
不应该是中括号而应该是大括号,像这个样子{aaa, bbb}
相似回答