VHDL程序设计数字电子表2收集.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《VHDL程序设计数字电子表2收集.ppt》由用户(三亚风情)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VHDL 程序设计 数字 电子表 收集
- 资源描述:
-
1、6 个七段数码管个七段数码管SEGOUT(8)(8)CLR 时钟显示时钟显示电路方框图电路方框图CP FPGASELOUT(6)(6)24进进制制计数器计数器60进进制制计数器计数器60进进制制计数器计数器BCD 七段译码电路七段译码电路BCD 选择选择BCD(8)(8)BIN(6)(6)6 个七段数码管个七段数码管扫描电路扫描电路 S(3)(3)SEG(8)(8)NUM(4)(4)BCD(3-0)(3-0)BCD(7-4)(7-4)ENB(0)(0)ENB(1)(1)ENB(2)(2)DBHDBMDBSBIN(6)(6)时钟显示时钟显示电路方框图电路方框图SEC CLR CYH CYS CY
2、M 分频器分频器CP 38译译码码24进进制制计数器计数器60进进制制计数器计数器60进进制制计数器计数器BCD 七段译码电路七段译码电路BCD 选择选择BCD(8)(8)BIN(6)(6)6 个七段数码管个七段数码管扫描电路扫描电路 S(3)(3)SEG(8)(8)NUM(4)(4)BCD(3-0)(3-0)BCD(7-4)(7-4)ENB(0)(0)ENB(1)(1)ENB(2)(2)DBHDBMDBSBIN(6)(6)时钟显示时钟显示电路方框图电路方框图SEC CLR CYH CYS CYM 分频器分频器CP 38译译码码PROCESS(CP)PROCESS(CP)BeginBeginI
3、F CPEvent AND CP=1 thenIF CPEvent AND CP=1 thenDLY=Q(21)DLY=Q(21);Q=Q+1;Q=Q+1;END IF;END IF;END PROCESS;END PROCESS;Free_Counter:BlockFree_Counter:Block Signal Signal Q Q:STD_LOGIC_VECTOR(24 DOWNTO 0);:STD_LOGIC_VECTOR(24 DOWNTO 0);Signal DLY Signal DLY:STD_LOGIC;:STD_LOGIC;BeginBeginPROCESS(CP)PROC
4、ESS(CP)BeginBeginIF CPEvent AND CP=1 thenIF CPEvent AND CP=1 thenDLY=Q(21);DLY=Q(21);Q=Q+1;Q=Q+1;END IF;END IF;END PROCESS;END PROCESS;SEC=SEC=Q(21)AND NOT DLYQ(21)AND NOT DLY;-about 1Hz -about 1Hz S=Q(15 DOWNTO 13);S=Q(15 DOWNTO 13);-about 250 Hz-about 250 HzENB ENB=001 WHEN(S=0 OR S=1)ELSE=001 WHE
5、N(S=0 OR S=1)ELSE010 WHEN(S=2 OR S=3)ELSE010 WHEN(S=2 OR S=3)ELSE100 WHEN(S=4 OR S=5)ELSE100 WHEN(S=4 OR S=5)ELSE000;000;BIN BIN=DBS WHEN ENB=001 ELSE=DBS WHEN ENB=001 ELSEDBM WHEN ENB=010 ELSEDBM WHEN ENB=010 ELSEDBH WHEN ENB=100 ELSEDBH WHEN ENB=100 ELSE000000;000000;End Block Free_Counter;End Blo
6、ck Free_Counter;-主文件声明代码主文件声明代码COMPONENT COUNTER60COMPONENT COUNTER60PORT(PORT(CPCP:IN:IN STD_LOGIC;STD_LOGIC;BINBIN:OUT:OUTSTD_LOGIC_VECTOR(5 DOWNTO 0);STD_LOGIC_VECTOR(5 DOWNTO 0);S S:IN:IN STD_LOGIC;STD_LOGIC;CLRCLR:IN:IN STD_LOGIC;STD_LOGIC;ECEC:IN STD_LOGIC;:IN STD_LOGIC;CY60CY60:OUT STD_LOGIC:
7、OUT STD_LOGIC););END COMPONENT;END COMPONENT;-子文件定义代码子文件定义代码-*LIBRARY IEEE;LIBRARY IEEE;USE IEEE.STD_LOGIC_UNSIGNED.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;-*ENTITY COUNTER60 ISENTITY COUNTER60 ISPORT(PORT(CP CP:IN STD_LOGIC;IN STD_LOGIC;BINBIN:OUT STD_LOGIC_VECTOR(5 DOWNTO 0);OUT STD_LOGIC_VECTOR(5 DOW
8、NTO 0);S S :IN STD_LOGIC;IN STD_LOGIC;CLR CLR :IN STD_LOGIC;IN STD_LOGIC;EC EC :IN STD_LOGIC;IN STD_LOGIC;CY60 CY60:OUT STD_LOGICOUT STD_LOGIC););END COUNTER60;END COUNTER60;-子文件定义代码子文件定义代码ARCHITECTURE a OF ARCHITECTURE a OF COUNTER60COUNTER60 IS ISSIGNAL Q:STD_LOGIC_VECTOR(5 DOWNTO 0);SIGNAL Q:STD_
9、LOGIC_VECTOR(5 DOWNTO 0);SIGNAL RST,DLY:STD_LOGIC;SIGNAL RST,DLY:STD_LOGIC;BEGINBEGINPROCESS(CP,RST)PROCESS(CP,RST)BEGINBEGINIF RST=1 THENIF RST=1 THENQ=000000;Q=000000;ELSIF CPevent AND CP=1 THENELSIF CPevent AND CP=1 THENDLY=Q(5);DLY=Q(5);IF EC=1 THENIF EC=1 THENQ=Q+1;Q=Q+1;END IF;END IF;END IF;EN
10、D IF;END PROCESS;END PROCESS;CY60=CY60=NOT Q(5)AND DLY;NOT Q(5)AND DLY;RST=1 WHEN Q=60 OR CLR=1 ELSERST=1 WHEN Q=60 OR CLR=1 ELSE 0;0;BIN=BIN=Q Q WHEN S=1 ELSE WHEN S=1 ELSE 000000;000000;END a;END a;-主文件声明代码主文件声明代码COMPONENT COUNTER24COMPONENT COUNTER24PORT(PORT(CPCP:IN:IN STD_LOGIC;STD_LOGIC;BINBIN
11、:OUT:OUTSTD_LOGIC_VECTOR(5 DOWNTO 0);STD_LOGIC_VECTOR(5 DOWNTO 0);S S:IN:IN STD_LOGIC;STD_LOGIC;CLRCLR:IN:IN STD_LOGIC;STD_LOGIC;ECEC:IN STD_LOGIC;:IN STD_LOGIC;CY60CY60:OUT STD_LOGIC:OUT STD_LOGIC););END COMPONENT;END COMPONENT;-子文件定义代码子文件定义代码-*LIBRARY IEEE;LIBRARY IEEE;USE IEEE.STD_LOGIC_1164.ALL;
12、USE IEEE.STD_LOGIC_1164.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;USE IEEE.STD_LOGIC_UNSIGNED.ALL;-*ENTITY COUNTER24 ISENTITY COUNTER24 ISPORT(PORT(CP CP:IN STD_LOGIC;IN STD_LOGIC;BINBIN:OUT STD_LOGIC_VECTOR(5 DOWNTO 0);OUT STD_LOGIC_VECTOR(5 DOWNTO 0);S S :IN STD_LOGIC;IN STD_LOGIC;CLR CLR :IN STD_LOGIC;
13、IN STD_LOGIC;EC EC :IN STD_LOGIC;IN STD_LOGIC;CY24 CY24:OUT STD_LOGICOUT STD_LOGIC););END COUNTER24;END COUNTER24;-子文件定义代码子文件定义代码ARCHITECTURE a OF COUNTER24 ISARCHITECTURE a OF COUNTER24 ISSIGNAL Q SIGNAL Q:STD_LOGIC_VECTOR(4 DOWNTO 0);STD_LOGIC_VECTOR(4 DOWNTO 0);SIGNAL RST,DLY:SIGNAL RST,DLY:STD_L
14、OGIC;STD_LOGIC;BEGINBEGINPROCESS(CP,RST)PROCESS(CP,RST)BEGINBEGINIF RST=1 THENIF RST=1 THENQ=00000;Q=00000;ELSIF CPevent AND CP=1 THENELSIF CPevent AND CP=1 THENDLY=Q(4);DLY=Q(4);IF EC=1 THENIF EC=1 THENQ=Q+1;Q=Q+1;END IF;END IF;END IF;END IF;END PROCESS;END PROCESS;CY24=CY24=NOT Q(4)AND DLY;NOT Q(4
15、)AND DLY;RST=1 WHEN Q=24 OR CLR=1 ELSERST=1 WHEN Q=24 OR CLR=1 ELSE 0;0;BIN=BIN=(0&Q)(0&Q)WHEN S=1 ELSE WHEN S=1 ELSE 000000;000000;END a;END a;Binary_BCD:BlockBinary_BCD:BlockBEGINBEGINBCD=BCD=00000000 WHEN BIN=0 ELSE00000000 WHEN BIN=0 ELSE00000001 WHEN BIN=1 ELSE00000001 WHEN BIN=1 ELSE00000010 W
16、HEN BIN=2 ELSE00000010 WHEN BIN=2 ELSE00000011 WHEN BIN=3 ELSE00000011 WHEN BIN=3 ELSE00000100 WHEN BIN=4 ELSE00000100 WHEN BIN=4 ELSE00000101 WHEN BIN=5 ELSE00000101 WHEN BIN=5 ELSE00000110 WHEN BIN=6 ELSE00000110 WHEN BIN=6 ELSE00000111 WHEN BIN=7 ELSE00000111 WHEN BIN=7 ELSE00001000 WHEN BIN=8 EL
17、SE00001000 WHEN BIN=8 ELSE00001001 WHEN BIN=9 ELSE00001001 WHEN BIN=9 ELSE00010000 WHEN BIN=10 ELSE00010000 WHEN BIN=10 ELSE00010001 WHEN BIN=11 ELSE00010001 WHEN BIN=11 ELSE00010010 WHEN BIN=12 ELSE00010010 WHEN BIN=12 ELSE00010011 WHEN BIN=13 ELSE00010011 WHEN BIN=13 ELSE00010100 WHEN BIN=14 ELSE0
18、0010100 WHEN BIN=14 ELSE00010101 WHEN BIN=15 ELSE00010101 WHEN BIN=15 ELSE00010110 WHEN BIN=16 ELSE00010110 WHEN BIN=16 ELSE00010111 WHEN BIN=17 ELSE00010111 WHEN BIN=17 ELSE00011000 WHEN BIN=18 ELSE00011000 WHEN BIN=18 ELSE00011001 WHEN BIN=19 ELSE00011001 WHEN BIN=19 ELSE00100000 WHEN BIN=20 ELSE0
19、0100000 WHEN BIN=20 ELSE00100001 WHEN BIN=21 ELSE00100001 WHEN BIN=21 ELSE00100010 WHEN BIN=22 ELSE00100010 WHEN BIN=22 ELSE00100011 WHEN BIN=23 ELSE00100011 WHEN BIN=23 ELSE00100100 WHEN BIN=24 ELSE00100100 WHEN BIN=24 ELSE00100101 WHEN BIN=25 ELSE00100101 WHEN BIN=25 ELSE00100110 WHEN BIN=26 ELSE0
20、0100110 WHEN BIN=26 ELSE00100111 WHEN BIN=27 ELSE00100111 WHEN BIN=27 ELSE00101000 WHEN BIN=28 ELSE00101000 WHEN BIN=28 ELSE00101001 WHEN BIN=29 ELSE00101001 WHEN BIN=29 ELSE00110000 WHEN BIN=30 ELSE00110000 WHEN BIN=30 ELSE00110001 WHEN BIN=31 ELSE00110001 WHEN BIN=31 ELSE00110010 WHEN BIN=32 ELSE0
21、0110010 WHEN BIN=32 ELSE00110011 WHEN BIN=33 ELSE00110011 WHEN BIN=33 ELSE00110100 WHEN BIN=34 ELSE00110100 WHEN BIN=34 ELSE00110101 WHEN BIN=35 ELSE00110101 WHEN BIN=35 ELSE00110110 WHEN BIN=36 ELSE00110110 WHEN BIN=36 ELSE00110111 WHEN BIN=37 ELSE00110111 WHEN BIN=37 ELSE00111000 WHEN BIN=38 ELSE0
22、0111000 WHEN BIN=38 ELSE00111001 WHEN BIN=39 ELSE00111001 WHEN BIN=39 ELSE01000000 WHEN BIN=40 ELSE01000000 WHEN BIN=40 ELSE01000001 WHEN BIN=41 ELSE01000001 WHEN BIN=41 ELSE01000010 WHEN BIN=42 ELSE01000010 WHEN BIN=42 ELSE01000011 WHEN BIN=43 ELSE01000011 WHEN BIN=43 ELSE01000100 WHEN BIN=44 ELSE0
23、1000100 WHEN BIN=44 ELSE01000101 WHEN BIN=45 ELSE01000101 WHEN BIN=45 ELSE01000110 WHEN BIN=46 ELSE01000110 WHEN BIN=46 ELSE01000111 WHEN BIN=47 ELSE01000111 WHEN BIN=47 ELSE01001000 WHEN BIN=48 ELSE01001000 WHEN BIN=48 ELSE01001001 WHEN BIN=49 ELSE01001001 WHEN BIN=49 ELSE01010000 WHEN BIN=50 ELSE0
24、1010000 WHEN BIN=50 ELSE01010001 WHEN BIN=51 ELSE01010001 WHEN BIN=51 ELSE01010010 WHEN BIN=52 ELSE01010010 WHEN BIN=52 ELSE01010011 WHEN BIN=53 ELSE01010011 WHEN BIN=53 ELSE01010100 WHEN BIN=54 ELSE01010100 WHEN BIN=54 ELSE01010101 WHEN BIN=55 ELSE01010101 WHEN BIN=55 ELSE01010110 WHEN BIN=56 ELSE0
25、1010110 WHEN BIN=56 ELSE01010111 WHEN BIN=57 ELSE01010111 WHEN BIN=57 ELSE01011000 WHEN BIN=58 ELSE01011000 WHEN BIN=58 ELSE01011001 WHEN BIN=59 ELSE01011001 WHEN BIN=59 ELSE00000000;00000000;END Block Binary_BCD;END Block Binary_BCD;SELECT_BCD:BlockSELECT_BCD:BlockBEGINBEGINNUM=NUM=BCD(3 DOWNTO 0)B
展开阅读全文