Revision 1,
1.0 KB
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
Line | |
---|
1 | module Fanout_bi4 (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 | |
---|
38 | begin |
---|
39 | loadedA <= (A===1'bx)? 1'bz: A; |
---|
40 | loadedB <= (B===1'bx)? 1'bz: B; |
---|
41 | loadedC <= (C===1'bx)? 1'bz: C; |
---|
42 | end |
---|
43 | |
---|
44 | always@(posedge status[0]) |
---|
45 | begin |
---|
46 | loadedA <= 1'bz; |
---|
47 | loadedB <= 1'bz; |
---|
48 | loadedC <= 1'bz; |
---|
49 | end |
---|
50 | |
---|
51 | endmodule |
---|
Note: See
TracBrowser
for help on using the repository browser.