VHDL计数器程序.docx

上传人:b****4 文档编号:3016283 上传时间:2022-11-17 格式:DOCX 页数:14 大小:14.90KB
下载 相关 举报
VHDL计数器程序.docx_第1页
第1页 / 共14页
VHDL计数器程序.docx_第2页
第2页 / 共14页
VHDL计数器程序.docx_第3页
第3页 / 共14页
VHDL计数器程序.docx_第4页
第4页 / 共14页
VHDL计数器程序.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

VHDL计数器程序.docx

《VHDL计数器程序.docx》由会员分享,可在线阅读,更多相关《VHDL计数器程序.docx(14页珍藏版)》请在冰豆网上搜索。

VHDL计数器程序.docx

VHDL计数器程序

十五计数器

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

ENTITYfiveteencoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDfiveteencout;

ARCHITECTUREcounterOFfiveteencoutIS

SIGNALcount_int:

std_logic_vector(0to3);

BEGIN

PROCESS(clk,reset)

BEGIN

WAITUNTILrising_edge(clk);

IFreset='1'THEN

count_int<=(OTHERS=>'0');

ELSIFenable='1'THEN

IF(count_int="1110")THEN

count_int<="0000";

ELSE

count_int<=count_int1;

--ELSE

--NULL;

--IF(count_int="1001")THEN

--count_int<="0000";

ENDIF;

ENDIF;

ENDPROCESS;

count<=count_int;

--IF(reset='0')then

--q<="0000";

---ELSIF(clk'eventandclk='1')THEN

--q<=q1;

--IF(q<="1001")then

--q<="0000";

---ENDIF;

--IF(reset<='1')THEN

--q<="00";

--ELSIF

--waituntil(clk'eventandclk='1');

--WAITUNTIL(clk'EVENTANDclk='1');

--WAITUNTIL(clock'EVENTANDclock='1');

--q<=q'1';

--endif;

--count<=q;

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--clock'eventandclock='1';

--count<=0;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITriseedgeclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=1;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=2;

--endif;

--endif;

--endif;

--ENDPROCESS;

ENDcounter;

十四计数器

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

ENTITYfourteencoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDfourteencout;

ARCHITECTUREcounterOFfourteencoutIS

SIGNALcount_int:

std_logic_vector(0to3);

BEGIN

PROCESS(clk,reset)

BEGIN

WAITUNTILrising_edge(clk);

IFreset='1'THEN

count_int<=(OTHERS=>'0');

ELSIFenable='1'THEN

IF(count_int="1101")THEN

count_int<="0000";

ELSE

count_int<=count_int1;

--ELSE

--NULL;

--IF(count_int="1001")THEN

--count_int<="0000";

ENDIF;

ENDIF;

ENDPROCESS;

count<=count_int;

--IF(reset='0')then

--q<="0000";

---ELSIF(clk'eventandclk='1')THEN

--q<=q1;

--IF(q<="1001")then

--q<="0000";

---ENDIF;

--IF(reset<='1')THEN

--q<="00";

--ELSIF

--waituntil(clk'eventandclk='1');

--WAITUNTIL(clk'EVENTANDclk='1');

--WAITUNTIL(clock'EVENTANDclock='1');

--q<=q'1';

--endif;

--count<=q;

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--clock'eventandclock='1';

--count<=0;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITriseedgeclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=1;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=2;

--endif;

--endif;

--endif;

--ENDPROCESS;

ENDcounter;

十三计数器

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

ENTITYthireteencoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDthireteencout;

ARCHITECTUREcounterOFthireteencoutIS

SIGNALcount_int:

std_logic_vector(0to3);

BEGIN

PROCESS(clk,reset)

BEGIN

WAITUNTILrising_edge(clk);

IFreset='1'THEN

count_int<=(OTHERS=>'0');

ELSIFenable='1'THEN

IF(count_int="1100")THEN

count_int<="0000";

ELSE

count_int<=count_int1;

--ELSE

--NULL;

--IF(count_int="1001")THEN

--count_int<="0000";

ENDIF;

ENDIF;

ENDPROCESS;

count<=count_int;

--IF(reset='0')then

--q<="0000";

---ELSIF(clk'eventandclk='1')THEN

--q<=q1;

--IF(q<="1001")then

--q<="0000";

---ENDIF;

--IF(reset<='1')THEN

--q<="00";

--ELSIF

--waituntil(clk'eventandclk='1');

--WAITUNTIL(clk'EVENTANDclk='1');

--WAITUNTIL(clock'EVENTANDclock='1');

--q<=q'1';

--endif;

--count<=q;

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--clock'eventandclock='1';

--count<=0;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITriseedgeclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=1;

--WAITUNTIL(clock'EVENTANDclock='1');

--WAITUNTILclock='1';

--if(clock'eventandclock='1')then

--WAITUNTILrising_edge(clock);

--count<=2;

--endif;

--endif;

--endif;

--ENDPROCESS;

ENDcounter;

十二计数器

libraryieee;

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

ENTITYtwelvecoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDtwelvecout;

ARCHITECTUREcounterOFtwelvecoutIS

SIGNALcount_int:

std_logic_vector(0to3);

BEGIN

PROCESS(clk,reset)

BEGIN

WAITUNTILrising_edge(clk);

IFreset='1'THEN

count_int<=(OTHERS=>'0');

ELSIFenable='1'THEN

IF(count_i

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1