
Digital Logic XOR Gate Design
adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

My Embedded Systems and Hardware Design Sandbox
Fundamentals circuits is an open-source printed circuit board by adurantek, from the adurantek/embedded-hardware-sandbox repository on GitHub. It is a 2-layer board with 21 parts on 18 nets, routed with 53 tracks and 0 vias.
Its parts include 6 resistors, 6 connectors and 5 diodes.
I designed this circuit to understand the logic of pull-up resistors and why we use them.
Components list
2x 1x1 Connectors (J2, J3)
2x 330Ω Resistors (R3, R4)
1x LED Diode
1x Push Button (SW2)
Design calculations
Taking the VCC voltage as a 5V reference.
R4 value selected for the safe operation of the LED: $$I_{LED} = \frac{V_{CC} - V_f}{R_4} = \frac{5\text{V} - 2\text{V}}{330,\Omega} \approx 9.09\text{ mA}$$
Power dissipation value on the R3 resistor:
$$P = \frac{V_{CC}^2}{R_3} = \frac{5^2}{330} \approx 75\text{ mW}$$
Schematic explanation
In the circuit, if we consider the J3 connector as the test point where the digital input signal is applied and the J2 connector as the microcontroller pin, the digital value from J3 is directly tied to J2. This ensures a constant digital '1' state, eliminates noise, and prevents the pin from floating. When the SW2 switch is activated, it connects the line directly to ground, pulling the digital value down to '0'. In this way, floating is completely prevented.
Test results
Case 1: BUTTON RELEASED -> Logic value 1, J2 connector senses VCC.
Case 2: BUTTON PRESSED -> Logic value 0, J2 connector is connected to ground.
Images



Resistors R3 and R4 were placed to prevent short circuits and limit current, the push button was utilized to simulate the pull-up mechanism, and the LED was included for visual status control.
Adding a capacitor ($C$) in parallel with the button to prevent mechanical contact bounce (signal sparking) at the hardware level.
Adding an NPN transistor driver to eliminate the voltage drop caused by the LED load. This ensures that the J2 pin stays at a full 5V instead of dropping to ~3.3V when the LED draws current.
| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 1K | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical | R1, R2, R3, R4, R5, R7 |
| 6 | Conn_01x02_Pin | Connector_PinHeader_1.00mm:PinHeader_1x02_P1.00mm_Vertical | J1, J2, J3, J4, J5, J6 |
| 5 | D | Diode_THT:D_DO-34_SOD68_P2.54mm_Vertical_AnodeUp | D1, D6, D7, D8, D9 |
| 2 | 1k | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P2.54mm_Vertical | R_COND1, R_COND2 |
| 1 | 10u | Capacitor_THT:CP_Radial_D4.0mm_P1.50mm | CONDANSATOR1 |
| 1 | 1H | Inductor_THT:L_Axial_L7.0mm_D3.3mm_P2.54mm_Vertical_Fastron_MICC | INDUCTOR1 |

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

adurantek/embedded-hardware-sandbox
My Embedded Systems and Hardware Design Sandbox

gusmanb/logicanalyzer
24 channel, 100Msps logic analyzer hardware and software

mntmn/amiga2000-gfxcard
MNT VA2000, an Open Source Amiga 2/3/4000 Graphics Card (Zorro II/III), written in Verilog


hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

drandyhaas/KiCadRoutingTools
A set of Python/Rust tools to aid routing in KiCad

Arrow-air/project-quiver
Project Quiver documentation, designs, and project artifacts.


21 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
From the adurantek/embedded-hardware-sandbox repository on GitHub, at the commit this page was made from: the board is Hardware_Design/KiCad_Schematics/fundamentals_circuits/fundamentals_circuits.kicad_pcb and its schematic Hardware_Design/KiCad_Schematics/Buck Converter/Buck Converter - Simple/buck-converter_simple/buck-converter_simple.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository states no licence, so its author keeps all rights: ask adurantek before reusing the design.