|

楼主 |
发表于 2011-11-15 20:57:28
|
显示全部楼层
回复 2# shiyinjita
单独写的三态门:
module buffer(buf_in,buf_chs,buf_out);
input buf_in;
input buf_chs;
output buf_out;
assign buf_out=(buf_chs==0)?buf_in:2'bz;
endmodule
反相器:
module lut_inveter(LUT_IN,LUT_OUT);
input LUT_IN;
output LUT_OUT;
defparam U0.INIT=2'b01;
LUT1 U0(.O(LUT_OUT),.I0(LUT_IN));
endmodule
顶层模块:
module challege(in,chs,out);
input in;
input chs;
output out;
buffer buff(.buf_in(in),.buf_chs(chs),.buf_out(in1));
lut_inveter not1(.LUT_IN(in1),.LUT_OUT(out));
endmodule |
|