VHDL源代码计数器.docx

上传人:b****2 文档编号:17307979 上传时间:2023-07-24 格式:DOCX 页数:17 大小:14.86KB
下载 相关 举报
VHDL源代码计数器.docx_第1页
第1页 / 共17页
VHDL源代码计数器.docx_第2页
第2页 / 共17页
VHDL源代码计数器.docx_第3页
第3页 / 共17页
VHDL源代码计数器.docx_第4页
第4页 / 共17页
VHDL源代码计数器.docx_第5页
第5页 / 共17页
VHDL源代码计数器.docx_第6页
第6页 / 共17页
VHDL源代码计数器.docx_第7页
第7页 / 共17页
VHDL源代码计数器.docx_第8页
第8页 / 共17页
VHDL源代码计数器.docx_第9页
第9页 / 共17页
VHDL源代码计数器.docx_第10页
第10页 / 共17页
VHDL源代码计数器.docx_第11页
第11页 / 共17页
VHDL源代码计数器.docx_第12页
第12页 / 共17页
VHDL源代码计数器.docx_第13页
第13页 / 共17页
VHDL源代码计数器.docx_第14页
第14页 / 共17页
VHDL源代码计数器.docx_第15页
第15页 / 共17页
VHDL源代码计数器.docx_第16页
第16页 / 共17页
VHDL源代码计数器.docx_第17页
第17页 / 共17页
亲,该文档总共17页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

VHDL源代码计数器.docx

《VHDL源代码计数器.docx》由会员分享,可在线阅读,更多相关《VHDL源代码计数器.docx(17页珍藏版)》请在冰点文库上搜索。

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_int="1011")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;

ENTITYelevencoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDelevencout;

ARCHITECTUREcounterOFelevencoutIS

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="1010")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;

ENTITYcountIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDcount;

ARCHITECTUREcounterOFcountIS

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="1001")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;

ENTITYninecoutIS

PORT(clk,reset,enable:

INstd_logic;count:

OUTstd_logic_vector(3downto0));

ENDninecout;

ARCHITECTUREcounterOFninecoutIS

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="1000")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=

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

当前位置:首页 > 人文社科 > 法律资料

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2