ikevin
Newbie level 5
Hi,
I have a Virtex 5 board and I would like to interface a high-speed DAC and ADC to it.
I have differential 16 bits data and 1 clock in + 1 clock out total. Can I do something like this for differential signals?
If there is a better way to do it, please let me know. Thanks a lot.
I have a Virtex 5 board and I would like to interface a high-speed DAC and ADC to it.
I have differential 16 bits data and 1 clock in + 1 clock out total. Can I do something like this for differential signals?
Code:
// ADC part
// check Postive and Negage parts of the clock
always @ (CLOCK_IN_P or CLOCK_IN_N)
begin
CLOCK_IN <= ~CLOCK_IN;
end
// do the same for DATA1 to DATA15
always @ (DATA0_P or DATA0_N)
begin
if (DATA0_P == 1 && DATA0_N == 0)
DATA0 <= 1;
else if (DATA0_P == 0 && DATA0_N == 1)
DATA0 <= 0;
end
// grab the DATA
always @ (posedge CLOCK_IN)
begin
DATA_REG[0]<=DATA0;
DATA_REG[1]<=DATA1;
DATA_REG[2]<=DATA2;
// ... do the same until DATA15
// let the DAC know we're done, lets clock out
CLOCK_OUT <= ~CLOCK_OUT;
end
// DAC clock out part
always @ (posedge CLOCK_OUT)
begin
CLOCK_OUT_P <= 1;
CLOCK_OUT_N <= 0;
end
always @ (negedge CLOCK_OUT)
begin
CLOCK_OUT_P <= 0;
CLOCK_OUT_N <= 1;
end
If there is a better way to do it, please let me know. Thanks a lot.