-- VHDL code position: p311_ex10_1_share_resource.txt -- Note : The code is about design optimize OF VHDL, -- for exproment 9-2 , page 298 -- -- See Also: example 10-2 -- Debug : no debug --------------------------------------------------------------------------------- LIBARY IEEE; USE IEEE.STD_LOGIC_1164.ALL; USE IEEE.STD_LOGIC_UNSIGNED.ALL; USE IEEE.STD_LOGIC_ARITH.ALL; ENTITY multmux IS PORT ( A0, B0, B : IN STD_LOGIC_VECTOR ( 3 DOWNTO 0 ); sel : IN STD_LOGIC; result : OUT STD_LOGIC_VECTOR ( 7 DOWNTO 0 ) ); END ENTITY multmux; ARCHITECTURE bhv OF multmux IS BEGIN PROCESS ( A0, A1, B, sel ) BEGIN IF sel = '0' THEN result <= A0 * B ; ELSE result <= A1 * B ; END IF; END PROCESS; END ARCHITECTURE bhv;