Basic Logic Gates

No, I do not know how we can implement the logic gates from switches, and what are logic gates?

Logic is a method of reasoning. The logic that is used to do computation in computers or other digital devices uses Boolean algebra, which is based on Huntington's axioms. I assume you are aware of the basic Boolean algebra, and we will not engage in the mathematical origins any further.

Logic gates implement particular logic functions such as AND, NAND, OR, NOR, X-OR, X-NOR, and NOT. The following summarizes the basic logic functions.

A B OR NOR AND NAND X-OR X-NOR
0 0 0 1 0 1 0 1
0 1 1 0 0 1 1 0
1 0 1 0 0 1 1 0
1 1 1 0 1 0 0 1

The symbols are as follows:



What about the implementation of these logic functions?

Consider the above BJT transistor. It is basically an inverter. When 5 V is applied at the input, you can think of the diode shown in the transistor shown as conducting, and thus Vo=Vc=0=being connected to ground.

You are assuming I know all about the transistor, I don't! What is transistor? How does it work?

For the purpose of this discussion, transistor act as switches. The other main function a transistor performs is amplification. Please refer to your physics, or electronic notes for detail information.

You are assuming I know all about the transistor, I don't! What is transistor? How does it work?

For the purpose of this discussion, transistor act as switches. The other main function a transistor performs is amplification. Please refer to your physics, or electronic notes for detail information.

How about the implementation of logic gates using transistors or switches?

Consider the above BJT circuit, then the NAND logic gate will result. That is

A B X
0 V 0 V 5 V
5 V 0 V 5 V
0 V 5 V 5 V
5 V 5 V 0 V




If 0 volts is applied at B and A, both diodes cannot conduct, no current can go through E2 or C2E1, and thus voltage at X=5 volts.

When 5 volts is applied at A the diode1 can conduct, but 0 Volts at B means diode2 can not conduct, which means X=5 volts.

(Note that 5 volts at A does not imply 5 volts at Y; transistor is a three terminal device)

When 0 volts at A and 5 volts at B are applied, diode1 cannot conduct. Thus there is no current conducting, and X=5 volts.

When 5 volts is applied at A and B, both diodes can conduct. The current follows, which effectively makes the node C1 and ground the same. Thus X=0 volts.

A NOR gate can be similarly implemented. Although, practical implementation differs and require us to consider issues such as noise margins, fan out, power consumption, and delays, the basic technology is as presented.

MOSFET transistors can be also used to implement logic gates.

How about other logic gates?

You can build all logic gates from the following complete logic gate sets:
  • {AND, NOT}
  • {NAND}
  • {NOR}



    We will summarize the basic Boolean algebra expressions as:

    Are you suggesting that the computer is made up of these basic logic gates? All the complicated computations! How about memory?

    Theoretically, yes. You can build a computer using these basic logic gates. Even memory is constructed from a complete logic gate set. Practically, these gates are used to construct higher level devices. The important higher order devices can be classified as follows: