1. ## Dynamic Truth Table

Hi everyone. I gotta save the truth table in my .txt file(as a dynamic form), also my inputs and outputs are here. If i read the .txt file from my program, i can understand what my circuit or gate is. How can i do this ?

Example:

.input1 1
.input2 1

table
0 0 0
0 1 0
1 0 0
1 1 1
table_end

.output 1

(content of txt)

Thanks

2. What do you have so far?

3. Read the Tutorials would be a way to start C Tutorial - Learn C - Cprogramming.com

Tim S.

4. A simple "if/else if" statement would do the trick
Think about it -> If "input a" is zero and "input b" is zero, then output is zero...

5. Originally Posted by Lycan
How can i do this ?
You're given the two inputs, a table of all possible input combinations, and the resulting output for each combination.
All you have to do is look up the row that contains the inputs you were given, and take the result from that row.

Does that make it easy now?

6. Originally Posted by iMalc
You're given the two inputs, a table of all possible input combinations, and the resulting output for each combination.
All you have to do is look up the row that contains the inputs you were given, and take the result from that row.

Does that make it easy now?
Yes it easy for that circuit but if the circuit has more gates and more inputs that will be hard. At this statement, how my program will create the truth table for a new circuit ? (btw user choose gates and inputs from the menu)

7. Yes it easy for that circuit but if the circuit has more gates and more inputs that will be hard. At this statement, how my program will create the truth table for a new circuit ? (btw user choose gates and inputs from the menu)
That's not what you said earlier is it?

So what's the REAL problem and what have you tried?