急求verilog 8进制计数器程序

来源:百度知道 编辑:UC知道 时间:2024/07/04 15:28:17

//////////////////
//
//////////////////
module 8jinzhi (rst,clk,out);
//
input rst,clk;
output [2:0]out;
//
reg [2:0]out;
//
always @ (posedge clk or negedge rst )
if(!rst)
out<=3'b00;
else
out<=out+1;
endmodule
不知道要什么级别的。。。。这个行吧。。。用门电路也可以搭出来。三个D触发器或者JK触发器都可以

modulecount8(clk,reset,count);
input clk;
output[7:0] count;
reg [] count;
always@(posedge clk)
begin
if(!reset)
count<=0;
else count=count+1;
end
endmodule

我倒,这么简单的问题也来问,看来百度知道培养了太多的寄生虫了。