Generating a truth table in Verilog

Thread Starter

tempneff

Joined Aug 11, 2012
17
I have been assigned a simple circuit to produce in Verilog using Quartus software 9.1. I have the circuit completed and but I can't figure out how to print all the required results. I was instructed to 'obtain the truth table and timing diagram' I printed the timing diagram, but where is the truth table...
 

panic mode

Joined Oct 10, 2011
2,751
you can create counter of sufficient size to drive all circuit inputs, then your timing diagram will be just another representation of truth table.
 

thatoneguy

Joined Feb 19, 2009
6,359
How did you write the function in Verilog (did you use the 'table' keyword)?

What is your testbech code, does it cycle through all inputs?
 

Thread Starter

tempneff

Joined Aug 11, 2012
17
This was a simple tutorial where we wrote only this small code and were supposed to just compile and then print. He handed out step by step instructions, but stopped after generating a waveform.

Rich (BB code):
module ece204one(a,b,c,f);
input a,b,c;
output f;
wire y0,y1;
not(y0,c);
and(y1,b,y0);
or(f,y1,a);
endmodule
 

Thread Starter

tempneff

Joined Aug 11, 2012
17
For prosperity's sake, to obtain a truth table, i was supposed to save the waveform as a .tbl. This file can be opened in a text editor.
 

Brownout

Joined Jan 10, 2012
2,390
It sounds to me like you answered your own question. If by saving the waveform as .tbl creates a table that can be opened in a text editor, then you're done. Otherwise, ask the instructor how to do it. I've never done any such thing.
 
Top