Advertisement
GilsonMuniz

Modulo/2

Jun 11th, 2020
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.66 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3.  
  4. entity modulo is
  5.     Port ( E : in  STD_LOGIC;
  6.            A : in  STD_LOGIC;
  7.            B : in  STD_LOGIC;
  8.            X0 : in  STD_LOGIC;
  9.            X1 : in  STD_LOGIC;
  10.            X2 : in  STD_LOGIC;
  11.            X3 : in  STD_LOGIC;
  12.            Y : out  STD_LOGIC);
  13. end modulo;
  14.  
  15. architecture Behavioral of modulo is
  16.  
  17. begin
  18.  
  19. process(X0, X1, X2, X3, A, B, E) is
  20.  
  21. begin
  22.     if(E = '0')then
  23.         if(A = '0' and B = '0')then
  24.             Y <= X0;
  25.         elsif(A = '0' and B = '1')then
  26.             Y <= X1;
  27.         elsif(A = '1' and B = '0')then
  28.             Y <= X2;
  29.         else
  30.             Y <= X3;
  31.         end if;
  32.     else
  33.         Y <= not E;
  34.     end if;
  35. end process;
  36. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement