段字母 a b c d e f g
A 0 0 0 1 0 0 0
B 1 1 0 0 0 0 0
C 0 1 1 0 0 0 1
D 1 0 0 0 0 1 0
E 0 1 1 0 0 0 0
F 1 0 0 0 1 1 1
H 0 1 1 0 1 1 1
四、实验内容编写一个0~F轮换显示的电路(注意:选用实验箱中的共阳数码管DP1A,FPGA上P25引脚连接50MHz时钟。实验时为了便于观察,要将50MHz时钟经过分频得到1Hz时钟)。五、实验步骤(1)实验程序LIBRARY IEEEUSE IEEE.std_logic_1164.allUSE IEEE.std_logic_unsigned.allENTITY exp2 ISGENERIC(n:INTEGER :=6)port(clk: IN std_logicled: OUT std_logic_vector(6 DOWNTO 0))END exp2ARCHITECTURE example OF exp2 ISSIGNAL sel:INTEGER RANGE 0 TO n-1 :=0SIGNAL f_out:std_logicSIGNAL count:INTEGER RANGE 0 TO 15 :=0
BEGINPROCESS(clk)BEGINIF clk'event and clk='1' THENIF sel>n-2 THEN sel<=0ELSEIF sel>=n/2 THENf_out<='1'ELSEf_out<='0'END IFsel<=sel+1END IFEND IFEND PROCESSPROCESS(f_out)BEGINIF f_out'event and f_out='1' THENIF count<=15 THENcount<=count+1ELSEcount<=0END IFEND IFEND PROCESSPROCESS(count)BEGINCASE count ISWHEN 0 =>led <="0000001"WHEN 1 =>led <="1001111"WHEN 2 =>led <="0010010"WHEN 3 =>led <="0000110"WHEN 4 =>led <="1001100"WHEN 5 =>led <="0100100"WHEN 6 =>led <="0100000"WHEN 7 =>led <="0001111"WHEN 8 =>led <="0000000"WHEN 9 =>led <="0000100"WHEN 10 =>led <="1110111"WHEN 11 =>led <="0011111"WHEN 12 =>led <="1001110"WHEN 13 =>led <="0111101"WHEN 14 =>led <="1001111"WHEN 15 =>led <="0111000"
¥
5.9
百度文库VIP限时优惠现在开通,立享6亿+VIP内容
立即获取
可编程逻辑器件实验EDA-七段数码管显示电路
实验四 七段数码管显示电路
一、实验目的
实现十六进制计数显示。
二、硬件需求
EDA/SOPC实验箱一台。
三、实验原理
七段数码管分共阳极与共阴极两种。共阳极数码管其工作特点是,当笔段电极接低电平,公共阳极接高电平时,相应笔段可以发光。共阴极数码管则与之相反,它是将发光二极管的阴极短接后作为公共阴极,当驱动信号为高电平、公共阴极接低电平时,才能发光。图2-13为共阳极数码管和共阴极数码管的内部结构图
module eda_top(clk, rst_n, din, dout)input clk
input rst_n
input din
output dout
module1_name instance1(
.clk(clk),
.rst_n(rst_n),
.din(din),
.dout(dout1)
)
module2_name instance2(
.clk(clk),
.rst_n(rst_n),
.din(dout1),
.dout(dout2)
)
assign dout = dout2
endmodule
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)