how to write the below verilog code in vhdl

Status
Not open for further replies.

tarkyss

Full Member level 6
Joined
Aug 1, 2005
Messages
340
Helped
26
Reputation
52
Reaction score
8
Trophy points
1,298
Location
China
Activity points
4,162
b=a{1'b1};
a is not a constant
 

b <= a(1);

IMHO )

P.S. If b is STD_LOGIC and a - STD_LOGIC_VECTOR !!!
 

b is std_logic_vector
for example
a=4
then
b=1111
 

I don't know much VHDL, but in Verilog I think b=a{1'b1}; is a syntax error.
Maybe you mean b={a{1'b1}}; but that's an error too if the repetition multiplier a is not a constant.
 

sorry, a is constan defined with 'define
 

for I in 0 to a-1 loop
b(I) <= '1';
end loop;

P.S. a is CONSTANT !!!
 

    tarkyss

    Points: 2
    Helpful Answer Positive Rating
Or do something like this:
b <= NOT (ShiftLeft("1111111111111111", a)) ;
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…