Number Representations & States

"how numbers are stored and used in computers"

Logic gates

Digital logic gates execute logical operations on binary data. They are the build blocks of all digital electronics, and are physically implemented by joining transistors (digital switches).

Transistors

A transistor is an electronic switch that controls the flow of an electrical signals. By configuring transistors in various arrangements, the various logic gates shown below can be created. Since the invention of the transistor in 1947, the number of transistors in a device has increased exponentially - a phenomenon known as Moore's Law.

No results.

To give some sense of just how many transistors are in modern devices, here are a few examples, which estimate that it takes an average of 4 transistors per logic gate (some require a few more, and some a few less).

NOT gates

Known also as an inverter, this singular gate performs a function of exquisite symmetry: it accepts a single input and produces an output that is its exact logical complement.

Mathematically denoted as , ̅, or , the gate's sole purpose is to negate—to turn a logical into a , and vice versa. In doing so, the NOT gate orchestrates one of the most fundamental operations in Boolean algebra: the logical inversion.

At a glance, the function of a NOT gate may appear trivial. This deceptively simple component lies at the heart of conditional logic, signal conditioning, timing control, and arithmetic operations. The very act of decision-making in a computer - whether to act or to abstain - is often framed through the inversion of a logical state.

notClick the inputs to change the gate's output.

1
Input (A)Output
01
10

In CMOS technology, a NOT gate is constructed using a pair of transistors: one n-type and one p-type. When the input is high, the n-type transistor conducts, grounding the output. When the input is low, the p-type transistor conducts, pulling the output high. This complementary action results in low power consumption and high noise immunity.

AND gates

The AND gate reigns as a gate of agreement - a digital arbiter that yields affirmation only in the presence of unanimous consent. It is a gate of conjunction, where multiple logical conditions must all be satisfied before permission is granted to proceed.

The AND gate, conceptually simple yet structurally essential, performs a fundamental Boolean operation: it outputs a logical only if all of its inputs are . In any other case - even if a single input deviates to - the gate responds with silence: a . This behavior makes it a powerful mechanism for enforcing simultaneous conditions in digital circuits.

andClick the inputs to change the gate's output.

0
Input (A)Input (B)Output
000
010
100
111

In CMOS logic, a basic 2-input AND gate is often realized by cascading NAND and NOT gates (since NAND is more fundamental at the transistor level). However, it can also be directly constructed using complementary pairs of transistors arranged such that the output is driven high only when both inputs are high.

NAND gates

A nand gate returns the opposite result of an and gate.

nandClick the inputs to change the gate's output.

1
Input (A)Input (B)Output
001
011
101
110

OR gates

An or gate returns true if at least one input is true.

orClick the inputs to change the gate's output.

0
Input (A)Input (B)Output
000
011
101
111

A nor gate returns the opposite result of an or gate.

norClick the inputs to change the gate's output.

1
Input (A)Input (B)Output
001
010
100
110

XOR gates

A xor gate returns true if one input is true and the other is false.

xorClick the inputs to change the gate's output.

0
Input (A)Input (B)Output
000
011
101
110

A xnor gate returns true if both inputs are the same.

xnorClick the inputs to change the gate's output.

1
Input (A)Input (B)Output
001
010
100
111
  • multiplication

  • division

  • construct a half adder and full adder

  • karnaugh maps, boolean simplification