In this project, a gate-driven circuit is provided for comparing two 2-bit numbers. The inputs are represented as A1 and A0, where A1 is the most significant bit and A0 is the least significant bit of number A, and similarly, B1 and B0 represent the most and least significant bits of number B.
The outputs are defined as follows:
Out0indicates the result of the comparisonA > BOut1indicates the result of the comparisonA = BOut2indicates the result of the comparisonA < B
Additionally, intermediate nodes labeled X0, X1, Y0, Y1, Z0, and Z1 are marked in the schematic.
This report covers:
- The design and construction of the circuit using transistors
- The development of the stick diagram
- The final layout of the circuit in Ledit software
- The netlist analysis of the generated output using simulated waveforms in Tspice software
For this task, the circuit is divided into three different sections, each responsible for generating one of the outputs: Out0, Out1, and Out2.
At this stage, the designed circuit diagrams are as follows. In the next section, they are integrated into a single cell where their corresponding ports are interconnected.
The circuit layout is designed based on extracted stick diagrams, adhering to technology rules. The input ports enter the inverter circuits from the leftmost section and then propagate to different parts of the circuit.
To interconnect the designed gates with transistors, Metal 2 is primarily used. Additionally, in certain areas where reducing the number of Vias and minimizing cell width was possible, alternative connections such as Metal 1 and Poly were utilized.
The summarized Design Rule Check (DRC) results are as follows:

After extracting the circuit, a Netlist file was generated, which includes the necessary code for waveform generation for both input ports and output ports targeted for display.
The final simulation-ready code for execution in Tspice can be found in the Tspice netlist.spc.
To verify the accuracy of the circuit, based on the previously written code:
- The fixed input value of 2 was assigned to
B(binary10). - The value of
Awas changed sequentially in different pulses.
The resulting waveforms are as follows:
- When
Ahad values less than 2 (01and00in binary), the outputOut0reached 5V (logical high), while the remaining outputs stayed at 0V (logical low). - When
Awas equal to 2 (binary10),Out1was logical high, while the others remained logical low. - When
Awas greater than 2 (11in binary),Out2became logical high, with the remaining outputs at logical low.
This confirms the correctness of the circuit operation based on the expected comparison logic.
An anomaly is observed in the outputs, where a short delay occurs at certain moments during logic transitions. One of the reasons for this delay is the circuit’s dependency on the X1 value, which is derived from the output of an XNOR gate. The charging and discharging delays of the circuit contribute to this timing issue.
For example, the behavior of X1 output alongside other outputs is illustrated in the image below:





