Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.77 KB | None | 0 0
  1. library ieee;
  2. use ieee.std_logic_1164.all;
  3.  
  4. entity TTL74198 is
  5.     port(
  6.         CLK, CLEAR, Din_r, Din_l    : in std_logic;
  7.         Din_p   : in std_logic_vector(7 downto 0);
  8.         S : in std_logic_vector(1 downto 0);
  9.         Q : out std_logic_vector(7 downto 0)
  10.     );
  11. end TTL74198;
  12.  
  13. architecture TTL74198 of TTL74198 is
  14.     signal reg1: std_logic_vector(7 downto 0);
  15.     begin
  16.         process(CLK, CLEAR)
  17.            
  18.             begin
  19.                 if CLEAR = '0' then
  20.                     reg1 <= (others => '0');
  21.                 elsif CLK'event and CLK = '1' then
  22.                     case S is
  23.                         when "01" =>
  24.                             reg1 <= Din_r & reg1(7 downto 1);
  25.                         when "10" =>
  26.                             reg1 <= reg1(6 downto 0) & Din_l;
  27.                         when "11" =>
  28.                             reg1 <= Din_p;
  29.                         when others =>
  30.                             null;
  31.                     end case;
  32.                 end if;
  33.         end process;
  34.            
  35.         Q <= reg1;
  36. end TTL74198;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement