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

📄 gcnte5_2.vhd

📁 VHDLVERILOG语言实现的CARDBUS的IP源码,已经实现现场应用
💻 VHD
字号:
--------------------------------------------------------------------------------
--
-- File : gcnte5_2.vhd
-- Last Modification: 06/26/2001
--
-- Created In SpDE Version: SpDE 8.22
-- Author :	Richard Yuan, QuickLogic Corporation
-- Copyright (C) 2001, Licensed customers of QuickLogic may copy and modify
-- this file for use in designing with QuickLogic devices only.
--	
-- Description :
--	5-bit grey counter with a reset value of 1.
--
-- Hierarchy:
--	This file represents the gcnte5_2 block in f32a32.sch.
--
-- History:	
--	Date	        Author					Version
--  06/26/01		Richard Yuan			1.0
--		- Header added to conform to coding standard.
--
--------------------------------------------------------------------------------


library ieee;
use ieee.std_logic_1164.all;

entity gcnte5_2 is port
	(
	CLK, CLR, EN: in std_logic;
	Q: out std_logic_vector(4 downto 0)
	);
end gcnte5_2; 

architecture behavioral of gcnte5_2 is 

signal gcount: std_logic_vector (4 downto 0);

begin

	Q <= gcount;

	process (CLR, CLK)
	begin
		if CLR = '1' then  gcount <= "00001";
		elsif CLK'event and CLK = '1' then
			if EN = '1' then
				case gcount is 
		        	when "00000" => gcount <= "00001"; --00
        			when "00001" => gcount <= "00011"; --01
                	when "00011" => gcount <= "00010"; --02
                	when "00010" => gcount <= "00110"; --03
                	when "00110" => gcount <= "00111"; --04
                	when "00111" => gcount <= "00101"; --05
                	when "00101" => gcount <= "00100"; --06
                	when "00100" => gcount <= "01100"; --07
                	when "01100" => gcount <= "01101"; --08
                	when "01101" => gcount <= "01111"; --09
                	when "01111" => gcount <= "01110"; --10
                	when "01110" => gcount <= "01010"; --11
                	when "01010" => gcount <= "01011"; --12
                	when "01011" => gcount <= "01001"; --13
                	when "01001" => gcount <= "01000"; --14
                	when "01000" => gcount <= "11000"; --15
                	when "11000" => gcount <= "11001"; --16
                	when "11001" => gcount <= "11011"; --17
                	when "11011" => gcount <= "11010"; --18
                	when "11010" => gcount <= "11110"; --19
                	when "11110" => gcount <= "11111"; --20
                	when "11111" => gcount <= "11101"; --21
                	when "11101" => gcount <= "11100"; --22
                	when "11100" => gcount <= "10100"; --23
                	when "10100" => gcount <= "10101"; --24
                	when "10101" => gcount <= "10111"; --25
                	when "10111" => gcount <= "10110"; --26
                	when "10110" => gcount <= "10010"; --27
                	when "10010" => gcount <= "10011"; --28
                	when "10011" => gcount <= "10001"; --29
                	when "10001" => gcount <= "10000"; --30
                	when "10000" => gcount <= "00000"; --31
        			when others  => gcount <= "XXXXX";
	        	end case;
			end if;
	    end	if;
	end	process;

end behavioral;


		

⌨️ 快捷键说明

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