library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity countdown is
port( clk50m,rst,key:in std_logic;

dig:out std_logic_vector(4 downto 1);

seg:out std_logic_vector(6 downto 0);
led:out std_logic

);
end countdown;
architecture ach of countdown is
component countN is
generic(

n:integer:=100
);
port(

clk,rst,en:in std_logic;

qdata:out integer ;

cout:out std_logic


);
end component;
component freqN is
generic (
n:integer:=100
);
port(
clk,rst:in std_logic;
clkout:out std_logic
);
end component;
component mypll IS
PORT
(
areset : IN STD_LOGIC := '0';
inclk0 : IN STD_LOGIC := '0';
c0 : OUT std_logic;
locked : OUT STD_LOGIC
);
END component;
component cd is
port(clk,rst:in std_logic;

qh,ql:buffer integer range 0 to 9

);
end component;
component ledShow is

port(

q:in integer;

seg:out std_logic_vector(6 downto 0)
);
end component;
signal clk1m,clk1k,clk1s,locked:std_logic;
signal qh,ql:integer;
signal qcnt,qshow:integer;
begin
u0:mypll port map(not rst,clk50m,clk1m,locked);
u1:freqn generic map(1000000)

port map(clk1m,locked,clk1s);
u2:freqn generic map(1000)

port map(clk1m,locked,clk1k);
u3:cd port map(clk1s,key,qh,ql);
u4:countn generic map(4)

port map(clk1k,locked,'1',qcnt);
qshow<=qh when qcnt=1 else

ql when qcnt=0 else

10;
dig<="1110"when qcnt=0 else

"1101" when qcnt=1 else

"1111";
u5:ledshow port map(qshow,seg);

led<='0' when qh=0 and ql=0 else

'1';

end ach;
library ieee;
use ieee.std_logic_1164.all;
entity cd is
port(clk,rst:in std_logic;

qh,ql:buffer integer range 0 to 9

);
end cd;
architecture ach of cd is
begin
process(clk,rst)

begin

if rst='0' then
qh<=6;
ql<=0;
elsif rising_edge(clk) then

if ql=0 then

ql<=9;

if qh=0 then

qh<=0;

ql<=0;

else

qh<=qh-1;

end if;

else

ql<=ql-1;

end if;
end if;
end process;

end ach;
--input number 0~9, and output abcdefg for digital tube
library ieee;
use ieee.std_logic_1164.all;

entity ledShow is

port(

q:in integer;

seg:out std_logic_vector(6 downto 0)
);
end ledShow;

architecture ach of ledShow is
begin
with q select

seg<="1000000" when 0 ,

"1111001" when 1 ,

"0100100"when 2 ,

"0110000"when 3 ,

"0011001"when 4 ,

"0010010"when 5 ,

"0000010"when 6 ,

"1111000"when 7 ,

"0000000"when 8 ,

"0010000" when 9 ,

"1111111" when others;

end ach;
--任意整数分频

library ieee;
use ieee.std_logic_1164.all;
--实体
entity freqN is
generic (
n:integer:=100
);
port(
clk,rst:in std_logic;
clkout:out std_logic
);
end freqN;
--结构体
architecture ach of freqN is

--任意进制计数器元件例化声明
component countN
generic(

n:integer:=100
);
port(

clk,rst,en:in std_logic;

cout:out std_logic;

qdata:out integer
);
end component;

signal qdata:integer:=0;
signal cout:std_logic;
begin

--n进制计数器例化

u0:countN generic map(n)

port map(clk,rst,'1',open,qdata);


--

clkout<='1' when qdata--

'0';

process(rst,clk)
begin

if rst='0' then

clkout<='0';

elsif rising_edge(clk) then

if qdata=0 then

clkout<='0';

else

clkout<='1';

end if;

end if;
end process;
end ach;
library ieee;
use ieee.std_logic_1164.all;
--实体任意进制计数器
entity countN is
generic(

n:integer:=100
);
port(

clk,rst,en:in std_logic;

qdata:out integer;

cout:out std_logic
);
end countN;
--结构体
architecture ach of countN is

--任意进制计数器元件例化声明
signal qtmp:integer:=0;

begin

process(rst,clk) --敏感信号
begin
if rst='0' then

qtmp<=0;

cout<='0';
elsif rising_edge(clk) then

if en='1' then

if qtmp=n-1 then

qtmp<=0;

else

qtmp<=qtmp+1;

end if;


if qtmp=n-2 then


cout<='1';

else

cout<='0';

end if;

end if;
end if;
-- if qtmp=n-1 then
--

cout<='1';
-- else
--

cout<='0';
-- end;
end process;
qdata<=qtmp;

end ach;

艾达对川木:
You only see what ur eyes want to see
How can life be what u want it to be?
You r frozen when your heart's not open
You r so consumed with how much u get
You waste your time with hate and regret
You r broken when your heart's not open
Now there's no point in placing the blame
And u should know I'd suffer the same
If I lose u, my heart will be broken
Love is a bird, she needs to fly, let all the hurt inside you die
You r frozen when ur heart's not open.
If I could melt ur heart, we'd never be apart.
Give yourself to me, u r the key.

