Advertisement
Guest User

shiftrows

a guest
Oct 26th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 10/18/2016 10:34:49 AM
  6. -- Design Name:
  7. -- Module Name: invshift - Behavioral
  8. -- Project Name:
  9. -- Target Devices:
  10. -- Tool Versions:
  11. -- Description:
  12. --
  13. -- Dependencies:
  14. --
  15. -- Revision:
  16. -- Revision 0.01 - File Created
  17. -- Additional Comments:
  18. --
  19. ----------------------------------------------------------------------------------
  20.  
  21.  
  22. library IEEE;
  23. use IEEE.STD_LOGIC_1164.ALL;
  24. use IEEE.NUMERIC_STD.ALL;
  25. -- Uncomment the following library declaration if using
  26. -- arithmetic functions with Signed or Unsigned values
  27. --use IEEE.NUMERIC_STD.ALL;
  28.  
  29. -- Uncomment the following library declaration if instantiating
  30. -- any Xilinx leaf cells in this code.
  31. --library UNISIM;
  32. --use UNISIM.VComponents.all;
  33.  
  34. entity invshift is
  35. Port ( clk : in STD_LOGIC;
  36. input : in STD_LOGIC_VECTOR (0 to 127);
  37. reset : in STD_LOGIC;
  38. output : out STD_LOGIC_VECTOR (0 downto 127));
  39. end invshift;
  40.  
  41. architecture Behavioral of invshift is
  42.  
  43. begin
  44. process(clk)
  45. begin
  46. if(rising_edge(clk)) then
  47. if(reset = '1') then
  48. output <= (others => '0');
  49. else
  50. output(0 downto 7) <= std_logic_vector(input(0 downto 7));
  51. output(8 downto 15) <= input(104 downto 111);
  52. output(16 downto 23) <= input(80 downto 87);
  53. output(24 downto 31) <= input(56 downto 63);
  54.  
  55. output(39 downto 32) <= input(32 downto 39);
  56. output(40 downto 47) <= input(8 downto 15);
  57. output(48 downto 55) <= input(112 downto 119);
  58. output(56 downto 63) <= input(88 downto 95);
  59.  
  60. output(64 downto 71) <= input(64 downto 71);
  61. output(72 downto 79) <= input(40 downto 47);
  62. output(80 downto 87) <= input(16 downto 23);
  63. output(88 downto 95) <= input(120 downto 127);
  64.  
  65. output(96 downto 103) <= input(96 downto 103);
  66. output(104 downto 111) <= input(72 downto 79);
  67. output(112 downto 119) <= input(48 downto 55);
  68. output(120 downto 127) <= input(24 downto 31);
  69. end if;
  70. end if;
  71. end process;
  72. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement