Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 1.06 KB | None | 0 0
  1.  
  2. library IEEE;
  3. use IEEE.STD_LOGIC_1164.ALL;
  4. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  5.  
  6.  
  7. entity pomreg is
  8.     Port ( iARITH : in  STD_LOGIC;
  9.            iLOAD : in  STD_LOGIC;
  10.            iDATA : in  STD_LOGIC_VECTOR (7 downto 0);
  11.            iSHL : in  STD_LOGIC;
  12.            iSHR : in  STD_LOGIC;
  13.            iCLK : in  STD_LOGIC;
  14.            inRST : in  STD_LOGIC;
  15.            oSHREG : out  STD_LOGIC_VECTOR (7 downto 0));
  16. end pomreg;
  17.  
  18. architecture Behavioral of pomreg is
  19. signal sREG: std_logic_vector(7 downto 0);
  20.  
  21. begin
  22.  
  23. process(iCLK, inRST) begin
  24.     if(inRST = '0') then
  25.         sREG<="00000000";
  26.     elsif(iCLK'event and iCLK = '1') then
  27.         if(iLOAD = '1') then
  28.             sREG<=iDATA;
  29.         elsif(iSHL = '1') then
  30.             if iSHR = '1' then sREG <= sREG;
  31.             else
  32.             sREG<=iDATA(6 downto 0) & '0';
  33.             end if;
  34.         elsif(iSHR = '1') then
  35.             if iSHL = '1' then sREG <=sREG;
  36.             else
  37.             if (iARITH = '1') then
  38.                 sREG<=iDATA(7) & '0' & iDATA(6 downto 1);
  39.             else sREG<='0' & iDATA(7 downto 1);
  40.             end if;
  41.             end if;
  42.     end if;
  43.     end if;
  44. end process;
  45.  
  46. oSHREG<=sREG;
  47.  
  48. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement