Posts

Building a Full Adder, Combining Logic to Add Three Bits

Image
Building a Full Adder, Combining Logic to Add Three Bits When you add two binary digits, a half adder is enough. But what if there’s already a carry bit from a previous addition? That’s where the full adder comes in. It’s the next logical step in building real digital circuits, from binary adders to full ALUs in CPUs. What a Full Adder Does A full adder adds three input bits : A B Carry In (Cin) and gives two outputs: Sum (S) – the result of the bit addition Carry Out (Cout) – the overflow bit for the next stage Logic Design You can think of a full adder as two half adders plus an OR gate . First half adder adds A and B which produces an intermediate Sum₁ and Carry₁ Second half adder adds Sum₁ and Cin which produces final Sum and Carry₂ OR gate combines Carry₁ and Carry₂ which gives Carry Out Equations:      Sum = A ⊕ B ⊕ Cin      Carry_out = (A · B) + (Cin · (A ⊕ B)) Components You’ll Need 1 × 74LS86 ( XO...

Math Behind Logic Gates

Image
Understanding the Real Electronics Behind Logic Gates (The Practical Math Behind Digital Circuits) When we build circuits with logic chips like the 74LS series, it’s easy to think only in 1s and 0s. But under the hood, every logic gate follows the same rules as any other circuit, Ohm’s Law, current limits, and voltage thresholds. So yes, there is real-world math behind those blinking LEDs and logic tables.  1. Logic Levels — The Digital View At the logic level, everything is simple: 0 V → LOW (logic 0) 5 V → HIGH (logic 1) We don’t care about exact voltages here just whether a signal crosses a defined threshold. For TTL (Transistor-Transistor Logic) chips like the 74LS86 XOR gate , these thresholds are: This means a logic gate “decides” based on whether the voltage is above or below that boundary, which is how binary logic becomes real voltage levels. 2. Inside the Circuit — Real Electrical Math Even though logic circuits process bits, they still obey Ohm’s Law ...

Building a Half Adder

Image
  Building a Half Adder – Combining Logic Gates A Half Adder is one of the simplest examples of how digital logic gates can be combined to perform arithmetic. It takes two binary inputs and outputs their sum and carry,  just like how you’d add two 1-bit numbers on paper. If you’ve already built your AND , OR , and XOR gate projects, this is where things start getting interesting, we’ll combine them into a working digital circuit. What You’ll Learn How a half adder performs binary addition How to combine an XOR and an AND gate How to test and visualize binary outputs with LEDs Understanding the Logic When you add two binary digits (A and B), the possible outcomes are: Here’s what’s happening: Sum is A XOR B → only true when one input is HIGH. Carry is A AND B → only true when both inputs are HIGH. That’s it a Half Adder is literally just an XOR gate and an AND gate working together. Parts You’ll Need 1 × 74LS86 (XOR gate) 1 × 74LS08 ...

XOR Gates with the 74LS86

Image
Building XOR Gates with the 74LS86 The XOR (exclusive OR) gate is one of the most interesting logic gates, it outputs HIGH only when its inputs are different . In this post, we’ll build and test it using the 74LS86 TTL chip. What You’ll Need 1 × 74LS86 IC (Quad 2-input XOR gates) Breadboard + jumper wires 2 × push buttons (for inputs) 2 × 10 kΩ resistors (pull-downs) 1 × LED (any colour) 1 × 330 Ω resistor (for the LED) 5 V power supply (or Arduino 5 V pin) How the XOR Gate Works An XOR gate compares two logic inputs (A and B). It outputs HIGH when only one input is HIGH, not both. Think of it like “either/or but not both.” Pinout (74LS86) The 74LS86 contains four independent XOR gates. Typical pin connections: Each set of three pins (A, B, F) is one AND gate. Circuit Diagram Wiring the circuit Connect pin 14 to +5 V and pin 7 to GND . Use pins 1 and 2 as your input A and B by connecting +5V to one side of the push button and the other side...

NAND Gate (74LS00)

Image
Building a NAND Gate (74LS00) If you’ve been following along with the other gate projects (like the NOT, AND, or OR gates), the NAND gate is your next essential stop. It’s one of the most important logic gates, in fact, every other gate can be built using NANDs alone! In this post, we’ll wire up a 74LS00 TTL IC , test it using an LED, and see how it behaves in action. What You’ll Need 1 × 74LS00 IC (Quad 2-input NAND gates) Breadboard + jumper wires 2 × push buttons (or jumper wires for manual input) 2 × 10 kΩ resistors (pull-down resistors) 1 × 330 Ω resistor (for LED current limiting) 1 × LED (any colour) 5 V power supply (or Arduino 5 V pin) How the NAND Gate Works A NAND gate is the opposite of an AND gate: It gives a LOW output only when both inputs are HIGH . Truth table: So, the NAND is just “NOT (AND)”. Inside the 74LS00 , there are four separate NAND gates you can use, great for experimenting or combining into bigger logic circuits. Pinout (74...