Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.58 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.std_logic_1164.all;
  3. use IEEE.numeric_std.all;
  4.  
  5. entity cw0 is
  6. port
  7. (
  8.     a   :   in std_logic_vector(4 downto 0);
  9.     f2  : out std_logic
  10.  
  11. );
  12. end entity;
  13.  
  14. architecture funkcja0 of cw0 is
  15. begin
  16.  
  17.  
  18.     process(a)
  19.     begin
  20.         case(to_integer(unsigned(a(2 downto 0)))) is
  21.         when 0 => f2 <= not a(4);
  22.         when 1 => f2 <= '-';
  23.         when 2 => f2 <= a(4);
  24.         when 3 => f2 <= not a(4);
  25.         when 4 => f2 <= not a(4);
  26.         when 5 => f2 <= a(3);
  27.         when 6 => f2 <= not a(4);
  28.         when 7 => f2 <= a(4);
  29.         when others => f2 <= '-';
  30.         end case;
  31.     end process;
  32.            
  33. end architecture;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement