source: HDLQ/Library/Wire4.v @ 1

Revision 1, 416 bytes checked in by ttvmrc00, 13 years ago (diff)

upload iniziale

Line 
1module Wire_4 (A, B, status);
2//forward =1 information goes A-> B
3//status 00=relax,01=switch, 10=hold, 11=release
4        input [1:0] status;
5        inout B;
6        input A;
7        reg loaded,regg;
8        wor B,A;
9assign B =  (status == 2'b10) ? loaded :
10            (status == 2'b01) ?  A     :
11             1'bz;
12initial
13loaded =1'bZ;
14
15always @(posedge status[1])
16        begin
17                if (status[0]==0)
18                        begin
19                                loaded <= (A===1'bx)? 1'bz : A;
20                        end
21        end
22endmodule
Note: See TracBrowser for help on using the repository browser.