北邮数电实验报告 上文档格式.docx

上传人:b****3 文档编号:18338358 上传时间:2022-12-15 格式:DOCX 页数:12 大小:344.64KB
下载 相关 举报
北邮数电实验报告 上文档格式.docx_第1页
第1页 / 共12页
北邮数电实验报告 上文档格式.docx_第2页
第2页 / 共12页
北邮数电实验报告 上文档格式.docx_第3页
第3页 / 共12页
北邮数电实验报告 上文档格式.docx_第4页
第4页 / 共12页
北邮数电实验报告 上文档格式.docx_第5页
第5页 / 共12页
点击查看更多>>
下载资源
资源描述

北邮数电实验报告 上文档格式.docx

《北邮数电实验报告 上文档格式.docx》由会员分享,可在线阅读,更多相关《北邮数电实验报告 上文档格式.docx(12页珍藏版)》请在冰豆网上搜索。

北邮数电实验报告 上文档格式.docx

1'

IFtemp=9THEN

ELSE

=temp+1;

ENDIF;

ENDPROCESSp1;

p2:

PROCESS(temp)

IFtemp<

9THEN

clk_out<

='

;

ENDPROCESSp2;

ENDstruc;

2.VHDL语言实现模10计数器

异步复位十进制计数器,计数状态为0000~1001,状态的改变通过q_temp实现,最后将其赋值给q,进行输出。

ENTITYbcd24IS

PORT(clk,clr:

q:

OUTSTD_LOGIC_VECTOR(3DOWNTO0));

ENDbcd24;

ARCHITECTUREstrucOFbcd24IS

SIGNALq_temp:

STD_LOGIC_VECTOR(3DOWNTO0);

PROCESS(clk)

IF(clk'

)THEN

IFclr='

THEN

q_temp<

="

0000"

ELSIFq_temp="

1001"

=q_temp+1;

ENDPROCESS;

q<

=q_temp;

3.VHDL语言实现数码显示译码器

通过不同的字段编码使LED数码管显示不同数字,用a表示计数状态,b表示字段a~g,下载时将b的7个值对应相应的a~g,以正确显示数字。

libraryieee;

useieee.std_logic_1164.all;

entityyimaqi24is

port(

a:

instd_logic_vector(3downto0);

b:

outstd_logic_vector(6downto0);

cat:

outstd_logic_vector(5downto0));

endyimaqi24;

architectureyimaqiofyimaqi24is

begin

process(a)

begin

caseais

when"

=>

b<

1111110"

--0

0001"

0110000"

--1

0010"

1101101"

--2

0011"

1111001"

--3

0100"

0110011"

--4

0101"

1011011"

--5

0110"

1011111"

--6

0111"

1110000"

--7

1000"

1111111"

--8

1111011"

--9

whenothers=>

0000000"

endcase;

endprocess;

cat<

111110"

end;

4.VHDL语言实现数码管0~9自动显示

系统由三部分组成:

分频系数为50M的分频器,模10计数器,数码管显示译码器。

分频器将计算机频率降低作为输入,使数字变化周期为1秒。

模10计数器用以控制输出10个数字。

数码管显示译码器用来下载至实验板上观察结果。

ENTITYshiyan24IS

PORT(

clk:

instd_logic;

clear:

outstd_logic_vector(5downto0));

ENDshiyan24;

ARCHITECTUREaOFshiyan24IS

signaltmp:

integerrange0to24999999;

signalclktmp:

std_logic;

SIGNALq_temp:

p1:

process(clear,clk)

begin

ifclear='

thentmp<

elsifclk'

eventandclk='

then

iftmp=24999999thentmp<

clktmp<

=notclktmp;

elsetmp<

=tmp+1;

endif;

endprocessp1;

p2:

PROCESS(clktmp)

IF(clktmp'

EVENTANDclktmp='

p3:

process(q_temp)

caseq_tempis

enda;

5.VHDL语言实现数码管串行扫描电路

用来在六个数码管上显示“111824”

ENTITYchuanxing24IS

OUTSTD_LOGIC_VECTOR(6DOWNTO0);

countout:

OUTSTD_LOGIC_VECTOR(5DOWNTO0));

ENDchuanxing24;

ARCHITECTUREaOFchuanxing24IS

signaltmp:

integerrange0to49999;

signalclktmp:

STD_LOGIC_VECTOR(6DOWNTO0);

SIGNALcount:

STD_LOGIC_VECTOR(5DOWNTO0);

SIGNALcnt:

INTEGERRANGE0TO5;

p0:

iftmp=25999thentmp<

endprocessp0;

IF(cnt=5)THENcnt<

cnt<

=cnt+1;

PROCESS(cnt)

IF(clear='

)THENcount<

111111"

CASEcntIS

WHEN0=>

count<

011111"

q_temp<

WHEN1=>

101111"

WHEN2=>

110111"

WHEN3=>

111011"

WHEN4=>

111101"

WHEN5=>

ENDCASE;

countout<

=count;

ENDa;

6.VHDL语言实现数码管滚动显示电路

实现数字串“111824”的循环左滚动,始终点亮6个数码管,左出右进。

libraryieee;

useieee.std_logic_unsigned.all;

entitygundong24is

clk,clear:

outstd_logic_vector(5downto0)

);

endgundong24;

architecturebehaveofgundong24is

signaltemp_1:

integerrange0to24999;

signaltemp_2:

integerrange0to499;

signaltemp_clk_1:

signaltemp_clk_2:

signalm:

std_logic_vector(3downto0);

signaln:

signalt:

integerrange0to5;

process(clk,clear)

then

temp_1<

iftemp_1=24999then

temp_clk_1<

=nottemp_clk_1;

else

=temp_1+1;

endprocessp1;

process(temp_clk_1,clear)

then

temp_2<

elsiftemp_clk_1'

eventandtemp_clk_1='

iftemp_2=499then

temp_clk_2<

=nottemp_clk_2;

=temp_2+1;

endprocessp2;

process(clear,temp_clk_2,temp_clk_1)

ifclear<

then

m<

ifm="

=m+1;

endprocessp3;

p4:

process(m)

casemis

when"

q<

endprocessp4;

p5:

process(clear,temp_clk_2,t,m)

t<

elsiftemp_clk_2'

eventandtemp_clk_2='

ift=5then

=t+1;

endprocessp5;

p6:

process(n,m,t)

n<

=m+t;

casenis

cat<

1010"

1011"

whenothers=>

endprocessp6;

endbehave;

四.仿真波形图及波形分析

1.分频器仿真波形图(十分频,占空比为10%)

 

2.分频器仿真波形图(十分频,占空比为50%)

3.模10计数器仿真波形图

4.数码显示译码器

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

当前位置:首页 > 自然科学 > 物理

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

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