source: HDLQ/Library/Inverter4.v @ 1

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

upload iniziale

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