ZKX's LAB

用VHDL编写用5个数码管显示数字时钟程序 vhdl数码管显示数字

2020-07-21知识7

很简单的一个VHDL代码:数码管显示 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity M isport(btn:in std_logic;Y1,Y2,Y3,Y4:out std_logic_vector(6 downto 0)end entity M;architecture behav of M issignal cnt:integer range 0 to 5;beginprocess(btn)beginif btn'event and btn='0' thencnt;if cnt>;=3 thencnt;end if;end if;if cnt=0 thenY1;0Y2;5Y3;0Y4;0elsif cnt=1 thenY1;1Y2;0Y3;0Y4;0elsif cnt>;=2 thenY1;2Y2;5Y3;0Y4;0end if;end process;end behav;用VHDL编写用5个数码管显示数字时钟程序 library ieee;调用逻辑库 use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity szz is port-实体定义(inclk:in 。VHDL分频+数码管显示学号 library ieee;use ieee.std_logic_1164.all;entity seg7 isport(clk:in std_logic;sg:out std_logic_vector(6 downto 0);bt:out std_logic_vector(7 downto 0));end seg7;architecture behav of seg7 issignal cnt8:integer range 0 to 7;signal countcarry:std_logic;signal a:integer range 0 to 15;beginp0:process(clk)variable temp:integer range 0 to 10000;beginif clk'event and clk='1' thenif temp;countcarry;else temp:=0;countcarry;end if;end if;end process;p1:process(clk)beginif clk'event and clk='1' thenif countcarry='1' thencnt8;end if;end if;end process;p2:process(cnt8)begincase cnt8 iswhen 0=>;bt;a;when 1=>;bt;a;when 2=>;bt;a;when 3=>;bt;a;when 4=>;bt;a;when 5=>;bt;a;when 6=>;bt;a;when 7=>;bt;a;when others=>;null;end case;end process;p3:process(a)begincase a iswhen 0=>;sg;when 1=>;sg;when 2=>;sg;when 3=>;sg;when 4=>;sg;when 5=>;sg;when 6=>;sg;when 7=>;sg;when 8=>;sg;when 9=>;sg;when 10=>;sg;when 11=>;sg;when 12=>;sg;when 13=>;sg;when 14=>;sg;when 15=>;sg;when others=>;null;end case;end process;end;。用VHDL语言,设计一个数码管显示的程序 七段数码管显示数字需要自定义一个译码器。把二进制数字转换为对应显示的abcdefgh。例如:想显示‘1’需要给七段数码管(共阴极)输入01100000,‘2’需要11011010等等。如果你设计的译码器能够显示0、1、2、3、4、5、6、7、8、9、a、b、c、d、e、f的话,计数器直接把输出送给译码器就可以了。如果只想显示十进制数,计数器就需要设计成十进制的,然后把二进制数送给译码器就好啦!希望能采纳!如何用VHDL语言编写数码管的动态显示 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity led isportclk:in std_logic;时钟信号s:out std_logic_vector(7 downto 0);数码管q:out std_logic_vector(6 downto 0));段位end led;architecture one of led issignal clk1:std_logic;signal clk2:std_logic;分频signal cnt:integer:=0;signal cnt1:integer:=0;计数signal cnt2:integer:=0;signal count1:integer:=0;signal count2:integer:=0;signal data:integer range 0 to 9;beginprocess(clk)beginif clk'event and clk='1' thenif count1=49999999 thenclk1;1 s,以便好计算count1;elsecount1;clk1;end if;if count2=50000 thenclk2;1000hz,此频率可利用人的视觉误差扫描数码管count2;elsecount2;clk2;end if;end if;end process;用VHDL语言编(共八个)七段数码管的随机显示程序 我这里有一个自己弄的现成的程序。可以给你看看。首先是你要有数码管译码器,以下这个是共阴数码管的译码电路的VHDL。segin是输入的你要显示的二进制数据,比如1001代表的。vhdl数管显示数字吗 比 十六位8421BCD码*0100010001000100 用数码管显示 4444<;br>;要注意 用数码管 我希望通钟升沿控制 比升沿<;br>;编译第四位0100 4 显示 升沿 编译第二四位0100 4。

#vhdl语言#vhdl#数码管

随机阅读

qrcode
访问手机版