Changeset 84 for trunk/MultiChannelUSB/uwt_bior31.v
- Timestamp:
- Dec 21, 2009, 5:09:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/uwt_bior31.v
r72 r84 16 16 localparam index2 = 2 << (L - 1); 17 17 localparam index3 = 3 << (L - 1); 18 localparam peak_index = (( 3 << (L - 1)) + 1) >>1;18 localparam peak_index = ((index3 + 1) >> 1) + 1; 19 19 localparam peak_shift = ((L - 1) << 1) + (L - 1); 20 20 localparam zero = 32'h80000000; … … 26 26 reg [31:0] a_reg, a_next; 27 27 reg [31:0] peak_reg, peak_next; 28 29 reg [31:0] tmp1_reg, tmp1_next; 30 reg [31:0] tmp2_reg, tmp2_next; 31 32 reg less_reg, less_next; 33 reg more_reg, more_next; 28 34 29 35 reg [1:0] flag_reg; … … 39 45 peak_reg <= 0; 40 46 flag_reg <= 0; 47 tmp1_reg <= 0; 48 tmp2_reg <= 0; 49 less_reg <= 1'b0; 50 more_reg <= 1'b0; 41 51 42 52 for(i = 0; i <= index3; i = i + 1) … … 51 61 peak_reg <= peak_next; 52 62 53 flag_reg[0] <= (d_reg > zero) & (d_next <= zero); 54 flag_reg[1] <= (d_reg < zero) & (d_next >= zero); 55 63 tmp1_reg <= tmp1_next; 64 tmp2_reg <= tmp2_next; 65 less_reg <= less_next; 66 more_reg <= more_next; 67 68 flag_reg[0] <= (more_reg) & (~more_next); 69 flag_reg[1] <= (less_reg) & (~less_next); 70 56 71 // Tapped delay line: shift one 57 72 for(i = 0; i < index3; i = i + 1) … … 70 85 // The coefficients are [1, 3, -3, -1] and [1, 3, 3, 1] 71 86 87 tmp1_next = tap[index3] + {tap[index2][30:0], 1'b0} + tap[index2]; 88 tmp2_next = {tap[index1][30:0], 1'b0} + tap[index1] + tap[0]; 89 90 d_next = zero - tmp1_reg + tmp2_reg; 91 a_next = tmp1_reg + tmp2_reg; 92 93 more_next = (d_reg > zero); 94 less_next = (d_reg < zero); 95 96 /* 72 97 d_next = zero - (tap[index3]) 73 98 - (tap[index2] << 1) - tap[index2] … … 76 101 77 102 a_next = (tap[index3]) 78 + (tap[index2] << 1)+ tap[index2]103 + {tap[index2] << 1} + tap[index2] 79 104 + (tap[index1] << 1) + tap[index1] 80 105 + (tap[0]); 81 106 */ 82 107 peak_next = (tap[peak_index] >> peak_shift); 83 108 end
Note:
See TracChangeset
for help on using the changeset viewer.