I needed some advice on the kind of data structure I should use for the following problem. It would be nice if you could also explain the advantages/disadvantages as well.
Brief Version: The question is how to generate a test vector for detecting particular faults in a logic gate circuit.
Long Version: If i have a circuit consisting of logical gates (AND,OR etc), I want to be able to
- specify certain points on the circuit with particular values
- justify the value at the point by moving back along the circuit all the way to the input and assigning the right values at each gate
- Move forward propagating the value that was defined in #1
- Additional Requirement: store values and lists at each input and output along the circuit.
My current idea is to use a directed graph with forward and backward pointers. But I am still deciding. I have made the classes for all the gates (nodes) and wiring (edge). Let me know if you need more clarification on the question.
P.S - its in C++, so boost libraries are an option as well. But which one should I use will be my followup question if you tell me to use boost libraries.