| Revision 1,
499 bytes
checked in by ttvmrc00, 15 years ago
(diff) |
|
upload iniziale
|
| Line | |
|---|
| 1 | module LShapedWire_4 (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; |
|---|
| 10 | assign B = (status == 2'b10) ? loadedB : |
|---|
| 11 | (status == 2'b01) ? (fault ? ~A : A) : 1'bz; |
|---|
| 12 | |
|---|
| 13 | initial |
|---|
| 14 | begin |
|---|
| 15 | loadedB <=1'bz; |
|---|
| 16 | end |
|---|
| 17 | always @ (posedge status[1]) |
|---|
| 18 | begin |
|---|
| 19 | if (status[0]==0) |
|---|
| 20 | begin |
|---|
| 21 | loadedB <= (B===1'bx) ? 1'bz: B; |
|---|
| 22 | end |
|---|
| 23 | end |
|---|
| 24 | endmodule |
|---|
| 25 | |
|---|
Note: See
TracBrowser
for help on using the repository browser.