Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

need help in vhdl coding in the following code

Status
Not open for further replies.

Swapnika.J

Newbie level 2
Joined
Sep 21, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,452
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity final is
port (dataout :in std_logic_vector(31 downto 0);
addrout : in std_logic_vector (5 downto 0);
out1 : out std_logic_vector(31 downto 0);
matchhit :in std_logic );
end final;

architecture Behavioral of final is
begin

process(dataout,addrout,matchhit)
begin
case matchhit is
when '0' => out1 <= dataout(31 downto 0);
when others => out1 <= addrout(5 downto 0);

end case;
end process;

Error:length of expected is 32;length of actual is 6

end Behavioral;
 

alexan_e

Administrator
Joined
Mar 16, 2008
Messages
11,895
Helped
2,021
Reputation
4,158
Reaction score
2,032
Trophy points
1,393
Location
Greece
Activity points
64,375
in this line when others => out1 <= addrout(5 downto 0); you assign a 6bit vector to a 32bit vector

you can assign this 6bit result to specific bits, for example when others => out1(5 downto 0) <= addrout(5 downto 0);
you can also assign 0s in the rest of the bits when others => out1(31 downto 6) <=(others => '0');

Alex
 

engrMunna

Advanced Member level 4
Joined
Oct 25, 2010
Messages
106
Helped
6
Reputation
12
Reaction score
5
Trophy points
1,298
Activity points
2,071
you are assigning addrout (a 6 bit vector) to out1 (a 32 bit vector)... u can do like this
when others => out1(5 downto 0) <= addrout(5 downto 0); out1(31 downto 6) <= (others => '0');
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top