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.

Signal declaration doubt

Status
Not open for further replies.

priya23

Newbie level 2
Joined
Dec 7, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,297
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity vari is
port(a,b,c:in integer;
d,e:eek:ut integer);
end vari;
architecture df of vari is
signal j:integer:=0;
begin

j<=j+2;
e<=j;

process(a)
variable k:integer:=0;
begin
k:=k+1;
d<=k;
end process;
end architecture;




hre i check e value....
so in my first run of simulation e=9996,j=9998.hw the j is 9998.i declare initially j as zero.then hw j is showing 9998.actually j must be 1 at the time of simulation.anyone knw abt this pls rply
 

Hi,

Remember the initialization value for "j := 0" is set only once at the beginning when FPGA is reset.
"k" will start at 0 every time that process is executed. If you need j to start at 0 then you will need
to make a reset process for it.

scanman
 

A signal assignment without timing control will repeat each simulator timestep, e.g. 1 ps or 1 ns. The VHDL "program" won't be synthesizable in hardware at all.

If you intended more than a curious result, you should start with VHDL examples from a text book or tutorial.
 
j <= j+2; outside of a process doesn't make much sense. it is a combinatorial loop -- the value of j cannot be determine. after all, if j = 0 then j=2. but if j=2 then j=4. but if j=4 then j=6. without a concept of time/memory, j will just be continually updated.

done inside of a clocked process it would be valid. wait 1 clock, j becomes 2. on the next clock, 4. on the next clock, 6.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top