source: trunk/MultiChannelUSB/adc_lvds.v@ 43

Last change on this file since 43 was 42, checked in by demin, 15 years ago

code cleanup

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