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:

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.

<p>Nice tutorial</p>
<p>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 ?</p>
<p>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. </p><p>Source current is the maximum current a gate can drive to a connected load. </p><p>Sink current is the maximum current a gate absorbs from a load connected to an external power supply. </p><p>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. </p><p>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 &quot;power up&quot; any logical operation. </p>
<p>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?</p>
<p>It depends on the what<br>operation your TTL IC chip performs. For instance, if you have a 74LS00, quad<br>2-input NAND gates, and when all ports ( except Vcc and GND) are low, the output ports will be High, and<br>thus a current (capable of lighting an LED) will flow out of them. </p>
<p>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.</p>
<p>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. </p><p>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.</p><p>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><p>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 &quot; building &quot; you are creating. If you want to really scare people, you could describe how the layers of the actual semiconductor are created. </p><p> 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. </p>
<p>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. </p><p>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-/. </p>
<p>I've seen loads of &quot;Intro to logic&quot;, but most of them never seem to explain one simple point: &quot;Why do we use/need logic gates?&quot;...</p>
<p>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.</p><p>An example of an application:</p><p>1. For an OR gate</p><p>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.</p><p>2. For a NOT gate:</p><p>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. </p><p>Furthermore, logic gates are the basis of more advanced digital logic circuits that are the base of modern computers.</p><p>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 &quot;Delay&quot; flip flop.</p><p>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. </p>
<p>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.</p>
<p>My answer was catered towards the following question: &quot;Why do we use/need logic gates?&quot; 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!</p>
<p>highs at both inputs A and B will also produce a high at the output.</p><p>An exclusive OR meets your description</p>
<p>For an OR gate, the output is High if one of the inputs is High.</p><p>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.</p><p>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.</p><p>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.</p><p>Here is the link for the second instructable: <a href="https://www.instructables.com/id/Digital-Logic-Gates-Part-2/" style="">https://www.instructables.com/id/Digital-Logic-Gates-Part-2/</a> (Reference)</p><p>Hopefully this answered your question :) </p>
<p>Your statement that &quot;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&quot; is incorrect. </p><p>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. </p>
<p>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!</p>
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!
<p>You are welcome!</p><p>Here is the link for the second part: <a href="https://www.instructables.com/id/Digital-Logic-Gates-Part-2/">https://www.instructables.com/id/Digital-Logic-Gates-Part-2/</a></p><p>Enjoy!</p>