Professional Documents
Culture Documents
System Design Using PLL: EX - NO: 3 DATE: 3.3.2011
System Design Using PLL: EX - NO: 3 DATE: 3.3.2011
EX.NO: 3
DATE: 3.3.2011
AIM:
To design and implement a system using Phase Locked Loop (PLL) using the
Modelsim tool and to verify its operation.
ALGORITHM:
THEORY:
A Phase Locked Loop (PLL) is a closed loop feedback control system that
generates and output a signal in relation to the frequency and phase of an input signal. A
Phase Locked Loop (PLL) circuit responds to both the frequency and the phase of the input
signals, automatically raising or lowering the frequency of a control oscillator until its
matched to the reference in both frequency and phase. This type of mechanism is widely
used in radio, telecommunications, computers and other electronic applications where its
desired to stabilize a generated signal or to detect signals in the presence of noise. Since an
integrated circuit can hold a complete Phase Locked Loop (PLL) building block, the
technique widely used in modern electronic devices, with signal frequencies from a
fraction of a cycle Per second up to many gigahertz.
Frequency is the derivative of phase. Keeping the input and output phase in lock
step implies keeping the input and output frequencies in lock step. Consequently, a phase-
locked loop can track an input frequency, or it can generate a frequency that is a multiple
of the input frequency. The former property is used for demodulation, and the latter
property is used for indirect frequency synthesis.
LOGIC DIAGRAM:
PROGRAM:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity pll1 is
port(datain:in std_logic;
clock: in std_logic;
rx_clock: out std_logic;
dataout: out std_logic;
clrdcd: in std_logic;
dcd:out std_logic);
end pll1;
signal dly_data:std_logic;
signal ql:std_logic;
signal qe:std_logic;
signal enable:std_logic;
signal increment:std_logic:='0';
signal decrement:std_logic:='0';
signal clear_dcd:std_logic:='0';
signal reset_dcd:std_logic:='0';
begin
rx_clock<=counter(4);
process(clock,clrdcd,reset_dcd)
begin
if(clock'event and clock='1')then
clear_dcd<=reset_dcd or clrdcd;
end if;
end process;
process(clock,datain)
begin
if(clock'event and clock='1')then
dataout<=datain;
end if;
end process;
process(clock,enable,clrdcd)
begin
if(clock'event and clock='1')then
if(enable='1')then
counter<=counter+'1';
else
counter<=counter;
end if;
end if;
end process;
process(counter)
begin
if(counter="10000"or counter="01111")then
ql<='0';
qe<='0';
elsif(counter(4)='1')then
ql<='1';
qe<='0';
else
ql<='0';
qe<='1';
end if;
end process;
process(clock,enable,clrdcd)
begin
if(clock'event and clock='1')then
if(qe='1' and edge='1')then
increment<='1';
end if;
if(ql='1' and edge='1')then
decrement<='1';
end if;
if(enable='1')then
if(increment='1')then
increment<='0';
enable<='1';
else
enable<='0';
end if;
else
if(decrement='1')then
decrement<='0';
enable<='0';
else
enable<='1';
end if;
end if;
end if;
end process;
process(clock,edge,counter,clear_dcd)
begin
if(clear_dcd='1')then
dcd_cntr<=(others=>'0');
dcd<='0';
reset_dcd<='0';
elsif(counter(4)'event and counter(4)='0')then
if(edge='0')then
if(dcd_cntr=255)then
dcd<='1';
dcd_cntr<=dcd_cntr;
else
dcd<='0';
dcd_cntr<=dcd_cntr+1;
end if;
else
reset_dcd<='1';
end if;
end if;
end process;
process(clock,datain)
begin
if(clock'event and clock='1')then
edge<=dly_data xor datain;
dly_data<=datain;
end if;
end process;
end Behavioral;
SYNTHESIS REPORT:
================================================================
=========
* Synthesis Options Summary *
================================================================
=========
---- Source Parameters
Input File Name : "pll1.prj"
Input Format : mixed
Ignore Synthesis Constraint File : NO
================================================================
=========
================================================================
=========
* HDL Compilation *
================================================================
=========
Compiling vhdl file "E:/pll/pll.vhd" in Library work.
Architecture behavioral of Entity pll1 is up to date.
================================================================
=========
* Design Hierarchy Analysis *
================================================================
=========
Analyzing hierarchy for entity <pll1> in library <work> (architecture <behavioral>).
================================================================
=========
* HDL Analysis *
================================================================
=========
Analyzing Entity <pll1> in library <work> (Architecture <behavioral>).
WARNING:Xst:819 - "E:/pll/pll.vhd" line 120: The following signals are missing in the
process sensitivity list:
counter<4>.
Entity <pll1> analyzed. Unit <pll1> generated.
================================================================
=========
* HDL Synthesis *
================================================================
=========
================================================================
=========
HDL Synthesis Report
Macro Statistics
# Counters :2
5-bit up counter :1
8-bit up counter :1
# Registers :8
1-bit register :8
# Xors :1
1-bit xor2 :1
================================================================
=========
================================================================
=========
* Advanced HDL Synthesis *
================================================================
=========
================================================================
=========
Advanced HDL Synthesis Report
Macro Statistics
# Counters :2
5-bit up counter :1
8-bit up counter :1
# Registers :8
Flip-Flops :8
# Xors :1
1-bit xor2 :1
================================================================
=========
================================================================
=========
* Low Level Synthesis *
================================================================
=========
================================================================
=========
Final Register Report
Macro Statistics
# Registers : 22
Flip-Flops : 22
================================================================
=========
================================================================
=========
* Partition Report *
================================================================
=========
-------------------------------
================================================================
=========
* Final Report *
================================================================
=========
Final Results
RTL Top Level Output File Name : pll1.ngr
Top Level Output File Name : pll1
Output Format : NGC
Optimization Goal : Speed
Keep Hierarchy : NO
Design Statistics
# IOs :6
Cell Usage :
# BELS : 45
# GND :1
# INV :4
# LUT1 :7
# LUT2 :5
# LUT2_L :1
# LUT3 :4
# LUT3_L :1
# LUT4 :5
# LUT4_D :2
# MUXCY :7
# VCC :1
# XORCY :7
# FlipFlops/Latches : 22
# FD :4
# FDCE :8
# FDCE_1 :2
# FDE :7
# FDS :1
# Clock Buffers :1
# BUFGP :1
# IO Buffers :5
# IBUF :2
# OBUF :3
================================================================
=========
RTL SCHEMATIC:
SIMULATION RESULTS:
RESULT:
Thus the system was designed using Phase Locked Loop (PLL) using the
Modelsim tool and its operation was verified.