⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitreg.v

📁 Viertex 2 开发板的接口程序
💻 V
字号:
//     XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS"
//     SOLELY FOR USE IN DEVELOPING PROGRAMS AND SOLUTIONS FOR
//     XILINX DEVICES.  BY PROVIDING THIS DESIGN, CODE, OR INFORMATION
//     AS ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION
//     OR STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS
//     IMPLEMENTATION IS FREE FROM ANY CLAIMS OF INFRINGEMENT,
//     AND YOU ARE RESPONSIBLE FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE
//     FOR YOUR IMPLEMENTATION.  XILINX EXPRESSLY DISCLAIMS ANY
//     WARRANTY WHATSOEVER WITH RESPECT TO THE ADEQUACY OF THE
//     IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OR
//     REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE FROM CLAIMS OF
//     INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
//     FOR A PARTICULAR PURPOSE.
//
//     (c) Copyright 2004 Xilinx, Inc.
//     All rights reserved.
//
/*
------------------------------------------------------------------------------
-- Title      : Addressable Bit Register
-- Project    : XUP Virtex-II Pro Demonstration System
-------------------------------------------------------------------------------
-- File       : bitreg.v
-- Company    : Xilinx Inc
-- Created    : 2001/03/15
-- Last update: 2001/03/15
-- Copyright  : (c) Xilinx Inc 2001
-------------------------------------------------------------------------------
-- Uses       : 
-------------------------------------------------------------------------------
-- Used by    : onewire_master.v
-------------------------------------------------------------------------------
-- Description:  A eight bit addressable register
-------------------------------------------------------------------------------
*/


module BITREG (clk, reset, din, en, dout);

input clk;
input reset;
input din;
input [7:0] en;
output [7:0] dout;

reg [7:0] dout;

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[0] <= 1'b0;
		end
	else if (en[0]) begin
		dout[0] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[1] <= 1'b0;
		end
	else if (en[1]) begin
		dout[1] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[2] <= 1'b0;
		end
	else if (en[2]) begin
		dout[2] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[3] <= 1'b0;
		end
	else if (en[3]) begin
		dout[3] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[4] <= 1'b0;
		end
	else if (en[4]) begin
		dout[4] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[5] <= 1'b0;
		end
	else if (en[5]) begin
		dout[5] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[6] <= 1'b0;
		end
	else if (en[6]) begin
		dout[6] <= din;
		end
	end

always @ (posedge clk or posedge reset) begin
	if (reset) begin
		dout[7] <= 1'b0;
		end
	else if (en[7]) begin
		dout[7] <= din;
		end
	end
endmodule

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -