source: HDLQ/Library/LShapedWire4.v @ 1

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

upload iniziale

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