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.

No Output from VHDL code !?

Status
Not open for further replies.

GeekWizard

Full Member level 1
Joined
Oct 24, 2004
Messages
98
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,288
Location
United Kingdom
Activity points
853
Hello all,

Being a newbie in VHDL, I am sure theres a stupid mistake somewhere. I just can not get my head around it.

There is no output for 'F1' and 'deltaF' below. I am using Altera Quartus as the compiling tool and it gives no error during compilation and simulation.

Can someone please help.

Many Thanks.

Code:
ibrary IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;

entity computation2 is
	port (
		Clock: in STD_LOGIC;

		reset: in STD_LOGIC;
		Digit: in STD_LOGIC_VECTOR (23 downto 0);
		DigitValid: in STD_LOGIC;

		F1: out STD_LOGIC_VECTOR (27 downto 0);
		
		deltaF: out STD_LOGIC_VECTOR(27 downto 0) 
		
		);
end computation2;

architecture computation2 of computation2 is
signal I_WordNumber:INTEGER;
signal I_FC:INTEGER;
signal I_BW:INTEGER;
signal I_BW1:INTEGER;
signal I_WRF:INTEGER;
signal I_F1:INTEGER;
signal I_DF:INTEGER;

begin 

process (Clock,DigitValid,reset)
begin

if (reset='1') then 
	I_WordNumber <=1;
	I_BW  <=1;
	I_WRF <= 1;
	I_FC<=1;
	I_DF<=0; 

elsif (DigitValid'Event and DigitValid='0') then
		 if(I_WordNumber=1) then
      		  	I_BW <= CONV_INTEGER(Digit);
			  	I_WordNumber<=2;

		  	elsif(I_WordNumber=2) then
			  	I_BW <= I_BW*1000; 
			  	I_FC <= CONV_INTEGER(Digit);
			  	I_WordNumber<=3;

		  	elsif (I_WordNumber=3) then
			 	I_FC <= I_FC*1000;			  
			 	I_WRF<=CONV_INTEGER(Digit);
		     	I_WordNumber<=4;
    
		  	elsif (I_WordNumber=4) then
		  		I_WordNumber<=1;
		  		I_F1 <= I_FC - (I_BW/2);
		    	I_DF <= (I_BW * I_WRF * 114) / 300000000000;   
		  
		    				
		  end if;
		F1 <= CONV_STD_LOGIC_VECTOR (I_F1, 28);  
		deltaF <= CONV_STD_LOGIC_VECTOR (I_DF, 28);


end if; 

end process;

end computation2;
 

When you say no output do you mean that your initial values never change or that you are getting unknown values?

If it compiled then great. It sounds like you are referring to your simulation. If you are not getting any outputs you need to check your inputs.

E
 

Hello,

I must confess that I didn't completely understand the calculations done in the design, but that may be unnecessecary. I also don't know, which signal values have been used to test it's operation either in simulation or hardware.

I see however one points, that causes part of the design to fail intended behaviour. This is due to INTEGER type having a limited numeric range of 32 bit, so integer_value / 300000000000 is unconditionally zero. Should have cause a warning from Quartus during comilation! Using unsigned type for >=2**32 values should help. Apart from that I see no particular problem, provided the arithmetic is intended as coded.

Regards,
Frank
 

    GeekWizard

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top