Okay, so I thought I might toddle through the whole set of examples anyway to bed down some things and to not get too ahead of myself and ta da!
Basically went from:
module KEY_NAND_LED ( A,B,F );
assign F =~(A & B);
module KEY_NAND_LED ( A,B,C,D,F );
assign F =~(A & B & C & D);
You know the drill by now. Restart, take a swig of your drink and plod on.
Don’t forget to update the pin assignment:
From your spreadsheet DEV-PIN:
There we are:
Program the chip and
Should be the LED lit and it will extinguish no matter which button or combination of buttons is pressed.
Now looking at the layout we see we are maxed out with our four inputs:
So let’s add a 5th and see what happens. I am just grabbing:
No reason, I want to see the layout change – not so interested in running it on the board.
Okay, so now two logic elements are being used. Remember they cap inputs to four!
The bottom cell now looks like this:
The top cell has four inputs (like the original one).
In the red star is the “Sum Equation” for the gate. It is “B & D”. These are actually the input names for the data inputs to the logic element. Notice in the red hexagon DATAB < F~0 and DATAD<E. The “F” and the “E” relate to the output and one of the inputs of our modified verilog module.
Essentially, as the logic cells are capped at four inputs it has split the design into two logic elements, one with inputs A,B,C,D. One is the output of A&B&C&D=F and the second is E&F~0=F (F~0 is just a clumsy way of having an intermediate result).
If you believe the RTL viewer it is:
In schematic speak its more likely:
Which matches, more or less, the technology map view:
So the coup de grace is the not gate is sitting on the output pin circuit, voila!