I have a question on synthesis in VHDL that I'm hoping some of you can help me with. I have the following model for a adder :
LIBRARY IEEE;
USE IEEE.std_logic_1164.ALL;
USE IEEE.numeric_std.ALL;
ENTITY Q3a IS
PORT (A_MSB,B_MSB,A_LSB,B_LSB : IN std_logic_vector(3 DOWNTO 0):="0000";
SEL : IN std_logic:='0';
CARRY : OUT std_logic:='0';
OUTPUT : OUT std_logic_vector(7 DOWNTO 0):="00000000");
END ENTITY Q3a;
ARCHITECTURE behavioral OF Q3a IS
SIGNAL A,B,SUM,B_NEG : std_logic_vector(8 DOWNTO 0);
BEGIN
A <= (A_MSB(3) & '0' & A_MSB(2 DOWNTO 0) & A_LSB) WHEN A_MSB(3) = '0' ELSE
(A_MSB(3) & '1' & A_MSB(2 DOWNTO 0) & A_LSB);
B <= (B_MSB(3) & '0' & B_MSB(2 DOWNTO 0) & B_LSB) WHEN B_MSB(3) = '0' ELSE
(B_MSB(3) & '1' & B_MSB(2 DOWNTO 0) & B_LSB);
B_NEG <= std_logic_vector(signed(not(B_MSB(3) & '0' & B_MSB(2 DOWNTO 0) & B_LSB))+1);
SUM <= std_logic_vector(signed(A)+ signed(B)) WHEN SEL = '0' ELSE
std_logic_vector(signed(A)+ signed(B_NEG));
CARRY <= SUM(7);
OUTPUT <= SUM(8) & SUM(6 DOWNTO 0);
END ARCHITECTURE behavioral;
The model works OK'ish a few glitches. When I look at it though I see 3 multiplexers, one for A, one for B, and one for input selection to the adder. When I open the model with RTL viewer on Quartus II. I get this:
Which to me looks like 4 adders and a multiplexer. Can anyone share some light with me on this? Cheers D
A
differ fromA <= A_MSB(3) & A_MSB & A_LSB;
? – user_1818839