- Timestamp:
- Jun 26, 2011, 11:07:28 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/MultiChannelUSB/amplitude.v
r123 r155 16 16 reg [width-1:0] int_mini_reg, int_mini_next; 17 17 reg [width-1:0] out_data_reg, out_data_next; 18 reg [width-1:0] inp_data_reg , inp_data_next;18 reg [width-1:0] inp_data_reg [1:0], inp_data_next [1:0]; 19 19 20 20 wire int_comp_wire; 21 21 reg int_comp_reg, int_comp_next; 22 22 23 assign int_comp_wire = (inp_data_reg < inp_data);23 assign int_comp_wire = (inp_data_reg[1] < inp_data); 24 24 25 25 always @(posedge clock) … … 29 29 int_case_reg <= 1'b0; 30 30 int_mini_reg <= {(width){1'b0}}; 31 inp_data_reg <= {(width){1'b0}}; 31 inp_data_reg[0] <= {(width){1'b0}}; 32 inp_data_reg[1] <= {(width){1'b0}}; 32 33 out_data_reg <= {(width){1'b0}}; 33 34 out_flag_reg <= 1'b0; … … 39 40 int_case_reg <= int_case_next; 40 41 int_mini_reg <= int_mini_next; 41 inp_data_reg <= inp_data_next; 42 inp_data_reg[0] <= inp_data_next[0]; 43 inp_data_reg[1] <= inp_data_next[1]; 42 44 out_data_reg <= out_data_next; 43 45 out_flag_reg <= out_flag_next; … … 51 53 int_case_next = int_case_reg; 52 54 int_mini_next = int_mini_reg; 53 inp_data_next = inp_data_reg; 55 inp_data_next[0] = inp_data_reg[0]; 56 inp_data_next[1] = inp_data_reg[1]; 54 57 out_data_next = out_data_reg; 55 58 out_flag_next = out_flag_reg; … … 62 65 if (frame) 63 66 begin 64 inp_data_next = inp_data; 67 inp_data_next[0] = inp_data; 68 inp_data_next[1] = inp_data_reg[0]; 65 69 int_comp_next = int_comp_wire; 66 70 out_data_next = {(width){1'b0}}; … … 69 73 if ((~int_comp_reg) & (int_comp_wire)) 70 74 begin 71 int_mini_next = inp_data_reg ;75 int_mini_next = inp_data_reg[0]; 72 76 int_flag_next = 1'b1; 73 77 end … … 75 79 else if ((int_comp_reg) & (~int_comp_wire) & (int_flag_reg)) 76 80 begin 77 out_data_next = inp_data_reg - int_mini_reg;81 out_data_next = inp_data_reg[0] - int_mini_reg; 78 82 int_flag_next = 1'b0; 79 83 int_case_next = 1'b1;
Note:
See TracChangeset
for help on using the changeset viewer.