Revision 1,
416 bytes
checked in by ttvmrc00, 14 years ago
(diff) |
upload iniziale
|
Rev | Line | |
---|
[1] | 1 | module Wire_4 (A, B, status); |
---|
| 2 | //forward =1 information goes A-> B |
---|
| 3 | //status 00=relax,01=switch, 10=hold, 11=release |
---|
| 4 | input [1:0] status; |
---|
| 5 | inout B; |
---|
| 6 | input A; |
---|
| 7 | reg loaded,regg; |
---|
| 8 | wor B,A; |
---|
| 9 | assign B = (status == 2'b10) ? loaded : |
---|
| 10 | (status == 2'b01) ? A : |
---|
| 11 | 1'bz; |
---|
| 12 | initial |
---|
| 13 | loaded =1'bZ; |
---|
| 14 | |
---|
| 15 | always @(posedge status[1]) |
---|
| 16 | begin |
---|
| 17 | if (status[0]==0) |
---|
| 18 | begin |
---|
| 19 | loaded <= (A===1'bx)? 1'bz : A; |
---|
| 20 | end |
---|
| 21 | end |
---|
| 22 | endmodule |
---|
Note: See
TracBrowser
for help on using the repository browser.