source:
vis_dev/vis-2.3/models/transition/modele.v
@
104
Last change on this file since 104 was 99, checked in by , 12 years ago | |
---|---|
File size: 408 bytes |
Line | |
---|---|
1 | module simple(ck,i,t); |
2 | input ck; |
3 | input i; |
4 | output t; |
5 | |
6 | wire nd_t; |
7 | |
8 | assign nd_t = $ND(0,1); |
9 | |
10 | reg [1:0]state; |
11 | reg t; |
12 | |
13 | initial state = 0; |
14 | initial t = $ND(0,1); |
15 | |
16 | always @(posedge ck) |
17 | begin |
18 | case (state) |
19 | 0 : |
20 | begin |
21 | t = (i == 0)?nd_t:1; |
22 | state = (i == 0)?0:1; |
23 | end |
24 | 1: |
25 | begin |
26 | t =nd_t; |
27 | state = 2; |
28 | end |
29 | 2: begin |
30 | t = nd_t; |
31 | state = 2; |
32 | end |
33 | endcase |
34 | end |
35 | |
36 | endmodule |
37 | |
38 |
Note: See TracBrowser
for help on using the repository browser.