Now, consider the problem of const gates in the context of the posted solution t
ID: 3596108 • Letter: N
Question
Now, consider the problem of const gates in the context of the posted solution to HW3. When the power comes on, which is to say, when the simulation starts, all the wires and all of the outputs of all of the gates are at logical false. After delay, the true output of each const gate goes from false to true.
Assume that class ConstGate has a method outputChangeEvent(t) that is used only for the change described above, where the parameter t indicates the time at which the change occurs.
a) Where in the code for class ConstGate should the code go that schedules outputChangeEvent?
Explanation / Answer
The power comes on, which is to say, when the simulation starts, all the wires and all of the outputs of all of the gates are at logical false. After delay, the true output of each const gate goes from false to true, so assuming that the class ConstGate has a method outputChangeEvent(t) that is used for this mentioned change, here once after the registerInput and registerOutput calls this outputChangeEvent schedule will call based on the register input and output.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.