Skip to main content

Stepping Through Logic Gates

Key Takeaways

  • Overview of the seven essential logic gates.

  • Logic families and their evolution with technology.

  • Combination logic vs. sequential logic.

Logic gate symbols

Like an alphabet, these seven logic gates can be combined endlessly

Depending on the level of abstraction, one can consider logic gates at the center of electronics. Whether a single gate or the several billion needed to provide the robust operations of today’s integrated circuits, gates provide insight into the fundamental building blocks of Boolean logic that can be expanded and endlessly reconfigured to create new functionalities and features.

Logic gates are the alphabet of electronic design, and as such, designers should possess at least a passing familiarity with how they function. While it’s not feasible to evaluate any full-scale circuit at the gate level, becoming confident with the symbols and how they simplify can offer designers a potent troubleshooting methodology.

Evaluating the Seven Logic Gates

Logic gates represent a level of circuit abstraction beyond that of devices directly. Individual components are reduced to functionality in terms of gates, which determine the flow of signals based on high or low voltage signals that equate to a true-false dichotomy. The six basic logic gates are simple logic operators familiar to anyone with a small amount of programming experience:

Input 1

Input 2

NOT*

AND

OR

NAND

NOR

XOR

XNOR

F

F

T

F

F

T

T

F

T

F

T

T

F

T

T

F

T

F

T

F

F

F

T

T

F

T

F

T

T

F

T

T

F

F

F

T

*: NOT is a single-input gate and its logic output reflects only the truth value of Input 1.

The two most immediately recognizable logic operators are AND and OR. They are functions similar to everyday usage in language, with the added wrinkle that OR is nonexclusive – the statement “How about going out for ice cream or pizza?” can in fact mean both ice cream and pizza (either selection or both are all logically valid). The more common “this-or-that, but not both” language belongs to XOR. From there, the NOT gate can be combined with any of the operators to form a logical complement: NAND, NOR, and XNOR for AND, OR, and XOR, respectively. 

These operator pairs were initially related by DeMorgan, who helped revolutionize the field of logic design. While the relationship between these operator pairs is noteworthy for understanding the interplay between gates as well as potential transformations, they are less useful in practice, outside of very crude prototyping or proof-of-concept. It is usually far more straightforward in terms of procurement, layout, and manufacturing to place a single gate (or equivalent function) than multiple gates to act as the original gate in question. Even more importantly, it is already unlikely that most designs would have the need for individual gate design, as many ICs operate by joining together millions or more logic gates. For educational purposes, however, switching between paired logic gates with inversion is a crucial tool to collapse more complicated logic diagrams.

Universal Operators

Building on the aforementioned pairs among the seven basic operators, two have a much larger usage than someone unfamiliar with gate design might expect. NAND and NOR are universal operators, meaning they can form any other operator using only a varying number of instances of themselves. Once again, although this tidbit is useful from an educational standpoint, this method of implementation is wildly inefficient.

Reading logic gate diagrams requires a slow and measured tracking of digital signals from input to output. Truth tables, like the one shown above, provide the most rudimentary method for stepping through individual points in the logic build.

 

Logic Families as an Expression of Their Underlying Gates

As described, it is rare to utilize single gates outside of very simple diagrams or circuits to evaluate logic due to the difficulty in carrying out individual junctions an astronomically high amount of times. Like most computationally intensive and repetitive tasks, computers are able to perform these diagnoses with greater speed and precision than any human – it is the manner in which most modern systems run after all. It’s worthwhile to investigate the hierarchy of logic families:

  • Resistor-transistor logic - RTL utilizes resistors on the input and bipolar junction transistors (BJTs) as the switching device. Historically, this was produced via discrete components, but RTL was also the first logic family to be featured as an integrated circuit. RTL played an advantageous role in early circuit development when transistors were expensive and difficult to manufacture, as they minimized their usage. Today, their usefulness is limited in scope due to the poor power performance of a switch that operates as an always-on or always-off configuration. Further, the design of the RTLs is limited to three-input. 
  • Diode-transistor logic - The immediate successor to RTL that replaces the discrete element resistor with a diode. Unlike the former, which is susceptible to sprawling circuits, DTL is able to more succinctly capture complex logic diagrams by improving the number of gates on the input (also known as the fan-in). DTL would not be mistaken as fast compared to more modern logic families, but improvements can be made with a Shottky transistor that reduces saturation during forwarding bias.
  • Transistor-transistor logic - TTL represents a watershed moment in electronic design and is inseparable from modern devices. Even compared with newer technologies, TTL still manages to hold its own as a well-scaling architecture with increasing clocks and signal speeds. However, there are some significant drawbacks to the output: its asymmetrical nature and overlap between top and bottom conductors. The inherent asymmetric nature makes it difficult for TTL to drive transmission lines, though this can be remedied with line drivers. The overlap has a much more debilitating effect, coupling ICs together and generally serving as an overall detriment on performance; decoupling capacitors can help combat this effect to better isolate individual ICs.
  • PMOS - The PMOS, and MOSFETs in general, are able to offer a comparable function to a BJT in a relatively minuscule package. Power consumption is reduced, as the gate is created as a dynamic response to stimuli as opposed to a static element, but power supply in general becomes a more difficult topic for PMOS. This is due to the requirement of both a positive and negative source voltage. Furthermore, the PMOS has worse switching speeds, particularly on the high-low transition.
  • NMOS - Initially established as the faster MOSFET. NMOS has the constraint that its power draw is static (unlike PMOS), resulting in less overall efficiency. 
  • CMOS - Suited for high performance and high density with the power drain occurring during the on/off switches, CMOS has come to dominate everyday design. Its power consumption is far below that of similar logic families and obliterates the draw of older families by a factor of several magnitudes. This efficiency also minimizes heat generated by the circuit, further endearing it for dense chips and boards. The design combines NMOS and PMOS to cover the individual drawbacks of each MOSFET design. 

