source:
caseStudy_Huffmann/huffmann/huff_with_env/environment.v
Last change on this file was 105, checked in by , 12 years ago | |
---|---|
File size: 393 bytes |
Line | |
---|---|
1 | module environment(clk,val,addr,ack); |
2 | input clk; |
3 | output [4:0] addr; |
4 | output val; |
5 | reg val; |
6 | input ack; |
7 | |
8 | reg addr; |
9 | initial addr = 0; |
10 | initial val = 1; |
11 | always @(posedge clk) begin |
12 | val = 0; |
13 | if(ack == 1) |
14 | begin |
15 | val = 1; |
16 | case(addr) |
17 | 0 : addr = 4; |
18 | 4 : addr = 0; |
19 | default : |
20 | addr = 0; |
21 | endcase |
22 | end |
23 | end |
24 | |
25 | |
26 | endmodule |
27 |
Note: See TracBrowser
for help on using the repository browser.