Forum Discussion
Altera_Forum
Honored Contributor
13 years agoDear FvM,
I tried 3-Bit modulo 5 counter as per your suggestion. However, the clock signal is not regenerate smoothly and the flip-flop logic seem different.Herewith I attach the picture of the signals. From bottom; D0 (GPIO_0[0]), D1 (GPIO_0[1]), D2 (GPIO_0[2]), D3 (GPIO_0[3]) and D7 (GPIO_0[7]) at top. https://www.alteraforum.com/forum/attachment.php?attachmentid=7087 Its generate from .bdf, .v and .sdc https://www.alteraforum.com/forum/attachment.php?attachmentid=7088module bitmodulo5(
CLOCK_50,
GPIO_0,
VCC
);
input CLOCK_50;
input VCC;
output GPIO_0;
assign GPIO_0 = CLOCK_50;
assign GPIO_0 = VCC;
// Instantiation:
JKFF JKFF_inst
(.j(GPIO_0), .k(GPIO_0),
.clk(CLOCK_50), .clrn(GPIO_0), .prn(GPIO_0),
.q(GPIO_0));
JKFF JKFF_inst1
(.j(GPIO_0), .k(GPIO_0),
.clk(CLOCK_50), .clrn(GPIO_0), .prn(GPIO_0),
.q(GPIO_0));
JKFF JKFF_inst2
(.j(GPIO_0), .k(GPIO_0),
.clk(CLOCK_50), .clrn(GPIO_0), .prn(GPIO_0),
.q(GPIO_0));
endmodule #Constrain the base clock
create_clock -add -period 10.000
-waveform { 0.000 5.000 }
-name CLOCK_50
# Constrain the divide by 2 register clock
create_generated_clock -add -source CLOCK_50
-name div2clock
-divide_by 2
-master_clock CLOCK_50
create_generated_clock -add -source CLOCK_60
-name div2clock
-divide_by 2
-master_clock CLOCK_50
create_generated_clock -add -source CLOCK_70
-name div2clock
-divide_by 2
-master_clock CLOCK_50
report_ucp -summary I know there is something wrong with my Clock Constraint. The execution done without error. Which part should I do to generate smooth clock and correct flip-flop logic? Thank you in advance!