解调模块
module Ask_two(clk,reset,x,y); input clk; input reset; input x; output y;
reg y;
reg[2:0]cnt; reg[2:0]m;
always@(posedge clk)begin
if(!reset)begin
cnt<=3'b000; end
else if(cnt==3'b111) cnt<=3'b000; else
cnt<=cnt+1; end
always@(posedge x)begin if(!reset)begin m<=3'b000; end
else begin
if(cnt==3'b110)begin if(m<=3'b010) y<=1'b0; else
y<=1'b1; m<=3'b000; end else
m<=m+1; end end
endmodule
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>