Generic logic diagram

Diagrams like this are commonplace within logic gates, representing a vast amount of gates.

When the Past Matters in Circuit Design

Digital logic can take on many forms, including basic memory functions. One lens to analyze logic diagrams is sequential vs. combinational, or the difference between states that are and are not dependent on prior circuit states, respectively. Combinational logic is much easier to grasp initially, as it simply represents an evaluation of the logic at that point and time, regardless of what the gate or circuit has experienced prior. Imagine quickly glancing over a gate or chip and seeing the signals traveling through it in real time – this would be akin to combinational logic, as only an observation of the circuit is needed to determine the overall state.

In application, combinational logic can be thought of as the highest abstraction state of the circuit before passing through to general functionality. Boolean logic is employed in a number of devices to provide fast mathematical computations, including:

  • Adders - For half and full summing capabilities.
  • Subtractors - As above for subtraction.
  • Multiplexing - A data organization tool that is able to select multiple inputs and selectively pass forward any of the inputs using a secondary operation.
  • Demultiplexing - A reversal of the mux operation, intended to fan into multiple inputs from a single input and selection operation.

Effectively, any device associated with the arithmetic logic unit (ALU) belongs to the realm of combinational logic.

Sequential logic is more complex but unlocks additional functionality. For a particular clock cycle, evaluations of a sequential device are indeterminate without knowing certain preceding states. These devices are referred to as finite-state machines, as they are locked into a predetermined amount of states based on prior conditions. Sequential circuits need to be observed with the mindset of where they have come from and where they are going.

With this concept of transient states comes time. These state changes are driven in part by clock signals, either synchronous or asynchronous, which determine when output is driven by the circuit. Synchronous is tied to some schedule; think of a bus arriving at a predetermined stop to allow passengers to disembark or ride. An asynchronous type of sequential circuit is not tied to a schedule and can instead alter its state at any time as inputs change.

Flip-flops, the most fundamental sequential logic device, can in fact operate either synchronously or asynchronously. There is some difficulty inherent to asynchronous memory storage devices, as the state depends on the input; without a clock signal serving to lock in these inputs before assessment, the output state can be influenced by the arrival time of signals. In severe cases, this can lead to racing, where the logical output of the gate is in an incorrect state from what is to be expected.

Wall-mounted analog clock

In logic, as it is in most things, time is everything.

Logic gates represent a fundamental concept of electronic design, and though it is entirely unlikely a designer would need to evaluate or even build gates of their own, understanding their operation helps prevent instability. Evaluating the minutiae of a circuit can be challenging, but Cadence’s robust PCB Design and Analysis Software offers a multitude of tools that can quickly diagnose and rectify designs. When it comes time to translate your schematic into a realizable board, trust  OrCAD PCB Designer to provide both ease and power without sacrificing features.

Leading electronics providers rely on Cadence products to optimize power, space, and energy needs for a wide variety of market applications. To learn more about our innovative solutions, talk to our team of experts or subscribe to our YouTube channel.

Leading electronics providers rely on Cadence products to optimize power, space, and energy needs for a wide variety of market applications. To learn more about our innovative solutions, talk to our team of experts or subscribe to our YouTube channel.