S
sundar
Guest
Hi All,
I need your help in understanding this fractional divider logic that
is implemented in the following code.
--******************************************************
ClkDiv2 : process(nMr, Clk78) -- divide by 38.88
variable Cnt : integer range 0 to 63;
variable SubCnt : integer range 0 to 32;
begin
if (nMr='0') then
Clk2 <= '0';
Cnt := 0;
SubCnt := 0;
elsif rising_edge(Clk78) then
if (Cnt>18) then
Clk2 <= '1';
else
Clk2 <= '0';
end if;
if (Cnt>37) or ((Cnt>36) and ((SubCnt=0) or (SubCnt=8) or
(SubCnt=17))) then
Cnt := 0;
if (SubCnt>23) then
SubCnt := 0;
else
SubCnt := SubCnt+1;
end if;
else
Cnt := Cnt+1;
end if;
end if;
end process;
--***************************************************
can you explain how the clock division factors for "divide by 38.88"
are achieved?
can you provide any algorithm/formulae for reference?
Regards,
Sundar
I need your help in understanding this fractional divider logic that
is implemented in the following code.
--******************************************************
ClkDiv2 : process(nMr, Clk78) -- divide by 38.88
variable Cnt : integer range 0 to 63;
variable SubCnt : integer range 0 to 32;
begin
if (nMr='0') then
Clk2 <= '0';
Cnt := 0;
SubCnt := 0;
elsif rising_edge(Clk78) then
if (Cnt>18) then
Clk2 <= '1';
else
Clk2 <= '0';
end if;
if (Cnt>37) or ((Cnt>36) and ((SubCnt=0) or (SubCnt=8) or
(SubCnt=17))) then
Cnt := 0;
if (SubCnt>23) then
SubCnt := 0;
else
SubCnt := SubCnt+1;
end if;
else
Cnt := Cnt+1;
end if;
end if;
end process;
--***************************************************
can you explain how the clock division factors for "divide by 38.88"
are achieved?
can you provide any algorithm/formulae for reference?
Regards,
Sundar