source: caseStudy_Huffmann/huffmann/huff_with_env/environment.v @ 106

Last change on this file since 106 was 105, checked in by cecile, 12 years ago

Hufmann case study

File size: 393 bytes
Line 
1module 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
26endmodule
27
Note: See TracBrowser for help on using the repository browser.