Introduction: Digital Logic Gates (Part 1)

In this instructable, we will get into IC chips and simple digital logic gates.

This is my first instructable; any feedback is greatly appreciated and please feel free to send me a message with any question you might have. Enjoy!

Press the following link for the second part: Digital Logic Gates (Part 2)

Step 1: Theory

The picture above depict IC's; an IC, Integrated Circuit, chip is a small electronic circuit that comprises of resistors, capacitors, diodes and transistors. IC's are made of silicon, a semiconducting material, and this is helps in compacting all the components together on a single chip utilizing tiny n-type and p-type silicon structures that get embedded to the chip in the manufacturing process. Also, it is important to note that the surface of a chip is plated with aluminum, which creates a connection between the components mentioned above. In this intractable, the three main digital logic gates ( NOT, AND, OR) will be explained thoroughly and demonstrated on a breadboard.

Parts needed:

Breadboard

9V battery

Battery connector

5V regulator

3 IC Chips: 74LS04, 74LS08, 74LS32

One LED

One 330 Ohm resistor

Wires as needed

Step 2: NOT Gate (Inverter)

An inverter (NOT Gate) implements logical negation. As shown in the truth table in Figure 2, if the input is Low (0) then the output will be High (1) and vice versa. In other words, the inverter's output is the compliment of the input. Thus, Q = A̅ (the bar means compliment). The 74LS04 is an IC chip that comprises of 14 pins; six inverters, supply voltage (Vcc) and ground (GND). Furthermore, we are going to test the inverter by constructing a simple circuit and observing the output using an LED detector circuit; if the LED is on then the output = 1 and if the LED is off then the output = 0. For the 74LS04 chip used, the supply voltage (Vcc) should be between 4.75V and 5.25V in order for the chip to function properly. In Figure 4, the input (A) = 0 and the output (Q) = 1. In Figure 5, the input (A) = 1 and the Output (Q) = 0.

Step 3: AND Gate

The AND gate implements logical conjunction; the output is High (1) only when both inputs are High and that can be seen in the truth table shown in Figure 2. The boolean expression for the AND operation is: Q = A . B

Another way to think of this is that the output of an AND gate is the minimum of the inputs; the AND gate finds the minimum of two bits. Also, the 74LS08 has 14 pins; four 2 input AND gates, a supply voltage (Vcc) pin, and a ground (GND) pin. The supply voltage (Vcc) should be between 4.75V and 5.25V in order for the IC to function properly. It is crucial to note that the only time the output of an AND gate is High (1) only when both inputs are High (1), as shown in Figure 7. Furthermore, for the breadboard part of this step, the blue wire is Input 1 (A), the white wire is the Input 2 (B), and the LED is the output.

Step 4: OR Gate

The OR gate implements logical disjunction; the result is High (1) when one or both of the inputs are High (1) just as seen in the truth table shown in Figure 2. Also, the boolean expression of the OR operation is: Q = A + B

An easier way to think of the OR gate is that its output is the maximum of the inputs. Also, the 74LS32 has 14 pins; four 2 input OR gates, a supply voltage (Vcc) pin, and a ground (GND) pin. The supply voltage (Vcc) should be between 4.75V and 5.25V in order for the IC to function properly. Furthermore, for the breadboard part of this step, the blue wire is Input 1 (A), the white wire is the Input 2 (B), and the LED is the output.

Comments

author
alloydog (author)2016-05-29

Nice tutorial

ThatIsIllogicalCaptain.jpg
author
aequanimitas (author)2015-12-31

what current consumption in stand by mode? let's say i want to replace microcontroller, will it take less energy for logic operations? thank you ?

author
TalalKhalil (author)aequanimitas2015-12-31

In TTL, Transistor-Transistor Logic, circuits, we need to be familiar with two types of currents; source and sink currents, and they are the DC current that flows between TTL gates from positive (source ending) to ground (sinking end). Also, sinking and sourcing occur simultaneously when one gate feeds a signal to another one.

Source current is the maximum current a gate can drive to a connected load.

Sink current is the maximum current a gate absorbs from a load connected to an external power supply.

For the 7400 series TTL devices, they can source up to -400 microAmps (negative sign means out of the device) and sink up to 16 milliAmps, depending on the number of loads connected to them.

If you are using a microcontroller, the same energy will be required to perform the logic operations. It also important to note that logic gates are voltage triggered, not current triggered. For instance, an Arduino is capable of outputting 3.3V and 5V, and the maximum DC current of Vcc and GND pins is 200.0 mA. Thus, an Arduino will be good enough to "power up" any logical operation.

author
aequanimitas (author)TalalKhalil2016-01-01

Thats why I said in standby mode. Probably it is not right word, but I've ment, that when I want to have switching device excpecting for putting transistors to HIGH or LOW from time to time, nad most of the time it is in LOW and waiting for change. So as I understood, it takes same current as LED, 20uA, when all ports are LOW?

author
TalalKhalil (author)aequanimitas2016-01-04

It depends on the what
operation your TTL IC chip performs. For instance, if you have a 74LS00, quad
2-input NAND gates, and when all ports ( except Vcc and GND) are low, the output ports will be High, and
thus a current (capable of lighting an LED) will flow out of them.

author
GianlucaG1 (author)aequanimitas2016-01-02

For CMOS logics (not for TTL) standby current, with no loads powered on the outputs, is negligible also for battery-powered devices. You can keep a CMOS logic powered by a 9V battery for years, waiting for something turning on all the device.

author
the_punnisher (author)2016-01-03

You might want to add a description and why LS devices are used instead of regular ICs like the 7404. There is also a Sample and Hold circuit in place that holds data until the system clock triggers the IC.

