Continue to Site

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.

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
how to write aggregate in vhdl

b=a{1'b1};
a is a constant defined with 'define
b is std_logic_vector
for example
a=4
then
b=1111
 

I think this would work if a is a constant predefined in a package or something

signal b : std_logic_vector (a-1 downto 0);

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


hope it would help;-)
 

As mentioned above, you should use the constant a in the definition of b:

signal b : std_logic_vector (a-1 downto 0);

Then there is no need anymore to use a, you can just write:

b <= (others=>'1');

Look for "aggregate" in any good VHDL tutorial.
 

or simply

signal b : std_logic_vector(a-1 downto 0) := (others =>'1');
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top