|  | 
 
| 
module MUX_2_1_3(out,D0,D1,test)
×
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册  output[2:0] out;
 input[2:0] D0,D1;
 input test;
 reg[2:0] out;
 always@(D0 or D1 or test)
 case(test)
 1'b0: out=D0;
 1'b1: out=D1;
 default: out=3'XXX;
 endcase
 endmodule
 这个是我编写的3个2选1模块,其中test的控制信号,文件名称为MUX2_1_3.v
 以下是测试文件
 ‘timescale 10ns/1ns
 ’include “MUX2_1_3.v"
 module mux2_1_3_test
 reg[2:0] a,b;
 reg s;
 wire[2:0] out;
 MUX2_1_3 mux(out,a,b,s);
 always#5 s=~s;
 initial
 begin
 a=3'b100;
 b=3'b001;
 end
 endmodule;
 上边的那个文件可以通过compile,可是下边的总显示有错误,错误信息为Illegal base specifier in numeric constant/
 syntax error, unexpected ''base'',expecting "class"
 我以前做模拟IC的,不得已做数字,现在刚开始学习verilog,求大神的指教,谢谢
 | 
 |