Problem in understanding a keyword !! - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Problem in understanding a keyword !!

I am new to VHDL !
I was trying ALU in VHDL ...
I could design Logic Unit but not Arithemetic unit. So, I checked out on the internet and found this code. But I am not able to understand the architecture part !!! PLEASE HELP !
Thnx !

library IEEE;

entity AU_4bit is
Port( a, b : in std_logic_vector(3 downto 0); -- inputs
s : in std_logic; -- select
g : out std_logic_vector(3 downto 0); -- output
Cout : out std_logic := '0');
end AU_4bit;

architecture Behavioral of AU_4bit is
signal sum, prod: std_logic_vector(3 downto 0); -- product and sum

sum <= conv_std_logic_vector(UNSIGNED(a) + UNSIGNED(b), 4);
prod <= conv_std_logic_vector(UNSIGNED(a(1 downto 0))*UNSIGNED(b(1 downto 0)), 4);
g <= sum
when (s='0')
else prod;
Cout <= '1'
when (((conv_integer(a) + conv_integer(b)) > 15) and s='0')
else '0';

end Behavioral;
Sign In or Register to comment.