library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity P1 is
Port ( X1 : in STD_LOGIC_VECTOR (7 downto 0);
X2 : in STD_LOGIC_VECTOR (7 downto 0);
X3 : in STD_LOGIC_VECTOR (7 downto 0);
O : out STD_LOGIC_VECTOR (7 downto 0);
clk : in STD_LOGIC);
end P1;
architecture Behavioral of P1 is
signal r1,r2,r3 : std_logic_vector(15 downto 0);
signal r4,r5,r6 : std_logic_vector(7 downto 0);
signal a1 : std_logic_vector(7 downto 0):="00100000";
signal b1 : std_logic_vector(7 downto 0):="00001010";
signal c1 : std_logic_vector(7 downto 0):="00010110";
signal m : std_logic_vector(7 downto 0):="10000000";
begin
process (clk)
begin
if rising_edge (clk) then
-- s1
r1 <= a1*X1;
r2 <= b1*X2;
r3 <= c1*X3;
-- s1
r4 <= r1(7 downto 0)+r2(7 downto 0);
r5 <= r3(7 downto 0)+m;
-- s1
r6 <= r5+r4;
end if;
end process;
O <= r6;
end Behavioral;