verilog代码集锦.rar

源代码在线查看: lfsr_updown.v

软件大小: 37 K
上传用户: soft0318
关键词: verilog 代码 集锦
下载地址: 免注册下载 普通下载 VIP

相关代码

				`define WIDTH 8				module lfsr_updown(				clk,           //Clock input				reset,         //Reset input				enable,        //Enable input				up_down,       //Up Down input				count,         //Count output				overflow       //Overflow output				);								input clk;				input reset;				input enable;				input up_down;								output[`WIDTH-1:0]count;				output overflow;								reg[`WIDTH-1:0]count;								assign overflow=(up_down)?(count=={{`WIDTH-1{1'b0}},1'b1}):(count=={1'b1,{`WIDTH-1{1'b0}}});								always@(posedge clk)				if(reset)					 count				else if(enable)begin					  if(up_down)begin					  	count					  end					else begin 						  count					end				end				endmodule																			

相关资源