Query on fractional divider logic

Status
Not open for further replies.

sundar_ece

Newbie level 1
Joined
Dec 29, 2008
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
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
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…