Revision 1,
715 bytes
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
Rev | Line | |
---|
[1] | 1 | module LShapedWire_bi4 (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,C; |
---|
| 10 | assign C = A; |
---|
| 11 | assign C = B; |
---|
| 12 | assign B = (status == 2'b10) ? loadedB : |
---|
| 13 | (status == 2'b01) ? (fault ? ~C : C) : 1'bz; |
---|
| 14 | assign A = (status == 2'b10) ? loadedA : |
---|
| 15 | (status == 2'b01) ? (fault ? ~C : C) : 1'bz; |
---|
| 16 | initial |
---|
| 17 | begin |
---|
| 18 | loadedA <=1'bz; |
---|
| 19 | loadedB <=1'bz; |
---|
| 20 | end |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | always@(posedge status[1]) |
---|
| 24 | begin |
---|
| 25 | loadedA <= (A===1'bx)? 1'bz: A; |
---|
| 26 | loadedB <= (B===1'bx)? 1'bz: B; |
---|
| 27 | end |
---|
| 28 | |
---|
| 29 | always@(posedge status[0]) |
---|
| 30 | begin |
---|
| 31 | loadedA <= 1'bz; |
---|
| 32 | loadedB <= 1'bz; |
---|
| 33 | end |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | endmodule |
---|
| 37 | |
---|
Note: See
TracBrowser
for help on using the repository browser.