Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.71 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. USE ieee.std_logic_arith.all;
  4. entity koder is
  5. port(
  6.       clk : in STD_LOGIC;
  7.       din : in std_logic);
  8. end koder;
  9.  
  10. architecture Behavioral of koder is
  11. signal dout: std_logic;
  12. type rom is array (0 to 2) of std_logic;
  13. signal soderzhimoe : rom := (others=> '0');
  14. ----------------------------------------------------------------------------
  15. begin  
  16.  
  17.  
  18. process(clk) begin
  19.     if rising_edge(clk) then
  20.         soderzhimoe(1) <= soderzhimoe(0);
  21.         soderzhimoe(0) <= din xor (soderzhimoe(1) xor soderzhimoe(2));
  22.         soderzhimoe(2) <= soderzhimoe(1);
  23.         dout <= soderzhimoe(0) xor soderzhimoe(2);  
  24.     end if;
  25. end process;
  26.      
  27. end behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement