source: trunk/MultiChannelUSB/adc_lvds.v@ 47

Last change on this file since 47 was 44, checked in by demin, 15 years ago

add baseline subtraction

File size: 1.2 KB
Line 
1module adc_lvds
2 (
3 input wire lvds_dco,
4 input wire lvds_fco,
5 input wire [2:0] lvds_d,
6
7 output reg [11:0] adc_db,
8 output reg [11:0] adc_dc,
9 output reg [11:0] adc_dd
10 );
11
12 wire [2:0] int_data_h, int_data_l;
13 reg [11:0] int_data_next [2:0];
14 reg [11:0] int_data_reg [2:0];
15
16 altddio_in #(
17 .intended_device_family("Cyclone III"),
18 .invert_input_clocks("ON"),
19 .lpm_type("altddio_in"),
20 .width(3)) altddio_in_unit (
21 .datain(lvds_d),
22 .inclock(lvds_dco),
23 .aclr(1'b0),
24 .dataout_h(int_data_h),
25 .dataout_l(int_data_l),
26 .aset(1'b0),
27 .inclocken(1'b1),
28 .sclr(1'b0),
29 .sset(1'b0));
30
31 always @ (posedge lvds_dco)
32 begin
33 int_data_reg[0] <= int_data_next[0];
34 int_data_reg[1] <= int_data_next[1];
35 int_data_reg[2] <= int_data_next[2];
36 end
37
38 always @ (posedge lvds_fco)
39 begin
40 adc_db <= int_data_next[0];
41 adc_dc <= int_data_next[1];
42 adc_dd <= int_data_next[2];
43 end
44
45 always @*
46 begin
47 int_data_next[0] = {int_data_reg[0][9:0], int_data_l[0], int_data_h[0]};
48 int_data_next[1] = {int_data_reg[1][9:0], int_data_l[1], int_data_h[1]};
49 int_data_next[2] = {int_data_reg[2][9:0], int_data_l[2], int_data_h[2]};
50 end
51
52endmodule
Note: See TracBrowser for help on using the repository browser.