input clk_48m,data_rd,ret,rd,rw,Grating_a,Grating_b;
input [8:0]addr;
output out_door;
inout [7:0]data;
reg flag;
reg [23:0]step;
reg [23:0]pul_counter;
reg [5:0]clk_div1m;
reg [23:0]den;
reg [23:0]counter;
reg [23:0]counter_now;
reg [19:0]Grating_counter;
reg [7:0]com;
reg [7:0]databuff;
reg out=0;
reg data_link;
reg direct;
assign data=data_link?databuff:8'bzzzzzzzz;
assign out_door=out&flag;
always@(podge clk_48m)
if(clk_div1m<6'h2e)
clk_div1m <=clk_div1m+1;
el
clk_div1m<=0;
assign clk_1m=(clk_div1m==6'h2e);
always @(podge clk_1m)
begin
if(!ret)
begin
counter_now<=24'b1111_1111_1111_1111_1111_1111;
end
el if(com[0:0]==1'b1)
begin
if(counter_now>den)
begin
counter_now<=counter_now-1;
end
el
金针菇娃娃菜begin
end
end
el
begin
end
end
always @(podge clk_48m)
begin
if(!ret)
begin
counter<=0;属狗的性格
end
el if(com[0:0]==1'b1)
固态硬盘的优点
begin
if(counter==counter_now-1)
特种设备安装begin
counter<=0;
out=~out;
end
el
begin
counter<=counter+1;
end
end
el
begin
end
end
always @ (podge out)
begin
if(!ret)
begin
flag<=1;
pul_counter<=0;
end
el
begin
if(pul_counter==step)
begin
flag<=0;
熊猫为什么吃竹子pul_counter<=0;
end
el pul_counter<=pul_counter+1;
end
end
always@(podge Grating_a)
if(Grating_b==1)
direct=1;
el direct=0;
always@(podge Grating_a)
begin
if(!ret)
Grating_counter=0;
el if(direct==1)
Grating_counter<=Grating_counter+1;
el Grating_counter<=Grating_counter-1;
end
always @(podge clk_48m)
begin
if(!ret)
begin
data_link<=1'b0;
end
el if(rw)
begin
data_link<=1'b1;
end
end7月里番
always @( podge clk_48m )
begin
一朵玫瑰代表什么if(!ret)
begin
step<=0;
den<=0;
com<=0;
end
el if(data_rd&rw&!rd)
ca(addr)
3'b000 : den[7:0]<= data;
3'b001 : den[15:8]<= data;
3'b010 : den[23:16]<=data;
3'b011 : step[7:0]<= data;
3'b100 : step[15:8]<= data;
3'b101 : step[23:16]<=data;
3'b110 : com[7:0]<=data;//数据传送完毕
endca
el
begin
end
end
always @(podge clk_48m)
begin
if(!ret)
begin
databuff<=0;
end
el if(data_rd&rd&!rw)
ca(addr)
8'h00:databuff<=den[7:0];
8'h01:databuff<=d
en[15:8];
8'h02:databuff<=den[23:16];
8'h03:databuff<=step[7:0];
8'h04:databuff<=step[15:8];
8'h05:databuff<=step[23:16];
8'h06:databuff<=com[7:0];乌龟白眼病怎么办
8'h07:databuff<=Grating_counter[7:0];
8'h08:databuff<=Grating_counter[15:8];
8'h09:databuff<={4'h0,Grating_counter[19:16]};
endca
el
begin
end
end
endmodule