--部分模塊代碼如下:完整代碼及文檔說明附頁下載,工程用quratus 13.1以上打開
2.設計內容
3. 系統的主要功能及使用方法
4. 數字電子鐘的VHDL設計
4.1設計思想
4.2設計電路圖
4.3模塊說明
4.3.1 分頻器
4.3.2功能選擇器
4.3.3一輸入二輸出器
4.3.4計數器1至計數器6
4.3.5計數器(1-3)的校正器、計數器(4-6)的校正器
4.3.6防止異步清零器、異步清零器、數碼管選擇器、led燈選擇器、數碼管顯示時間器
4.3.7頂層文件
4.4硬件配置調試
4.4.1硬件要求
4.4.2引腳綁定
4.2.3現象說明
5. 實驗總結
5.1錯誤和解決方法
時鐘是我們日常生活中必備的生活用品之一。而數字時鐘的出現更是給人們的生產生活帶來了極大的便利。鐘表的數字化給人們生產生活帶來了極大的方便而且大大地擴展了鐘表原先的報時功能。諸如定時自動報警、按時自動打鈴、時間程序自動控制、定時廣播、定時啟閉電路、定時開關烘箱、通斷動力設備,甚至各種定時電氣的自動啟用等,所有這些,都是以鐘表數字化為基礎的。因此,研究數字鐘及擴大其應用,有著非常現實的意義。 本次設計的目的就是在掌握EDA實驗開發系統的初步使用基礎上,學習較復雜數字電路系統的設計。EDA技術為數字類產品提供了一個非常簡便實用的開發平臺。隨著EDA技術的快速發展,數字時鐘的應用越來越廣泛,并且它在功能外觀方面也有了很大的改善和提高。本文就是基于EDA技術的基礎知識,利用Quartus2軟件再現一個具有傳統時鐘功能的數字時鐘。 2.設計內容設計內容: 設計一個電子鐘,要求可以顯示時、分、秒,用戶可以設置時間 設計具體包含的模塊內容如下: 要求: (1)根據系統設計要求,采用自頂向下的方法,劃分系統主要模塊,畫出整體設計原理框圖。 (2)根據工作原理、用硬件描述語言對設計內容實現,列出設計程序清單,給出仿真波形圖和調試中存在問題及解決方法。 (3)設計內容下載至目標芯片,在ALINX開發板上進行功能驗證。 (4)談談該課題的設計中遇到的問題,獲得哪些技能和體會,以及建設性意見。 3.系統的主要功能及使用方法該數字鐘有如下幾個功能 - 數字可以顯示當前時間的秒、分、時,或者作為秒表使用,且每過一秒4個led燈就交替循環亮;
- 一個功能選擇按鍵(key0),用于切換不同狀態:計時、或者對時、分秒的進行校正和更改。
(3)兩個按鍵(key1和key2),每個鍵根據功能選擇鍵(key0)有不同同的作用; ①計時時:key1鍵為時鐘使能鍵,key2為對秒、分、時同時進行異步清零; ②校正時:key1鍵為對秒和分的個位進行校正,key2鍵為對分的十位和時進行校正 4.數字電子鐘的VHDL設計
4.1設計思想本設計采用層次描述方式,采用自頂向下的方法,劃分系統主要模塊,畫出整體設計原理框圖。設計幾個具有各自功能的元件,然后將他們級連得到一個可預制的數字鐘。本設計具有分頻器、功能選擇器、一輸入二輸出器,計數器1至計數器6、計數器(1-3)的校正器,計數器(4-6)的校正器、防止異步清零器、異步清零器、數碼管選擇器、led燈選擇器、數碼管顯示時間器,一共16個模塊,最后把各個元件連接起來。
4.2設計電路圖 圖4.2.1 電路原理圖 圖4.2.2 電路總體模塊名稱圖 4.3模塊說明
4.3.1 分頻器將50mHz的時鐘源分頻為時間計時頻率1秒、數碼管掃描頻率1毫秒、key1消抖頻率0.3秒、key2消抖頻率0.3秒、 key0消抖頻率0.3秒(如圖由上到下)。 圖4.3.1a 分頻器模塊
分頻器程序:如附頁。 仿真波形圖: 圖4.3.1b 4.3.2 功能選擇器:通過key0來選擇時鐘電路的功能是計時還是校正,然后輸出相應的值給計時器1,計數器(1-3)校正器,計數器4,計數器(4-6)校正器。 圖4.3.2a 功能選擇器模塊 功能選擇器程序:如附頁。 波形仿真: 圖4.3.2b 4.3.3 一輸入二輸出器即輸入一個變量,輸出兩個和輸入值相同的變量。 圖4.3.3a 一輸入二輸出器模塊 一輸入二輸出器的程序:如附頁。 波形仿真圖: 圖4.3.3b 4.3.4 計數器1至計數器6 計數器1至計數器6都為計數的功能,前一個計數器進位,則后一個計數 器加1,計數器1至計數器6分別對應6個數碼管。計數器5和計數器6兩個為相互反饋作用,這樣才可以為24進制。計數器1-2為秒,60進制;計數器3-4為分,60進制;計數器5-6為時,24進制。 計數器1模塊 計數器2模塊 計數器3模塊 計數器4模塊 計數器5模塊 計數器6模塊 圖4.3.4a
計數器1至計數器6程序:如附頁。 波形仿真圖: 計數器1 計數器2 計數器3 計數器4 計數器5 計數器6 圖4.3.4a 4.3.5 計數器(1-3)的校正器、計數器(4-6)的校正器 計數器(1-3)的校正器是對計數器1的輸出的值進行校正或更改后,再反饋給計數器1,同時將數值輸出給后面的計數器,以達到修改計數器1到計數器3的值; 計數器(4-6)的校正器是對計數器4的輸出的值進行校正或更改后,反饋給計數器四,同時將數值輸出給后面的計數器,以達到修改計數器4到計數器6的值。 這兩個校正器是否校正取決于功能控制器的選擇。 計數器(1-3)的校正器 計數器(4-6)的校正器 圖4.3.5a 程序代碼:如附頁。 仿真波形圖: 計數器(1-3)的校正器 計數器(4-6)的校正器 圖4.3.5b
4.3.6防止異步清零器、異步清零器、數碼管選擇器、led燈選擇器、數碼管顯示時間器①異步清零器:按key2時,即輸入為低電平時,輸出低電平給計數器1至 計數器6的清零端,然后可以對6個計數器的數值進行清零。 ②防止異步清零器:當前模式為校正模式,按key2來調整計數器4至計數 器6的數值時,防止計數器2至計數器6的數值被清零。 ③數碼管選擇器:用高頻率來不斷切換數碼管顯示,達到6個個數碼管動態 顯示的程度。 ④led燈選擇器:每過一秒,在4個led燈之間切換循環顯示亮,便于觀察和檢測程序。 ⑤數碼管顯示時間器:將6個計數器的值分別用6個數碼管來顯示,數碼管掃描頻率高的話,可以達到6個數碼管一起亮的程度,即可以顯示時間。
異步清零器 防止異步清零器 數碼管選擇器 led燈選擇器 數碼管顯示時間器 圖4.3.5a 各模塊程序代碼:如附頁。 仿真波形: 異步清零器仿真波形 防止異步清零器仿真波形
數碼管選擇器波形圖 led燈選擇器波形圖 數碼管顯示時間器波形圖 圖4.3.6b 4.3.7頂層文件語句例化,將上述設計實體定義為元件,將這些元件與頂層的設計實體的各端口相連,實現自頂而下的層次化設計。
頂層文件程序:如附頁。 仿真波形圖(如圖4.3.7):分頻頻率大,不易觀察,但結果還是對的。 圖4.3.7 4.4硬件配置調試
4.4.1硬件要求 (1)主芯片EP4CE6F17C8; (2)三個按鍵,按鍵key0,按鍵key1和按鍵key2; (3)ALINX開發板。
4.4.2引腳綁定圖4.4.2 4.2.3現象說明將代碼燒錄進開發板后,按一次key0(按下后松開),數碼管開始計時顯示時間,時、分、秒依次為24進制、60進制、60進制。此時為時間計時模式,按下key1(按下后不放)時,暫停計時(如圖1);按一次key2(按下后松開),6個數碼管清零,即時鐘的時、分、秒清零(如圖2),然后開始計時,也可以作為秒表。 再按一次key0(按下后松開),此時模式變為校正模式(如圖3),通過不斷按key1(按下后松開),來對前三個數碼管的數值進行更改(如圖4),通過不斷按key2(按下后松開),來對后三個數碼管的數值進行更改(如圖5)。即key1用來更改分的個位與秒的值,key2更改分的十位與時的值。以此達到對時鐘時間的校正更改。 圖1 暫停 圖2 異步清零
圖3 校正模式 圖4 更改右邊前三個數碼管的值 圖5 更改左邊前三個數碼管的值 5.實驗總結5.1錯誤和解決方法 (1)按鍵在未消抖的情況下,對電子鐘數值的校正不準確不精確,按一次鍵,相當于按過了幾百次,時鐘數值變化幅值太大了,幾百幾百的跳。 解決:對開發板的時鐘源進行分頻,分出一個對按鍵消抖的時鐘信號,當檢測到按下鍵了,經過時鐘信號的上升沿時,才會輸出按鍵的值,這樣就會使一個時鐘周期只會促發一次按鍵。以此來達到按鍵消抖。 (2)對計數器1進行校正或者計數時,都要出發不同的時鐘信號上升沿,但一個進程不允許檢測多個信號的上升沿。 解決:再建立一個校正模塊(即計數器1-3的校正器),對計數器1的輸出值判斷是否要校正,若要校正,那么校正完畢后,再將數值反饋給計數器1,使計數器1的輸入值變為校正過后的值,同時將數值輸出給下一個模塊。若無校正,則無須反饋,直接將數值輸出到下一模塊。計數器4也依此方法。以此來達到對電子鐘的時間進行校正更改。 (3)key2有兩個功能,計時模式時為清零鍵,校正模式為對電子鐘的時間進行更改,按下時,經常兩個功能都觸發,使得每次校正后的值都被清零。 解決:建立一個模塊(防止異步清零模塊),對電子鐘此時的功能判斷,使key有不同的功能,就不會使key2的兩種功能同時觸發了。
(4)電子中的時的個位(第五個數碼管)和十位(第六個數碼管),其個位是9進制的,十位是2進制的,但其電子鐘的時是24進制的。 解決:從十位(第六個數碼管)引出一個反饋給個位(第五個數碼管),當十位為2時,個位為4進制。這樣就使得電子鐘的時為24進制了,也不會使個位(第五個數碼管)和十位(第六個數碼管)的進制與電子鐘的時的進制發生沖突了。 5.2心得與體會 這次期末時間有限,使得這次設計設計電子鐘的時間太少,解決程序代碼的時間太少了,未能更進一步對設計出來的電子鐘進行功能的的增加,如鬧鐘,整點報時等功能,有點遺憾。但也學到了許多東西,對開發FPGA的VHDL語言掌握更得更好了,解決問題也有了一定的方法和耐心了,在設計學習的過程中更能靜下心來了。這此設計時間雖短,但對我的意義很大。我也記住了,單片機的按鍵要消抖,那么PFGA的按鍵也要消抖,無論哪種,對按鍵都要消抖。按鍵在哪都要消抖,不然對其系統模塊會產生很大的錯誤。
附頁:
代碼按目錄依次為
分頻器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity fpq is
port (clkf:in std_logic;
clk_1hz,clk_smg,clk_xd,clk_xd4,clk_k:out std_logic);
end fpq;
architecture fpq of fpq is
signal q1:integer range 0 to 49999999;
signal q2:integer range 0 to 49999;
signal q3:integer range 0 to 16999999;
begin
process(clkf) begin
if rising_edge(clkf) then
if q1=4999999 then q1<=0;else
q1<=q1+1;end if;
if q1>2499999 then clk_1hz<='0';else
clk_1hz<='1';
end if;
if q2=49999 then q2<=0;else
q2<=q2+1;end if;
if q2>24999 then clk_smg<='0';else
clk_smg<='1';
end if;
if q3=16999999 then q3<=0;else
q3<=q3+1;end if;
if q3>9499999 then clk_xd<='0';clk_xd4<='0';clk_k<='0';else
clk_xd<='1';clk_xd4<='1';clk_k<='1';
end if;
end if;
end process ;
end fpq;
功能選擇器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity kzq is
port (ret,clkk:in std_logic;
jy1,j1,jy2,j2,j56:out std_logic);
end kzq;
architecture kzq of kzq is
signal q0,q1,q2,q3,qclk:std_logic;
signal qx:std_logic_vector(1 downto 0);
begin
process(ret) begin
q0<=ret;
if q0='0' then
if falling_edge(clkk) then
if qx<1 then qx<=qx+1;else
qx<=(others=>'0');end if;end if;end if;
case qx is
when "00"=>jy1<='0';j1<='0';jy2<='0';j2<='0';j56<='0';
when "01"=>jy1<='1';j1<='1';jy2<='1';j2<='1';j56<='1';
when others=>null;
end case;
end process;
end kzq;
一輸入二輸出器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity enx is
port (ena:in std_logic;
e1,e2:out std_logic);
end enx;
architecture enx of enx is
begin
e1<=ena;
e2<=ena;
end enx;
計數器1:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq is
port (clock,rsta,ena,jy:in std_logic;
s1:in std_logic_vector(3 downto 0);
c1:in std_logic;
leda:out std_logic_vector(3 downto 0);
jsqsc1:out std_logic_vector(3 downto 0);
jsq_co1:out std_logic);
end jsq;
architecture jsq1 of jsq is
signal q1,q5:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(clock)
variable q3,q4:std_logic_vector(3 downto 0);
begin
case jy is
when '1' =>
if rsta='0' then q3:=(others=>'0');
elsif rising_edge(clock) then
if ena='0' then q1<=q1;q5<=q5; else
if q3<9 then q3:=q3+1;q2<='0';
else q3:=(others=>'0');q2<='1';end if;
if q4<3 then q4:=q4+1;
else q4:=(others=>'0');end if;end if;end if;
q1<=q3;q5<=q4;
when '0' => q1<=s1;q2<=c1;
when others =>null;
end case;
end process;
leda<=q5;jsqsc1<=q1;jsq_co1<=q2;
end jsq1;
計數器2:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq2 is
port (s2,rsta2:in std_logic;
jsqsc2:out std_logic_vector(3 downto 0);
jsq_co2:out std_logic);
end jsq2;
architecture jsq2 of jsq2 is
signal q1:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(s2)
variable q3:std_logic_vector(3 downto 0);
begin
if rsta2='0' then q3:=(others=>'0');q1<="0000";
elsif rising_edge(s2) then
if q3<5 then q3:=q3+1;q2<='0';
else q3:=(others=>'0');q2<='1';
end if;end if;
q1<=q3;
end process;
jsq_co2<=q2;
jsqsc2<=q1;
end jsq2;
計數器3:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq3 is
port (s3,rsta3:in std_logic;
jsqsc3:out std_logic_vector(3 downto 0);
jsq_co3:out std_logic);
end jsq3;
architecture jsq3 of jsq3 is
signal q1:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(s3)
variable q3:std_logic_vector(3 downto 0);
begin
if rsta3='0' then q3:=(others=>'0');q1<="0000";
elsif rising_edge(s3) then
if q3<9 then q3:=q3+1;q2<='0';
else q3:=(others=>'0');q2<='1';
end if;end if;
q1<=q3;
end process;
jsq_co3<=q2;
jsqsc3<=q1;
end jsq3;
計數器4:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq4 is
port (s4,rsta4,jy4:in std_logic;
ss4:in std_logic_vector(3 downto 0);
c4:in std_logic;
jsqsc4:out std_logic_vector(3 downto 0);
jsq_co4:out std_logic);
end jsq4;
architecture jsq4 of jsq4 is
signal q1:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(s4,rsta4,jy4,ss4,c4)
--variable q3:std_logic_vector(3 downto 0);
begin
case jy4 is
when '1'=>
if rsta4='0' then q1<="0000";
elsif rising_edge(s4) then
if q1<5 then q1<=q1+1;q2<='0';
else q1<=(others=>'0');q2<='1';end if;end if;
--q1<=q3;
when'0'=>
q1<=ss4;q2<=c4;
when others=>null;
end case;
--q1<=q3;
end process;
jsqsc4<=q1;
jsq_co4<=q2;
end jsq4;
計數器5:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq5 is
port (s5,rsta5:in std_logic;
sz6:in std_logic_vector(3 downto 0);
jsqsc5:out std_logic_vector(3 downto 0);
pd5:out std_logic_vector(3 downto 0);
jsq_co5:out std_logic);
end jsq5;
architecture jsq5 of jsq5 is
signal q1,q4:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(s5)
variable q3:std_logic_vector(3 downto 0);
begin
q4<=sz6;
if rising_edge(s5) then
if q3<9 then q3:=q3+1;q2<='0';
else q3:=(others=>'0');q2<='1';
end if;
if ((q1=3) and (q4=2)) then q3:=(others=>'0');q2<='0';end if;end if;
if rsta5='0' then q3:=(others=>'0');q1<="0000";end if;
q1<=q3;
end process;
jsq_co5<=q2;
jsqsc5<=q1;
pd5<=q1;
end jsq5;
計數器6:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jsq6 is
port (s6,rsta6:in std_logic;
sz5:in std_logic_vector(3 downto 0);
jsqsc6:out std_logic_vector(3 downto 0);
pd6:out std_logic_vector(3 downto 0)
);
end jsq6;
architecture jsq6 of jsq6 is
signal q1,q4:std_logic_vector(3 downto 0);
begin
process(s6,sz5)
variable q3:std_logic_vector(3 downto 0);
begin
if rising_edge(s6) then
if q3<2 then q3:=q3+1;
else q3:=(others=>'0');
end if;
if ((q1=3) and (q4=2)) then q3:=(others=>'0');end if;end if;
if rsta6='0' then q3:=(others=>'0');q1<="0000";end if;
q1<=q3;
end process;
jsqsc6<=q1;
pd6<=q1;
end jsq6;
計數器(1-3)的校正器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jf is
port (xd,ena,jy:in std_logic;
s1:in std_logic_vector(3 downto 0);
c1:in std_logic;
jsqsc1,s:out std_logic_vector(3 downto 0);
jsq_co1,c:out std_logic);
end jf;
architecture jf of jf is
signal q1,q5,q6:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(xd)
variable q3:std_logic_vector(3 downto 0);
begin
case jy is
when '0'=>
if ena='0' then
if rising_edge(xd) then
if q3<9 then q3:=q3+1;q2<='0';
else q3:=(others=>'0');q2<='1';end if;end if;end if;
q1<=q3;
when '1'=>
q1<=s1;q2<=c1;
when others =>null;
end case;
end process;
jsqsc1<=q1;jsq_co1<=q2;
s<=q1;c<=q2;
end jf;
計數器(4-6)的校正器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity jf4 is
port (xd4,rst4,jy4:in std_logic;
s1:in std_logic_vector(3 downto 0);
c1:in std_logic;
jsqsc4,s4:out std_logic_vector(3 downto 0);
jsq_co4,c4:out std_logic);
end jf4;
architecture jf4 of jf4 is
signal q1,q5,q6:std_logic_vector(3 downto 0);
signal q2:std_logic;
begin
process(xd4)
--variable q3:std_logic_vector(3 downto 0);
begin
case jy4 is
when '0'=>
if rst4='0' then
if rising_edge(xd4) then
if q1<5 then q1<=q1+1;q2<='0';
else q1<=(others=>'0');q2<='1';end if;end if;end if;
--q1<=q3;
when '1'=>
q1<=s1;q2<=c1;
when others =>null;
end case;
end process;
jsqsc4<=q1;jsq_co4<=q2;
s4<=q1;c4<=q2;
end jf4;
異步清零器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity qlq is
port (rstaq:in std_logic;
rstaq0,rstaq1,rstaq2,rstaq3,rstaq4,rstaq5,rstaq6:out std_logic);
end qlq;
architecture qlq of qlq is
signal q1:std_logic;
signal q:std_logic_vector(5 downto 0);
begin
q1<=rstaq;
rstaq0<=q1;
rstaq1<=q1;
rstaq2<=q1;
rstaq3<=q1;
rstaq4<=q1;
rstaq5<=q1;
rstaq6<=q1;
end qlq;
防止異步清零器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity kz56 is
port(jy56,rsta2,rsta3,rsta4,rsta5,rsta6:in std_logic;
rst2,rst3,rst4,rst5,rst6:out std_logic);
end kz56;
architecture kz56 of kz56 is
begin
process(jy56) begin
if jy56='0' then rst2<='1';rst3<='1';rst4<='1';rst5<='1';rst6<='1';else
rst2<=rsta2;rst3<=rsta3;rst4<=rsta4;rst5<=rsta5;rst6<=rsta6;
end if;
end process;
end kz56;
數碼管選擇器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity smgxz is
port (clksmg:in std_logic;
sle:out std_logic_vector(2 downto 0));
end smgxz;
architecture smgxz of smgxz is
signal q1:std_logic_vector(2 downto 0);
begin
process(clksmg)
variable asmg:std_logic_vector(2 downto 0); begin
if rising_edge(clksmg) then
if asmg<5 then asmg:=asmg+1;else
asmg:="000";
end if;end if;
q1<=asmg;
sle<=q1;
end process;
end smgxz;
led燈選擇器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity ledymq is
port (ledin:in std_logic_vector(3 downto 0);
ledout:out std_logic_vector(3 downto 0));
end ledymq;
architecture ledymq of ledymq is
signal q:std_logic_vector(3 downto 0);
begin
process(ledin) begin
q<=ledin;
case q is
when "0000" => ledout<="0001";
when "0001" => ledout<="0010";
when "0010" => ledout<="0100";
when "0011" => ledout<="1000";
when others=>null;
end case;
end process;
end ledymq;
數碼管顯示時間器:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity scxz is
port( z:in std_logic_vector(2 downto 0);
g:out std_logic_vector(5 downto 0);
s:out std_logic_vector(7 downto 0);
h,i,j,k,l,m:in std_logic_vector(3 downto 0));
end scxz;
architecture scxz of scxz is
signal p:std_logic_vector(3 downto 0);
signal q1:std_logic_vector(2 downto 0);
begin
process(z,h,i,j) begin
q1<=z;
if q1="000" then p<=h; g<="111110";
elsif q1="001" then p<=i; g<="111101";
elsif q1="010" then p<=j; g<="111011";
elsif q1="011" then p<=k; g<="110111";
elsif q1="100" then p<=l; g<="101111";
elsif q1="101" then p<=m; g<="011111";
end if;
case p is
when "0000"=>s<="11000000";--0
when "0001"=>s<="11111001";--1
when "0010"=>s<="10100100";--2
when "0011"=>s<="10110000";--3
when "0100"=>s<="10011001";--4
when "0101"=>s<="10010010";--5
when "0110"=>s<="10000010";--6
when "0111"=>s<="11111000";--7
when "1000"=>s<="10000000";--8
when "1001"=>s<="10010000";--9
when others=>s<="11000000";--0
end case;
end process;
end scxz;
原理圖
制作出來的實物圖如下:
代碼下載:
代碼與文檔.7z
(5.33 MB, 下載次數: 30)
2022-4-10 21:02 上傳
點擊文件名下載附件
全部代碼和報告說明
|