Schopenhaur1859 wrote
I posted the wrong HDL code. I have posted the correct one. Can you assist me with this one?
Although you no longer have a recursion issue, all of the others remain.
Remember what the HDL code represents -- you have two Nand gates, each of which have two inputs ('a' and 'b') and one output ('out'). Your HDL defines how those gates are hooked up, both to each other and to the input and output ports of the new part you are constructing.
Think of an eco-friendly bathroom module in box containing a sink, a toilet, and a tank. This module has two connections -- 'in' and 'out'. We will connect a fresh water supply to the 'in' and the sewer line to the 'out'. Inside we have the three parts. The sink and toilet have 'in' and 'drain' ports while the tank has two input ports named 'white' and 'grey' and a single output port named 'out'.
The idea is that fresh water comes into the module and goes to the sink. After it leaves the sink it is considered 'grey water' and goes to the tank. The toilet is fed from the tank's output port. Because there may not be enough grey water in the tank to operate the toilet, the tank also has an input port for fresh water that it can use if necessary.
Our HDL for this might look like
CHIP Bathroom {
IN in;
OUT out;
PARTS:
Toilet(in = greyWater2, drain = out);
Tank(grey = greyWater1, white = in, out = greyWater2);
Sink(in = in; drain = greyWater1);
}
Try to draw a picture of this set up.
I also again refer you to Figure 1.6.