ROAD TO WEMBLEY TOUR 2023 ️ the good witch is getting her own yellow brick road this uk tour has been such a dream and now we get to do it again in october the very season of the witch herself and the album will be out and i will get to hear from all the ppl in my heart once again <3333 if u preorder the album u will get a special presale code next week before general sale starts this friday i literally cannot wait :’)

#maisiepeters##MaisiePeters[超话]#


发布     👍 0 举报 写留言 🖊   
✋热门推荐
  • 希島あいり×福島裕二 写真展(完)お越し下さった皆様ありがとうございました!今この広い世界の中で存在している約78億人の中の1人だということが特別で特殊な事なの
  • Lake McDonald Lodge 是湖上最大的住宿设施,位于 Going-to-the-Sun 路以东约 5 英里(8.0 公里)处。麦克唐纳湖海拔 3
  • #出国工作[超话]#【如果给你1000万,让你选择一只股票买入,并且是持有3年,你会选择哪一只?当你手里只有10万的时候,你会觉得有了100万我就吃喝不愁了;当
  • 所以除了自己的车和巴特姥爷的车,这次给巴特爷爷的车上也安排了安全座椅,力求做到安全问题无死角[偷笑]选择安全座椅一直很慎重,因为这个关乎着孩子出行的安全保障。”
  • 【SixTONES】\/✨\❤️/✨\/7th SG「わたし」 発売日まであと34日──────────カップリングタイトル解禁!✨どんな曲か楽しみです\/✨\
  • 【四月】谎言[黑胶]时隔一年半 又重新拿起落灰的尼康开始拍写真拍了两对情侣 拍了劈的1.0 自导自演了劈2.0和915把照片刻进光盘里就像黑胶唱片 是记忆里最青
  • 然而在社会主义中国,更多的技术革新是通过政府发文件主导,社会和企业各界配合,再加上中国的后发优势,这一过程特别迅速,因此,也许学生还没出学校,技能已经过时…但为
  • 23.让我有从一而终的憧憬和随时奉陪的热情的人是你。14.我会遇见很多有趣的人,但永远不会落下你。
  • 在北京12345问政平台,有网友在去年8月、今年3月两次询问市郊铁路S2线南段通勤化改造工程进展,两次回复口径一致,分别是“市郊铁路东北环线(包含S2线南段通勤
  • #STU48##吉田彩良# via 中国新聞twiSTU48 吉田彩良さん「やりきった、と思えるまで頑張りたい」【STU48わたし時間】chugoku-np.c
  • 当低调敏感巨蟹子碰上风趣高调的双子,恋爱的火花就此产生,内向的巨蟹很容易被幽默的双子吸引,而有内才的巨蟹更会给双子一种想深入了解你的冲动!天秤男&天秤女
  • 清明将至,安徽省退役军人事务厅在线上开通“江淮祭英烈”祭扫平台,一座座庄严肃穆的烈士陵园,一张张鲜活炙热的烈士英容,打开页面,就像推开一道穿越时空的大门,将线上
  • #阿弥陀佛##信仰##佛教##修行##供养#忏悔文:我忏悔往昔所造诸恶业,皆由无始贪嗔痴。南无阿弥陀佛!
  • #阳光信用[超话]##阳光信用# [心]#每日一善# 有一颗随缘心,便会更洒脱;有一颗平常心,便会更从容;有一颗慈悲心,便会更善良;有一颗感恩心,便会更知足;有
  • 往常亚洲把冬装收起来第一人应该是我!!!(可恶)一言难尽的三月终于过去了 整月内心活动be like:惊呆了老铁 这是什么表演短短的工作也快两年 学会最大的本领
  • 】#淄博# 经过三个月的努力,淄博市质检院获得菲律宾瓷砖实验室测试许可,目前全国只有两家实验室取得此项许可。2020年12月22日,菲律宾贸工部发布了对瓷砖进行
  • 关于被李校长吐槽的爱好很多系列之除了做饭和跳舞,还有手绘[doge]今天是手绘手机壳呀[开学季][开学季]情侣手机壳安排[开学季]以及捎带着给茂茂设计了艺术字(
  • 之前在太原养了两只猫年前的时候带回老家了之后就一直是家里人在帮我养了我就负责买点猫砂猫粮什么的(都是母的)家里还有一只经常来混吃混喝的流浪猫,大橘因为冬天外面冷
  • (海口网记者 陈捷)之前在太原养了两只猫年前的时候带回老家了之后就一直是家里人在帮我养了我就负责买点猫砂猫粮什么的(都是母的)家里还有一只经常来混吃混喝的流浪猫
  • #溪雅# 《遇见》 下楼,遇见两个花朵似的小姑娘,我说,你们看这柳树,是不是“树头新绿未成荫”?”这世间幸福的事,莫过于遇到一个爱你的人,然后把你宠成孩子。