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