If this has to be sequential code (inside a process), then Jim's
solution works fine:
Addr <= (others => '0');
Addr(15 downto C_controlBits) <= SignalB;
If this is supposed to be concurrent statements, then generate will
work, since C_control_bits must be static because signalB is of static
width.
Addr(15 downto C_controlBits) <= SignalB;
if C_controlBits /= 0 generate
Addr(C_ControlBits-1 downto 0) <= (others=>'0');
end generate;
Take your pick.
andy
On Mar 26, 10:36 am, "Rebecca" <pang.dudu.p...@hotmail.com> wrote:
> Sorry I didn't describe it clear, Brian. What I want to implement is
>
> Addr(15 downto C_controlBits) <= SignalB;
> if(C_ControlBits=0) then
> NULL;
> else
> Addr(C_ControlBits-1 downto 0) <= (others=>'0');
> end if;
>
> I can't use the generated stuff here.
>
> Thank you,
> Rebecca
|