Completato modulo TwoComplement

This commit is contained in:
2019-08-29 15:12:25 +02:00
parent 8b08af2782
commit 12f2e36d7c
166 changed files with 1038 additions and 6113 deletions

View File

@@ -2,25 +2,32 @@ library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Swap is
generic(BITCOUNT : integer := 8);
generic(
BITCOUNT : integer := 8
);
port(
X_IN, Y_IN : in std_logic_vector((BITCOUNT-1) downto 0);
SW : in std_logic;
X_OUT, Y_OUT : out std_logic_vector((BITCOUNT-1) downto 0)
);
end Swap;
architecture SwapArch of Swap is
begin
SWAP_PRO: process(X_IN, Y_IN, SW)
SWAP_PROCESS: process(X_IN, Y_IN, SW)
begin
for i in (BITCOUNT-1) downto 0 loop
X_OUT(i) <= (not(SW) and X_IN(i)) or (SW and Y_IN(i));
Y_OUT(i) <= (not(SW) and Y_IN(i)) or (SW and X_IN(i));
end loop;
end process;
end SwapArch;