Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. entity Decoder is
  2. Port ( opCode : in STD_LOGIC_VECTOR (2 downto 0)
  3. selectedOp : out STD_LOGIC_VECTOR (7 downto 0));
  4. end Decoder;
  5.  
  6. architecture Behavioral of Decoder is
  7. -- signals
  8. signal temp : STD_LOGIC_VECTOR (7 downto 0) := "00000000";
  9. begin
  10. process(opCode)
  11. begin
  12. case opCode is
  13. when "000" => temp <= "00000001";
  14. when "001" => temp <= "00000010";
  15. when "010" => temp <= "00000100";
  16. when "011" => temp <= "00001000";
  17. when "100" => temp <= "00010000";
  18. when "101" => temp <= "00100000";
  19. when "110" => temp <= "01000000";
  20. when "111" => temp <= "10000000";
  21. end case;
  22. selectedOp <= temp;
  23. end process;
  24. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement