library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating ---- any Xilinx primitives in this code. --library UNISIM; --use UNISIM.VComponents.all;
entity FinalProject is port(opcode: in bit_vector(2 downto 0);
A,B: in bit_vector(3 downto 0);
output1: out bit_vector(3 downto 0);
zero: out bit_vector); end FinalProject;
architecture behavioral of FinalProject is
begin process (A,B)
begin
if A=B then zero<="1"; else
Case opcode is
when"001"=>zero<="1";
when "010" => output1 <= (B*B);
when "011" =>output1<= (A/2);
when "100" => output1 <= (A and B);
when "101" => output1 <= (A nor B);
when "110" => output1<= (A or B);
when "111" => output1<= (A xor B);
when others => output1 <= "0000";
end case;
end if; end process ; end Behavioral;
这个是我看了资料编的 但是在乘法和除法上还是不行 有没有大哥能指点我一下的啊 十万火急 真的希望有好心人能帮帮我啊 |