·¶Ã÷éð 0958200102 ÄϾ©Àí¹¤´óѧ 2012 ¨C 03 ¨C 26
END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF; END IF;
END IF; END IF; END IF; END IF; END IF;
qout1<=tem1; qout2<=tem2; END PROCESS; END behav; ·ÂÕæ
1£¬ ÔÚÈðÄê 1984/02
13
·¶Ã÷éð 0958200102 ÄϾ©Àí¹¤´óѧ 2012 ¨C 03 ¨C 26
ÆÕͨÄê
Ä£¿é
6. ¼ÆÔÂÄ£¿é£º Ä£12µÄ¼ÆÊý£¬VHDL³ÌÐòÈçÏÂ
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL;
14
·¶Ã÷éð 0958200102 ÄϾ©Àí¹¤´óѧ 2012 ¨C 03 ¨C 26
USE IEEE.STD_LOGIC_ARITH.ALL;
ENTITY yue IS
PORT( clk: IN STD_LOGIC; rst: IN STD_LOGIC; en: IN STD_LOGIC;
qout1: OUT STD_LOGIC_VECTOR(3 DOWNTO 0); qout2: OUT STD_LOGIC_VECTOR(3 DOWNTO 0);
co: OUT STD_LOGIC);
END yue;
ARCHITECTURE behav OF yue IS
SIGNAL tem1: STD_LOGIC_VECTOR(3 DOWNTO 0); SIGNAL tem2: STD_LOGIC_VECTOR(3 DOWNTO 0); BEGIN PROCESS(clk,rst) BEGIN IF (en='1')THEN tem1<=tem1;
tem2<=tem2;
ELSIF(rst='0')THEN tem1<=\
tem2<=\
ELSIF(clk'event AND clk='1')THEN IF (tem2=\ tem1<=\ tem2<=\
co<='1';
ELSE co<='0';
IF(tem1=\
tem1<=\
15
·¶Ã÷éð 0958200102 ÄϾ©Àí¹¤´óѧ 2012 ¨C 03 ¨C 26
tem2<=tem2+1; ELSE
tem1<=tem1+1;
END IF;
END IF;
END IF; qout1<=tem1; qout2<=tem2;
END PROCESS;
END behav; ·ÂÕ棺
Ä£¿é
7. ¼ÆÄêÄ£¿é£º Ä£12µÄ¼ÆÊý£¬VHDL³ÌÐòÈçÏ£º
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_ARITH.ALL;
ENTITY nian IS
16