Error (10170): Verilog HDL syntax error at .v(1) near text "201612061"; expecting an identifier
module201612061(clk,reset,clkout)inputclk;inputreset;outputclkout;reg[1:0]count;regdi...
module 201612061(clk,reset,clkout)
input clk;
input reset;
output clkout;
reg[1:0] count;
reg div1;
reg div2;
always @(posedge clk)
begin
if(reset)
count<=2'b00;
else
case(count)
2'b00:count<=2'b01;
2'b01:count<=2'b01;
2'b10:count<=2'b00;
default :count<=2'b00;
endcase
end
always @(posedge reset or posedge clk )
begin
if(reset )
div1<=1'b1;
else if(count ==2'b00)
div1<=~div1;
end
always@(posedge reset or negedge clk)
begin
if (reset)
div2<=1'b1;
else if (count==2'b10)
div2<=~div2;
end
assign clkout=div1^div2;
endmodule 展开
input clk;
input reset;
output clkout;
reg[1:0] count;
reg div1;
reg div2;
always @(posedge clk)
begin
if(reset)
count<=2'b00;
else
case(count)
2'b00:count<=2'b01;
2'b01:count<=2'b01;
2'b10:count<=2'b00;
default :count<=2'b00;
endcase
end
always @(posedge reset or posedge clk )
begin
if(reset )
div1<=1'b1;
else if(count ==2'b00)
div1<=~div1;
end
always@(posedge reset or negedge clk)
begin
if (reset)
div2<=1'b1;
else if (count==2'b10)
div2<=~div2;
end
assign clkout=div1^div2;
endmodule 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询