always @(posedge clock or negedge resetb )
begin
if ( ~ resetb )
begin
counter <= 8'h00 ;
end
else if ( counter == freq_div - 1 )
begin
counter <= 8'h00 ;
end
else
begin
counter <= counter + 1'b1 ;
end
end
always @(posedge clock or negedge resetb )
begin
if ( ~ resetb )
begin
freq_even <= 1'b0 ;
end
else if ( freq_divid[0] == 1'b0 )
begin
if ( counter == freq_div2 - 1 )
begin
freq_even <= 1'b1 ;
end
else if ( counter == freq_div - 1 )
begin
freq_even <= 1'b0 ;
end
end
else
begin
freq_even <= 1'b0 ;
end
end
always @(posedge clock or negedge resetb )
begin
if ( ~ resetb )
begin
freq_odd0 <= 1'b0 ;
end
else if ( freq_divid[0] == 1'b1 )
begin
if ( counter == freq_div2 - 1 )
begin
freq_odd0 <= 1'b1 ;
end
else if ( counter == freq_div - 1 )
begin
freq_odd0 <= 1'b0 ;
end
end
else
begin
freq_odd0 <= 1'b0 ;
end
end
always @(negedge clock or negedge resetb )
begin
if ( ~ resetb )
begin
freq_odd1 <= 1'b0 ;
end
else
begin
freq_odd1 <= freq_odd0 ;
end
end