Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17255 Обсуждение

Sine wave to Digital clock..

Altera_Forum
Почетный участник II
2 415Просмотр.

I know this might be a strange question coz sine wave can be used as a clock, but I really wanna know the best to cut my sine wave from both sides to produce a digital clock. 

 

I tried using verilog "assign x=(y==1) ? 1:0;" y is the sine wave and x is my clock output, but the compiler is clever enough to actually wire both x and y, even if i use synthesis keep. 

 

Is there a better way to perform such a task using an fpga?
0 баллов
7 Ответы
Altera_Forum
Почетный участник II
1 167Просмотр.

 

--- Quote Start ---  

y is the sine wave 

--- Quote End ---  

very unlikely! 

 

Where y is originated from? I guess it's from a digital input pin, it can't represent an analog signal.
Altera_Forum
Почетный участник II
1 167Просмотр.

 

--- Quote Start ---  

very unlikely! 

 

Where y is originated from? I guess it's from a digital input pin, it can't represent an analog signal. 

--- Quote End ---  

 

 

"y" is generated from an external function generator and inputted to the FPGA. 

x is the output, which is supposed to be the sine wave after cutting its top and buttom.
Altera_Forum
Почетный участник II
1 167Просмотр.

I am not clear on what it is you are trying to do. 

 

Are you trying to convert an analogue Voltage representing a sine wave into a square wave clock for use inside an FPGA? 

 

You must do this externally to the FPGA with something like a Schmitt trigger or other circuity 

 

FPGA's are digital only e.g. LVTTL, CMOS Levels etc
Altera_Forum
Почетный участник II
1 167Просмотр.

yes, but I thought I would be able to do the following: 

when sinewave > fpga threashold , fpga will output 1. 

when sinewave < fpga threashold , fpga will output 0. 

 

so if I use a sinewave with a minimum value = 0, that is a normal sinewave with a positive offset, the fpga will act as if its cutting the upper and lower edges of the sinewave and outputs a clock.. 

 

isnt that right?
Altera_Forum
Почетный участник II
1 167Просмотр.

If you have a sinewave described with N bits (all positive values as you say) the MSB (most significant bit) of your sinewave will be your clock signal. 

 

Cheers 

OD
Altera_Forum
Почетный участник II
1 167Просмотр.

 

--- Quote Start ---  

yes, but I thought I would be able to do the following: 

when sinewave > fpga threashold , fpga will output 1. 

when sinewave < fpga threashold , fpga will output 0. 

 

so if I use a sinewave with a minimum value = 0, that is a normal sinewave with a positive offset, the fpga will act as if its cutting the upper and lower edges of the sinewave and outputs a clock.. 

 

isnt that right? 

--- Quote End ---  

 

 

Hi sonaiko, 

 

you have to keep in mind the maximum allowed I/O voltage ( depends on the Device family). Negative voltage should be avoided ( could damage your device). But with this restriction it should work. I'm not sure, but maybe your duty cycle is not exactly 50 %. 

There is no need to implement a "slicer" inside the FPGA, the I/O cell will do it .
Altera_Forum
Почетный участник II
1 167Просмотр.

I'd say it will probably work as long as the signal on the pin stays within the limits in the device datasheet. 

 

The duty cycle will depend on the actual signal levels and the logic thresholds of the device. If it's a slow/noisy signal you might get multiple transitions as the signal crosses the logic threshold so you'll probably have to debounce the input (debounce methods have been discussed elsewhere on the forums). 

 

Others with more knowledge on the subject might be able to comment on possible increased power dissipation.
Ответить