终于会把几个verilog文件合并在一个bdf文件中
拿了块avr开发板做FPGA底板,很不错,虽然功能少了点,以后要搞带flash、sram、ps2、vga的板子
=========================================================================
module ls160 (clk,load,clr,enp,ent,data,q,rco);
input clk;
input load;
input clr;
input enp;
input ent;
input [3:0]data;
output rco;
output [3:0]q;
wire [3:0] data;
reg [3:0] q;
reg rco;
always @(posedge clk or negedge load or negedge clr )
begin
if(clr==0)
q <= 4'b0000;
else if(load==0)
begin
q[3] <= data[3];
q[2] <= data[2];
q[1] <= data[1];
q[0] <= data[0];
end
else if(enp==1 && ent==1)
begin
if(q==9)
begin
rco <= 1;
q <= 0;
end
else
begin
rco <= 0;
q <= q+1;
end
end
end
endmodule
===========================================================================
74ls160主程序
74LS160 功能表
/CLR /LOAD ENP ENT 输出
L X X X 清零
H L X X 置数
H H L X 保持
H H X L 保持
H H H H 计数