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