Level 42: X-Ray for Silicon
Task
You are looking at a two-level hierarchy: the CPU module instantiates 8 FullAdder modules. All files are read-only — you cannot modify the code. Your task: explore the circuit through the RTL Viewer.
Double-click a submodule block in the RTL viewer to "drill down" inside and see its internal structure. Use the breadcrumbs to navigate back. Find the incorrectly connected primitive and answer the question.
Hint: look at the gate forming signal w3 inside FullAdder.
Related materials
- Verilog Hierarchy — drill-down in RTL Viewer
- Full Adder — FullAdder schematic
Solution
Method: descend the RTL Viewer hierarchy — from the CPU block to the FullAdder instances, then inside a FullAdder to its primitives. The bug lives at the bottom level, so do not look for it in the top module — drill down to the very end.
In file fulladder.v, gate g4 uses the primitive nand instead of and:
nand g4(w3, w1, c_in); // bug — should be and
The signal w3 = w1 AND c_in is needed for correct carry generation: c_out = w2 OR w3, where w2 = a AND b. Using nand inverts the result, breaking the carry logic.
Answer: nand.