← ProblemsCircuits / Combinational Logic / Basic Gates
Combine circuits A and B
36%basicsboolean-algebraNow assemble the top-level circuit from the two subcircuits of the previous problems:
- Circuit A computes
z = (x XOR y) AND x. - Circuit B computes
z = x XNOR y.
The top-level design contains two copies of A and two copies of B. The top-level inputs x and y feed all four subcircuits. The outputs combine as:
z = (A1 OR B1) XOR (A2 AND B2)
where A1/A2 are the outputs of the two A copies and B1/B2 the outputs of the two B copies.
You may instantiate submodules or simply compute the intermediate signals with assign statements — both A copies (and both B copies) see the same inputs, so their outputs are identical.