Also, the fact at original 1 GHz clock speeds, a digital 1 and 0 starts looking like a sine wave and the talk is about threshold voltages and duration for a 1 and 0. ( that is how a PIN ELECTRONIC card is calibrated for mass IC test systems ). I know, because I became a senior Calibration Tech ( there were no Test Engineer Degrees in those days ) and worked on the bleeding edge of technology for many years.

I was formally trained in microelectronics by a fellow engineer/scientist at the Chippewa Falls Technical School. This training helped me to understand failure modes for ICs and why ESD causes failures. I may not be aware of how our custom gate arrays worked but I can tell people what failure modes were on a failed part!

P.S. the metallic substrates and insulating substrates deposited on the silicon ( sand or glass ) do the actual conducting and semi conducting. the wafer base material ( even diamond! ) does not. Think of the wafer base material as a foundation of the " building " you are creating. If you want to really scare people, you could describe how the layers of the actual semiconductor are created.

For people who know a bit about chemistry, looking at a standard chart of the elements will explain why these chemicals are used in semiconductors.

author
the_punnisher (author)2016-01-03

I will add some other issues just to stir everything up. At Cray Research, some of us used NMOS semiconductors internally with ECL outputs and others, like Seymour, used complete ECL only devices. I'm sure our expert knows WHY these ECL connections were used.

The original X-MP used 16 gate arrays, custom made in our silicon foundry and were sent out to be mass produced. The bad news: U.S.suppliers could not meet our speed specifications; other engineers and myself got sent out to train U.S. suppliers how to build faster gate arrays. The two Japanese suppliers had no problem in meeting our specifications. Two years later, both Japanese companies showed up with supercomputers of their own. So much fr the NDAs both companies signed...8-/.

author
alloydog (author)2015-12-31

I've seen loads of "Intro to logic", but most of them never seem to explain one simple point: "Why do we use/need logic gates?"...

ThatIsIllogicalCaptain.jpg
author
TalalKhalil (author)alloydog2015-12-31

Logic gates are the fundamental building block of modern day computing. On a simple level, logic gates can be used to construct any desired logical system.

An example of an application:

1. For an OR gate

A factory's alarm system and its parameters, temperature and pressure, are taken into consideration. If one or more of the parameters exceeds the set limit, then the alarm would be triggered.

2. For a NOT gate:

If you add an odd number of NOT gates in series, you will get a ring oscillator, a fundamental circuit that generates a square wave.

Furthermore, logic gates are the basis of more advanced digital logic circuits that are the base of modern computers.

Cross-coupled NAND gates creates a latch that saves one bit of memory. Then, adding a clock to the latch creates a flip flop. There are many types of flip flops and they are: JK, RS, D, T flip flops. The most important one is the D "Delay" flip flop.

A computer's CPU, Central Processing Unit, consists of registers that are made of many D flip flops, and an ALU, Arithmetic Logic Unit, that performs arithmetic and bitwise logical operations to the data.

author
alloydog (author)TalalKhalil2016-01-01

You missed the point. When my little boy asked what all the ones and zeros were for, like in binary, I explained that digital circuits were basically a mass of switches which could only be on or off. Once he had that picture in his head, understanding /why/ we use logic gates was easier.

author
TalalKhalil (author)alloydog2016-01-01

My answer was catered towards the following question: "Why do we use/need logic gates?" However, your explanation for binary is correct because transistors are current-controlled switches, and a switch has only two states; either on (1) or off (0). Also, logic gates make performing various operation on binary numbers easier. Thank you for the interaction!

author
riverbend (author)2015-12-30

highs at both inputs A and B will also produce a high at the output.

An exclusive OR meets your description

author
TalalKhalil made it! (author)riverbend2015-12-30

For an OR gate, the output is High if one of the inputs is High.

For an Exclusive OR (XOR) gate, which is covered in the second part of this instructable, the output is High only when both inputs differ in value. The behavior of an XOR gate is shown in Table I.

For an XNOR gate, the output is High only when both inputs are the same. The behavior of an XNOR gate is shown in Table II.

When both inputs, A and B, are High and the output is High, then this meets the description an Exclusive NOR gate because both inputs are the same and the result is High.

Here is the link for the second instructable: https://www.instructables.com/id/Digital-Logic-Gates-Part-2/ (Reference)

Hopefully this answered your question :)

Snip20151230_43.pngSnip20151230_44.png
author
riverbend (author)TalalKhalil2015-12-31

Your statement that "The OR gate implements logical disjunction; the result is High (1) only when one of the inputs is High (1) as seen in the truth table shown in Figure 2" is incorrect.

For the 2-input OR gate shown in Fig. 2, a high at either or BOTH inputs results in a high output. See your own truth table.

OR Logic.jpg
author
TalalKhalil (author)riverbend2015-12-31

That is what I intentionally implied in my original statement, but I think I did not compose it correctly. I mentioned the behavior of an OR gate in my previous response, and you are absolutely right. Thus, I am going to edit it in the instructable. Thank you for the feedback!

author
DonCesare (author)2015-12-30

Looking forward for part 2. I have a ton of these gates ic laying around and didnt know how to use them. now i know thank you so much!

author
TalalKhalil (author)DonCesare2015-12-30

You are welcome!

Here is the link for the second part: https://www.instructables.com/id/Digital-Logic-Gates-Part-2/

Enjoy!

About This Instructable

9,794views

291favorites

License:

Bio: Inventing the future by turning ideas into reality
More by TalalKhalil:Python Programming Series #1Arduino: HC-SR04 Ultrasonic Sensor Arduino: Simple Sequential LED's
Add instructable to: