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.

problem with the output

Status
Not open for further replies.

QMA

Member level 4
Joined
Apr 5, 2007
Messages
72
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,832
Dear all
I have calculated the value of out in verilog using xilinx vertex 6. it has to generate a message 'Data Validated' if out == 1 else 'Data Not Validated'. whenever i run the testbench, it gives me three times 'Data Not Validated' and one time 'Data Validated' provided out ==1. For out==0 it gives me 'Data Not Validated' four times. How can I control the output and get only one time 'Data Validated' for out ==1 else 'Data Not Validated'. i have designed following code
Code:
if(out==1)
			begin
			$display("Data Validated");
		   if(R_addr==0)
			table_index = pop_count - 1'b1;
			else
			table_index = count + pop_count;
		   if(R_addr==0)
			table_index = pop_count - 1'b1;
			else
			table_index = count + pop_count;
			end
			else
					if(out==0); 
			begin
			$display("Data nnnot Validated");
			end
 

The code above will display "Data Validated" once every time the if (out==1) is evaluated. It will also display "Data nnnot Validated" every time this block of code is evaluated as you have a semicolon at the end of if(out==0);. Perhaps that is a typo? If the semicolon was unintentional then the second $display will occur once each time the if(out==1)...else if(out==0) if statement gets evaluated.

Your problem with repeated $display calls is NOT in this part of the code. Why does everyone think they know what part of their code is broken and NEVER show the entire code in context?

You should use CUT & PASTE of your original file to add code to your thread, not typing it in by hand, so you don't end up with code that is functionally incorrect.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top