자꾸 까먹는다. 까먹지말자!
output 은 enable 이 있을경우만 트리거 해주고, 평소에는 input 으로 사용한다.
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 으로 사용한다.
'STUDY > 전공' 카테고리의 다른 글
| 802.11 SDL 중 몇가지 유의사항 (1) | 2008/01/09 |
|---|---|
| 드디어 소프트웨어 설계 끝났다!! 이제 구조 설계 해야지 (0) | 2007/12/13 |
| inout port 사용법 (1) | 2007/11/06 |
| 802.11 Wireless LAN (0) | 2007/07/18 |
| FPGA 기반의 하드웨어 시스템 개발에 관련된 잡지식? (0) | 2007/07/06 |
| 잠시 외도 (2) | 2007/06/27 |