AND GATE

The AND GATE implements the logical AND operation. It has two input terminals and one output terminal. The output of the AND gate is high only if both input signals are high; otherwise, the output is low. In other words, the AND gate acts like a switch that requires two inputs to be high in order for the output to be high. The truth table for the AND gate is straightforward:

  • Truth Table

    A B OUTPUT
    0 0 0
    0 1 0
    1 0 0
    1 1 1
    OR GATE

    The OR GATE implements the logical OR operation. Like the AND gate, it has two input terminals and one output terminal. The output of the OR gate is high if either one or both of its input signals are high, and low only if both inputs are low. The symbol for the OR gate is similar to that of the AND gate, with a curved line at the input side. The truth table for the OR gate is straightforward:

  • Truth Table

    A B OUTPUT
    0 0 0
    0 1 1
    1 0 1
    1 1 1
    XOR GATE

    The XOR GATE, also known as the exclusive OR gate, is a logic gate that has two input terminals and one output terminal. The output of the XOR gate is high if the two input signals are different (one is high and the other is low), and low if the two input signals are the same (both high or both low). The symbol for the XOR gate is similar to that of the OR gate, but with a double curved line. The truth table for the XOR gate is as follows: ======= A XOR Gate (also known as EXOR and pronounced as Exclusive OR) is a logic gate that outputs true (1 or HIGH) when the number of true inputs is odd. That means that if both inputs are false (0/LOW) or both are true, a false output results, thus representing the inequality function. A way to remember XOR is: "must have one or the other but not both".

  • Truth Table

    A B OUTPUT
    0 0 0
    0 1 1
    1 0 1
    1 1 0
    Half Adder

    A Half adder is defined as a basic four terminal digital device which adds two binary inputs. It ouputs the sum binary bit and a carry binary bit. A half adder can be constructed using basic logic gates, specifically an XOR gate and an AND gate. The XOR gate is used to produce the sum bit, while the AND gate is used to produce the carry bit. The input bits A and B are connected to the XOR gate, which produces the sum bit S.

    The same input bits A and B are also connected to the AND gate, which produces the carry bit C. The truth table for the half adder can be derived from the truth tables of the XOR and AND gates. Therefore, the half adder is a practical application of these basic logic gates, and it illustrates how complex digital circuits can be constructed using simple building blocks.

  • Truth Table

    A B SUM CARRY
    0 0 0 0
    0 1 1 0
    1 0 1 0
    1 1 0 1
    Full Adder

    A FULL ADDER can be constructed using basic logic gates, specifically two XOR gates, two AND gates, and one OR gate. The first XOR gate takes the two input bits, A and B, and produces a temporary sum bit (not the final sum bit yet).

    The second XOR gate takes the temporary sum bit and the carry input bit, C(in), and produces the final sum bit, S.

    The first AND gate takes the input bits A and B, and produces a carry bit when both input bits are high.

    The second AND gate takes the temporary sum bit and the carry input bit, C(in), and produces another carry bit.

    The OR gate takes the two carry bits from the AND gates and produces the final carry bit, C(out). By combining these gates as described, a full adder circuit can be built to add two binary digits and a carry bit.

  • Truth Table

    A B C_in SUM C_out
    0 0 0 0 0
    0 0 1 1 0
    0 1 0 1 0
    0 1 1 0 1
    1 0 0 1 0
    1 0 1 0 1
    1 1 0 0 1
    1 1 1 1 1
    LGS_logo

    LGS

    logic-gate-simulator

    Implementing AND , OR , XOR Gates in Pure HTML & CSS .

    LGS is an experiment demonstrating the power of CSS selectors. Using LESS, logical operations can be declared and compiled into CSS selectors. LESS is a Learner Style Sheet, which is a dynamic preprocessor language that can be compiled into CSS.

    Logic gates are the basic building blocks of any digital system. They are electronic circuits that have one or more inputs and only one output. The relationship between them is based on certain logic. We are going to study three gates: AND, OR, and XOR.