【文章內容簡介】
的應用。掌握宏功能模塊的應用。掌握系統(tǒng)存儲器數(shù)據(jù)讀寫編輯器的應用。明確設計任務和要求,了解EDA技術的基本應用過程及領域。理解百年歷的設計原理及分析方法。三、實訓器材與場地:EDA實驗箱、計算機,EDA實驗室四、設計思路:先設計“秒”、“分”、“時”、“日”、“月”、“年”、“選擇”及“調整”等模塊,然后把各模塊按照生活中日歷時鐘走動的規(guī)律連接在一起,最后調試并下載、綁定引腳、調整。五、設計任務與要求、設計原理與模塊設計任務:用VHDL語言設計“秒鐘”即六十進制計數(shù)器。用VHDL語言設計“分鐘” 即六十進制計數(shù)器。用VHDL語言設計“時鐘” 即二十四進制計數(shù)器。用VHDL語言設計“日”系統(tǒng)。用VHDL語言設計“月”系統(tǒng)。用VHDL語言設計“年”系統(tǒng)。用VHDL語言設計“選擇”系統(tǒng)。用VHDL語言設計“調整”系統(tǒng)。調用以上模塊,在Block Diagram/Schematic File 中編輯窗口中把它們按一定規(guī)律連接起來即百年歷系統(tǒng)。設計要求:在現(xiàn)實生活中,年份有平閏之分,當平年的2月份有28天,閏年的2月份29天,每年的12月份都是31天,11月份都是30天,故在設計“年、月、日”系統(tǒng)時必須考慮它們之間的關系,由于手中的EDA實驗箱上的數(shù)碼管不足,必須設計一個“選擇”系統(tǒng),讓“年月日時分秒”分成兩屏顯示。在現(xiàn)實生活中,日期和時間在不同的地方時間不同,故需設計一個“調整”系統(tǒng)用來調整日期及時間。設計源程序及其生成的模塊:六十進制計數(shù)器源程序及其模塊library ieee。use 。use 。entity t60 is port(clk:in std_logic。m1:out std_logic_vector(3 downto 0)。m2:out std_logic_vector(3 downto 0)。cout:out std_logic)。end t60。architecture behav of t60 is begin process(clk)variable cq1,cq2:std_logic_vector(3 downto 0)。begin if clk39。event and clk=39。139。 then cq1:=cq1+1。if cq19 then cq1:=“0000”。cq2:=cq2+1。end if。if cq2=5 and cq1=9 then cq2:=“0000”。cq1:=“0000”。coutend if。end if。m1二十四進制計數(shù)器源程序及其模塊library ieee。use 。use 。entity t24 is port(clk:in std_logic。q1:out std_logic_vector(3 downto 0)。q2:out std_logic_vector(3 downto 0)。cout:out std_logic)。end t24。architecture behav of t24 is begin process(clk)variable cq1,cq2:std_logic_vector(3 downto 0)。begin if clk39。event and clk=39。139。 then cq1:=cq1+1。if cq19 then cq1:=“0000”。cq2:=cq2+1。end if。if cq2=2 and cq13 then cq2:=“0000”。cq1:=“0000”。cout“日”系統(tǒng)源程序及其模塊library ieee。use 。use 。entity tian isport(clk:in std_logic。a: in std_logic。b:in std_logic。t1:out std_logic_vector(3 downto 0)。t2:out std_logic_vector(3 downto 0)。cout:out std_logic)。end tian。architecture behav of tian is signal Q1,Q2: std_logic_vector(3 downto 0)。signal ab: std_logic_vector(1 downto 0)。begin process(clk,a,b)begin if clk39。event and clk=39。139。then Q1if Q1=9 then Q1end if。abcase ab iswhen“00” =if Q2=3 and Q1=1 then Q2else coutend if。when“01” =if Q2=3 and Q1=0 then Q2else coutend if。when“10” =if Q2=2 and Q1=8 then Q2else coutend if。when“11” =if Q2=2 and Q1=9 then Q2else coutend if。when others =null。end case。end if。end process。t1“月”系統(tǒng)源程序及其模塊library ieee。use 。use 。entity yue isport(clk:in std_logic。run:in std_logic。y1:out std_logic_vector(3 downto 0)。y2:out std_logic_vector(3 downto 0)。a,b,cout:out std_logic)。end yue。architecture behav of yue is signal q1,q2 : std_logic_vector(3 downto 0)。signal q1q2 : std_logic_vector(7 downto 0)。begin process(clk)beginif clk39。event and clk=39。139。 thenq1if q1=9 then q139。039。)。q2end if。if q2=1 and q1=2 then q139。039。)。coutelse coutend if。end if。end process。process(clk)beginq1q2when “00000001” = awhen “00000010” =if run=39。039。 then aelse aend if。when “00000011” = a a a a a a a a a aNULL。end case。end process。y1y2“年”系統(tǒng)源程序及其模塊library ieee。use 。use 。entity nian isport(clk:in std_logic。run:out std_logic。n1:out std_logic_vector(3 downto 0)。n2:out std_logic_vector(3 downto 0))。end nian。architecture behav of nian is signal q1,q2,q: std_logic_vector(3 downto 0)。begin process(clk)beginif clk39。event and clk=39。139。 thenq1if q1=9 then q139。039。)。q2if q1=9 and q2=9then q1end if。end if。end if。end process。process(clk)begin if clk39。event a