module likebufif(in,en,out); input in; input en; output out; assign out =(en == 1)? in:'bz; endmodule module like4to1(a,b,c,d,sel,out); input a,b,c,d; input [1:0] sel; output out; assign out = sel == 2'b00 ? a: sel == 2'b01 ? b: sel == 2'b10 ? c:d; endmodule 如果条件值为x或z,则结果可能为x或z |
|关于本站|小黑屋|Archiver|手机版|无线电爱好网
( 粤ICP备14010847号 )
GMT+8, 2014-5-23 12:47 , Processed in 0.098061 second(s), 27 queries .
Powered by Discuz! X3.1 Licensed
© 2001-2013 Comsenz Inc.