一段VHDL程序。。。。有些地方不太明白,麻烦高手指点指点
用该程序来控制LED灯的亮法及数码管的计数libraryieee;useieee.std_logic_1164.all;useieee.std_logic_arith.a...
用该程序来控制LED灯的亮法及数码管的计数
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity led_control is
port (clk : in std_logic;
led_c : out std_logic_vector(3 downto 0);
led_l : out std_logic_vector(6 downto 0);
qout : out std_logic_vector( 7 downto 0));
end led_control;
architecture design of led_control is
signal cnt : integer range 0 to 9999999 :=0; ---这个的作用是?
signal clk_out : std_logic;
signal led_cnt : integer range 0 to 8 :=0;
signal con_q : std_logic_vector (7 downto 0);
signal lcnt : integer range 0 to 9 :=0;
begin
process(clk)----该进程的作用是?
begin
if clk'event and clk = '1' then
if cnt < 9999999 then
cnt <= cnt + 1 ;
else cnt <= 0;
clk_out <= not clk_out;
end if ;
end if;
if clk_out'event and clk_out= '1' then
if led_cnt < 8 then
led_cnt <= led_cnt + 1;
else led_cnt <= 0;
end if;
end if;
end process;
with led_cnt select
con_q <= "10010010" when 0,
"01001001" when 1,
"11100000" when 2,
"11110000" when 3,
"11111000" when 4,
"01010101" when 5,
"10101010" when 6,
"00110011" when 7,
"11001100" when 8;
qout <= con_q ;
led_c <= "1111";
process(clk_out)
begin
if clk_out'event and clk_out = '1' then
if led_cnt = 8 then
if lcnt < 9 then
lcnt <= lcnt + 1;
else lcnt <= 0;
end if;
end if ;
end if;
一次发不完。。。继续
---十进制-BCD码转换;----这个的作用是?好像并没有什么用啊
--- if lcnt>999 then
-- lcnt<=lcnt-1000;
-- d4<=d4+1;
---led_c <= "1111";
--- elsif lcnt>99 then
-- lcnt<=lcnt-100; d3<=d3+1; --led_c <= "1110" ;
-- elsif lcnt>9 then
--lcnt<=lcnt-10; d2<=d2+1; --led_c <= "1100" ;
-- elsif lcnt>0 then
-- lcnt<=lcnt-1; d1<=d1+1; -- led_c<= "1000";
--else led_c<= "1111"; 展开
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity led_control is
port (clk : in std_logic;
led_c : out std_logic_vector(3 downto 0);
led_l : out std_logic_vector(6 downto 0);
qout : out std_logic_vector( 7 downto 0));
end led_control;
architecture design of led_control is
signal cnt : integer range 0 to 9999999 :=0; ---这个的作用是?
signal clk_out : std_logic;
signal led_cnt : integer range 0 to 8 :=0;
signal con_q : std_logic_vector (7 downto 0);
signal lcnt : integer range 0 to 9 :=0;
begin
process(clk)----该进程的作用是?
begin
if clk'event and clk = '1' then
if cnt < 9999999 then
cnt <= cnt + 1 ;
else cnt <= 0;
clk_out <= not clk_out;
end if ;
end if;
if clk_out'event and clk_out= '1' then
if led_cnt < 8 then
led_cnt <= led_cnt + 1;
else led_cnt <= 0;
end if;
end if;
end process;
with led_cnt select
con_q <= "10010010" when 0,
"01001001" when 1,
"11100000" when 2,
"11110000" when 3,
"11111000" when 4,
"01010101" when 5,
"10101010" when 6,
"00110011" when 7,
"11001100" when 8;
qout <= con_q ;
led_c <= "1111";
process(clk_out)
begin
if clk_out'event and clk_out = '1' then
if led_cnt = 8 then
if lcnt < 9 then
lcnt <= lcnt + 1;
else lcnt <= 0;
end if;
end if ;
end if;
一次发不完。。。继续
---十进制-BCD码转换;----这个的作用是?好像并没有什么用啊
--- if lcnt>999 then
-- lcnt<=lcnt-1000;
-- d4<=d4+1;
---led_c <= "1111";
--- elsif lcnt>99 then
-- lcnt<=lcnt-100; d3<=d3+1; --led_c <= "1110" ;
-- elsif lcnt>9 then
--lcnt<=lcnt-10; d2<=d2+1; --led_c <= "1100" ;
-- elsif lcnt>0 then
-- lcnt<=lcnt-1; d1<=d1+1; -- led_c<= "1000";
--else led_c<= "1111"; 展开
1个回答
杭州一知智能科技有限公司
2022-03-17 广告
2022-03-17 广告
电话机器人主要就是用来模拟人工通话的一组程序,一般由,CRM系统,语义识别,转换文字,话术体系,这是软的部分,再加上底层软交换和通信模块一起,合并起来就是一套完整的电话机器人系统。电话机器人可以代替真人进行电话工作的,像是电话营销、售后回访...
点击进入详情页
本回答由杭州一知智能科技有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询