OpenCores
URL https://opencores.org/ocsvn/dpll-isdn/dpll-isdn/trunk

Subversion Repositories dpll-isdn

[/] [dpll-isdn/] [trunk/] [Sources/] [phasecomparator.v] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dmsu
 
2
/* phase comparator */
3
module phasecomparator(InputSignal, OutputSignal, MainClock, Lead, Lag);
4
 
5
input InputSignal, OutputSignal;    // PLL input(reference) and output(dejittered clock) signals
6
input MainClock;                    // System Clock
7
output Lead, Lag;                   // Lead and Lag signals
8
 
9
reg [1:0] InputSignalEdgeDet;       // detector of the rising edge
10
always @(posedge MainClock)
11
 begin
12
  InputSignalEdgeDet <= { InputSignalEdgeDet[0], InputSignal };
13
 end
14
 
15
 
16
/* this signal checked at rising edge of MainClock.       */
17
/* It's simple detector of the Input signal rising edge - */
18
/* When it detected then we check the level of the output.*/
19
/* There is possible to place additional 2 registers for  */
20
/* output signal for eliminatig  the cmp. constant phase error */
21
wire InputSignalEdge = (InputSignalEdgeDet == 2'b01);
22
 
23
/* "Lead" signal will be generate in case of output==1 during input rising edge*/
24
reg Lead, Lag;                   // outputs "Lead", "Lag" are registered
25
always @(posedge MainClock)
26
 begin
27
  Lag  <= ((InputSignalEdge == 1'b1)  && (OutputSignal == 1'b0));
28
  Lead <= ((InputSignalEdge == 1'b1)  && (OutputSignal == 1'b1));
29
 end
30
 
31
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.