Continue to Site

problem in executing

Status
Not open for further replies.

Arindam123

Newbie level 1
Newbie level 1
Joined
Jul 18, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
4
hey there,
i am trying to simulate the mod operation in modelsim and i am not getting a proper output.

my code is

entity divi is
port( a,b : in std_logic_vector(15 downto 0);
y : out std_logic_vector(15 downto 0)
);
end divi;

architecture ber of divi is

signal a1,b1,c1 : integer;
signal temp: std_logic_vector(15 downto 0);
begin
process(a,b)
begin

a1<= conv_integer(a);
b1<= conv_integer(b);
c1<= a1 mod b1;

temp <= conv_std_logic_vector(c1,16);

y<= temp;
end process;
end ber;

the values of a ab b are "0000000000001100" and"0000000000000111"

i am getting a1,b1,c1 all zeroes.

can anyone help me out where the problem is???
 

problem is that the process sensitivity is only on a and b. when a,b changes one time, only C1 changes but temp is loaded by last value of temp that is zero. and also y gives temp last value that is zero.

I suggest you one of these:
1) use a clock or
2) add other signals to process sensitivity list.
like :
Code:
process(a,b,a1,b1,c1,temp,y)
3) Do not use process. like this

Code:
begin

a1<= conv_integer(a);
b1<= conv_integer(b);
c1<= a1 mod b1;
temp <= conv_std_logic_vector(c1,16);
y<= temp;
 

initialize the integer values and use delays in process
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top