'verilog'에 해당되는 글 1건

  1. 2007/11/06 inout port 사용법 (1)
STUDY/전공2007/11/06 00:01
자꾸 까먹는다. 까먹지말자!

module bidirec (oe, clk, inp, outp, bidir);
	// Port Declaration
	input   oe;
	input   clk;
	input   [7:0] inp;
	output  [7:0] outp;
	inout   [7:0] bidir;


reg [7:0] a; reg [7:0] b; assign bidir = oe ? a : 8'bZ ; assign outp = b; // Always Construct always @ (posedge clk) begin b <= bidir; a <= inp; end endmodule



output 은 enable 이 있을경우만 트리거 해주고, 평소에는 input 으로 사용한다.
Posted by 영고니짱