Advertisement
Guest User

Untitled

a guest
Nov 7th, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VHDL 0.73 KB | None | 0 0
  1. library IEEE;
  2. use IEEE.STD_LOGIC_1164.ALL;
  3. USE ieee.std_logic_arith.all;
  4.  
  5. entity lab101 is
  6.     Port ( clk : in std_logic;
  7.         x1 : in STD_LOGIC_VECTOR (15 downto 0);
  8.         x2 : in STD_LOGIC_VECTOR (7 downto 0);
  9.         dout : out STD_LOGIC_VECTOR (20 downto 0));
  10. end lab101;
  11.  
  12. architecture Behavioral of lab101 is
  13. signal x11 : std_logic_vector (20 downto 0);
  14. signal x22 : std_logic_vector (20 downto 0);
  15. signal sdout : std_logic_vector (20 downto 0);
  16. begin
  17. x11 <= x1(15) & x1(15) & x1(14 downto 8) & x1(15) & x1(15) & x1(15) & x1(15) & x1(7 downto 0);
  18. x22 <= sxt(x2,21);
  19. process(clk) begin
  20.     if rising_edge(clk) then
  21.         sdout <= signed(x11) + signed(x22);
  22.     end if;
  23. end process;
  24. dout <= sdout;
  25. end Behavioral;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement