Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. ----------------------------------------------------------------------------------
  2. -- Company:
  3. -- Engineer:
  4. --
  5. -- Create Date: 19:42:04 02/27/2017
  6. -- Design Name:
  7. -- Module Name: resultArray - Structural
  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. library IEEE;
  21. use IEEE.STD_LOGIC_1164.ALL;
  22. use IEEE.STD_LOGIC_ARITH.ALL;
  23. use IEEE.STD_LOGIC_UNSIGNED.ALL;
  24.  
  25. ---- Uncomment the following library declaration if instantiating
  26. ---- any Xilinx primitives in this code.
  27. --library UNISIM;
  28. --use UNISIM.VComponents.all;
  29.  
  30. entity resultArray is
  31. Port ( clk : in STD_LOGIC;
  32. inputres : in STD_LOGIC_VECTOR (15 downto 0);
  33. inputaddres: in STD_LOGIC_VECTOR (2 downto 0);
  34. selectedres :out STD_LOGIC_VECTOR (15 downto 0));
  35. end resultArray;
  36.  
  37. architecture Structural of resultArray is
  38. type resArray is array ( 7 downto 0) of STD_LOGIC_VECTOR(15 downto 0);
  39. signal input : resArray;
  40. signal output : STD_LOGIC_VECTOR (15 downto 0) :="0000000000000000" ;
  41. begin
  42.  
  43. process (clk)
  44. variable x : integer range 0 to 7 :=0;
  45. variable z: integer range 0 to 7 :=0;
  46.  
  47. begin
  48. if (clk'event and clk = '1' and x >0) then
  49. z:= x-1;
  50. input(z) <= inputres;
  51. end if;
  52. if (x<9) then
  53. x := x+1;
  54. end if;
  55. end process;
  56.  
  57. --process(inputaddres)
  58. --variable y : integer range 0 to 7 :=0;
  59. --begin
  60. --y:= 0;
  61. --if ( inputaddres(0)='1') then
  62. --y:= 1;
  63. --end if;
  64. --end process;
  65. end Structural;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement