crazy-igzp
Member level 1
- Joined
- Feb 3, 2014
- Messages
- 34
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Location
- Settat, Morocco
- Activity points
- 255
Hi I’m a beginner in VHDL! I have a problem in simple prog that add and subtract and multiply 4bits
expression has 4 elements, but must have 8 element !
how can I use the same output ,
Code VHDL - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_signed.all; use ieee.numeric_std.all; entity add_sust is port( E1 : in std_logic_vector(3 downto 0); E2 : in std_logic_vector(3 downto 0); a : in std_logic_vector(1 downto 0); s : out std_logic_vector(7 downto 0)); end add_sust; architecture aaddsust of add_sust is begin process(a,E1,E2) begin if(a="01") then s<=E1+E2; elsif(a="10") then s<=E1-E2; elsif(a="11") then s<=E1*E2; end if; end process; end aaddsust;
expression has 4 elements, but must have 8 element !
how can I use the same output ,
Last edited by a moderator: