赞
踩
module yzs_reveriblecounter(data,clk,clr,s,en,updn,count,cin);
input [3:0]data;
input clk,clr,s,en,updn;
output [3:0]count;
output cin;
reg [3:0]count;
reg cin;
always @(posedge clk)
begin
if(clr) count<=0;
else
begin
if(s)
count<=data;
else
begin
if(en)
begin
if(updn)
begin
if(count==15)
begin count<=0;cin<=1;end
else
begin count<=count+1;cin<=0;end
end
else
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。