| Revision 1,
            757 bytes
            checked in by ttvmrc00, 15 years ago
            (diff) | 
        
        
          | 
               
upload iniziale 
 
           | 
        
      
      
        
  | Line |   | 
|---|
| 1 | module Fanout_A4 (A, B, C, status, fault); | 
|---|
| 2 | //   A | 
|---|
| 3 | //   |- C | 
|---|
| 4 | //   B | 
|---|
| 5 | //forward =1 information goes A-> B & C | 
|---|
| 6 | //status 00=relax,01=switch, 10=hold, 11=release | 
|---|
| 7 | // if fault =1 the out is inverted if in the "L shaped " path (C) | 
|---|
| 8 |         input [1:0] status; | 
|---|
| 9 |         input fault; | 
|---|
| 10 |         input A; | 
|---|
| 11 |         output B,C; | 
|---|
| 12 |         reg loadedB,loadedC; | 
|---|
| 13 |         wor A,B,C; | 
|---|
| 14 |  | 
|---|
| 15 |  | 
|---|
| 16 | assign B =  (status == 2'b10) ? loadedB : | 
|---|
| 17 |             (status == 2'b01) ? A  : 1'bz; | 
|---|
| 18 |  | 
|---|
| 19 | assign C =  (status == 2'b10) ? loadedC : | 
|---|
| 20 |             (status == 2'b01) ? (fault ? ~A : A)  : 1'bz; | 
|---|
| 21 |  | 
|---|
| 22 |              | 
|---|
| 23 | initial | 
|---|
| 24 | begin | 
|---|
| 25 |         loadedB <=1'bz; | 
|---|
| 26 |         loadedC <=1'bz; | 
|---|
| 27 | end | 
|---|
| 28 |  | 
|---|
| 29 | always @ (posedge status[1]) | 
|---|
| 30 |         begin | 
|---|
| 31 |          | 
|---|
| 32 |  | 
|---|
| 33 |                                 loadedB <= (B===1'bx)? 1'bz: B; | 
|---|
| 34 |                                 loadedC <= (C===1'bx)? 1'bz: C; | 
|---|
| 35 |          | 
|---|
| 36 |         end | 
|---|
| 37 |  | 
|---|
| 38 |  | 
|---|
| 39 | always@(posedge status[0]) | 
|---|
| 40 |         begin | 
|---|
| 41 |                 loadedA <= 1'bz; | 
|---|
| 42 |                 loadedB <= 1'bz; | 
|---|
| 43 |         end      | 
|---|
| 44 |  | 
|---|
| 45 |  | 
|---|
| 46 | endmodule | 
|---|
       
      Note: See 
TracBrowser
        for help on using the repository browser.