【正文】
thers = CI(19 downto 12)= TMP4。end if。 end busv1_behav。use 。use 。use 。 CO: in std_logic_vector(14 downto 0))。architecture Behavioral of jicunqi issignal RS:std_logic_vector(2 downto 0)。signal WRE,RDE,U244AOE,U244BOE:std_logic。signal DBB,DBX:std_logic_vector(7 downto 0)。Function sizeIt(a:std_logic。 begin for i in rep39。end loop。 end sizeIt。 DBX = (SizeIt(U244AOE,8) and U244A) or (SizeIt(U244BOE,8) and U244B)。139。 DBB = CI(7 downto 0)。process (WRE,RDE) begin if(WRE39。139。 when 001=R1=DBB(7 downto 0)。 when 011=R3=DBB(7 downto 0)。 when 101=R5=DBB(7 downto 0)。 when others=R7=DBB(7 downto 0)。 end if。event and RDE=39。) then 讀寄存器 case RS is when 000 = U244B = R0。 when 010 = U244B = R2。 when 100 = U244B = R4。 when 110 = U244B = R6。 end case。 end process。U244AOE = CO(13)。RDE = CO(12)。end Behavioral。L13反映S13的狀態(tài)。第二步,把總線上的數(shù)據(jù)送入74LS377保存,當S14為低電平(U377EN=0)并且S15有一個脈沖信號時從它輸出送ALU的A端。L13反映S13的狀態(tài)。第四步,當S1S17都為1時,控制74LS373從總線接收數(shù)據(jù),寄存。第五步,利用S8~S10的組合在8種計算中選擇一個進行計算,選擇表如下:(L8~L10反映S8~S10的狀態(tài),CIN由開關(guān)S11確定,L11反映S11的值)。第六步,當S12為0時(L12反映S11的值),將74LS244B中的值送總線,一次運算結(jié)束。use 。use 。use 。 CI: inout std_logic_vector(15 downto 0)。end yunsuan。signal U373Q,U244A,U244B:std_logic_vector(7 downto 0)。signal U377CLK,U377EN,U373GT,U373OE,U244AOE,U244BOE: std_logic。signal S:std_logic_vector(2 downto 0)。constant bz:std_logic_vector:=ZZZZZZZZ。 len: integer) return std_logic_vector is variable rep: std_logic_vector( len1 downto 0)。range loop rep(i) := a。 return rep。 beginDefine 74377 process (U377CLK) begin if (U377CLK39。039。039。 end if。 end process。139。039。 define the ALU FA= 39。amp。 FB= 39。amp。 FF= FA + CIN when S =000 else FA CIN when S =001 else FA or FB when S =010 else FA and FB when S =011 else FA + FB + CIN when S =100 else FA FB CIN when S =101 else FA * FB when S =110 else FA xor FB when S =111。 U244B = FF(7 downto 0)。 DBX = (SizeIt(U244AOE,8) and U244A) or (SizeIt(U244BOE,8) and U244B)。139。 DBB = CI(7 downto 0)。U244BOE = CO(12)。U377EN = CO(14)。U373OE = CO(16)。S(2 downto 0) = CO(10 downto 8)。CI(15) = COUT。4 總線的VHDL描述 1. 實驗設計:使用VHDL來完成本實驗時,需注意以下問題:1).透明鎖存7應使用組合電路實現(xiàn)。3).RAM,244,373,374四個三態(tài)門可用一個多路開關(guān)加一個三態(tài)門構(gòu)成。2).從開關(guān)通過244把數(shù)據(jù)(如10010110)輸入到373中。 4).把373的數(shù)據(jù)傳送到RAM中。 6).把RAM的數(shù)據(jù)傳送到374中。首先利用開關(guān)S0~S7設置一個8位的數(shù)據(jù),寄存在74LS244A,使開關(guān)S13(U244AOE)為低電平,使寄存在74LS244中的數(shù)據(jù)向總線輸出。第四步,當RDE(讀寄存器)脈沖信號從0變1時,將某寄存器的值輸出到74LS244B。 use 。