Digital Logic Structures and Sequential Logic Structures

Transistors as the Fundamental Building Block

  • The microprocessor, a central component of computer systems, is constructed from millions of transistors. Examples of transistor counts in historical processors include:

    • Intel Pentium 4 (released in 20002000): 48×10648 \times 10^6 transistors.

    • IBM PowerPC 750FX (released in 20022002): 38×10638 \times 10^6 transistors.

    • IBM/Apple PowerPC G5 (released in 20032003): 58×10658 \times 10^6 transistors.

  • At a logical level, a transistor functions as a switch. These switches are combined to create fundamental logic functions, including AND, OR, and NOT gates.

  • These basic gates are further integrated into higher-level digital structures such as adders, multiplexers (MUX), decoders, and registers.

  • The culmination of these structures allows for the building of complex processors, such as the LC-3.

MOS Transistor Mechanics and Switching Logic

  • Computers utilize Metal Oxide Semiconductor (MOS) transistors, which come in two complementary types: n-type and p-type.

  • Switch-based circuits represent binary states where values are associated with physical conditions: on/off, open/closed, or voltage/no voltage.

  • For an n-type MOS transistor:

    • When the Gate has a positive voltage (logic 11), it acts as a closed switch (short circuit between terminals).

    • When the Gate has zero voltage (logic 00), it acts as an open switch (open circuit between terminals).

    • Terminal #2 of an n-type transistor must be connected to Ground (GNDGND or 0V0\text{V}).

  • For a p-type MOS transistor:

    • When the Gate has a positive voltage (logic 11), it acts as an open switch.

    • When the Gate has zero voltage (logic 00), it acts as a closed switch.

    • Terminal #1 of a p-type transistor must be connected to the positive supply voltage (+2.9V+2.9\text{V}).

  • While various systems use different ranges for logical symbols (such as +5V+5\text{V} or +3.3V+3.3\text{V}), the standard for these digital logic structures is defined as +2.9V+2.9\text{V} for logic 11.

CMOS Circuit Design and Basic Logic Gates

  • Complementary MOS (CMOS) circuits utilize both n-type and p-type transistors together to ensure stable output levels.

  • Logic of CMOS components:

    • p-type transistors are attached to the positive voltage and pull the output voltage UP when the input is zero.

    • n-type transistors are attached to Ground and pull the output voltage DOWN when the input is one.

    • Proper design ensures that for any input, the output is connected either to Ground or to the positive voltage, never both simultaneously.

  • Basic Logic Gate Definitions:

    • NOT Gate (Inverter): Reverses the input. If input is 00, output is 11 (+2.9V+2.9\text{V}). If input is 11, output is 00 (0V0\text{V}).

    • NOR Gate: Output is 11 only if both inputs are 00. It features a serial structure of p-type transistors on top and a parallel structure of n-type transistors on the bottom.

    • OR Gate: Constructed by adding an inverter to the output of a NOR gate. Output is 11 if any input is 11.

    • NAND Gate (AND-NOT): Output is 00 only if both inputs are 11. It features a parallel structure of p-type transistors on top and a serial structure of n-type transistors on the bottom.

    • AND Gate: Constructed by adding an inverter to the output of a NAND gate. Output is 11 only if all inputs are 11.

  • DeMorgan's Law allows for the conversion between AND and OR operations by inverting both the inputs and the final output.

Combinational Logic Modules

  • A Combinational Logic Circuit is "stateless," meaning its output depends exclusively on the current inputs.

  • Decoder:

    • A circuit with nn inputs and 2n2^n outputs.

    • Exactly one output is set to 11 for each unique input pattern.

  • Multiplexer (MUX):

    • Consists of an nn-bit selector and 2n2^n inputs with a single output.

    • The output signal is equal to the specific input selected by the selector bits (e.g., a 44-to-11 MUX).

  • Full Adder:

    • Processes two bits (AA and BB) and a carry-in (CinC_{in}).

    • Produces a sum bit (SS) and a carry-out bit (CoutC_{out}).

    • A 4-bit adder is created by cascading four full adders, connecting the CoutC_{out} of one stage to the CinC_{in} of the next.

  • Logical Completeness: Any possible truth table can be implemented using only a combination of AND, OR, and NOT gates. This is achieved by identifying input combinations that yield a 11 and OR-ing the results of those specific AND-gated combinations.

Sequential Logic and Information Storage

  • Sequential Logic Circuits are capable of storing information. The output depends on both the current inputs and the sequence of past inputs (the "state").

  • R-S Latch (Reset-Set):

    • SS (set) is used to set the value to 11.

    • RR (reset) is used to clear the value to 00.

    • Quiescent state occurs when R=1R=1 and S=1S=1, holding the previous value.

    • Setting R=0R=0 and S=1S=1 resets the output to 00. Setting S=0S=0 and R=1R=1 sets the output to 11.

    • The state where R=0R=0 and S=0S=0 is invalid and should be avoided.

  • Gated D-Latch:

    • Features two inputs: Data (DD) and Write Enable (WEWE).

    • When WE=1WE=1, the latch stores the value of DD.

    • When WE=0WE=0, the latch retains its previous state regardless of changes to DD.

  • Register:

    • A multi-bit storage unit composed of multiple D-latches sharing a common WEWE signal. When WE=1WE=1, an nn-bit value is written.

    • Multi-bit values are numbered from right (bit 00) to left (bit n−1n-1). Brackets distinguish ranges, such as A[14:9]A[14:9].

Memory Systems and Architecture

  • Memory is organized as a logical array of bits with kk locations and mm bits per location.

  • Address Space refers to the number of locations, typically a power of 22, denoted as k=2nk = 2^n.

  • Addressability refers to the number of bits stored at each location (e.g., 88 bits for byte-addressable memory).

  • Implementation Types:

    • Static RAM (SRAM): Fast; retains data as long as power is supplied.

    • Dynamic RAM (DRAM): Denser and slower; data decays and must be periodically refreshed.

    • Non-volatile Memory: ROM, PROM, and Flash (retain data without power).

  • A logical memory structure includes an address decoder, word select lines, and write enable (WEWE) controls.

State Machines and System Dynamics

  • A Finite State Machine (FSM) is a system defined by a finite number of states, inputs, and outputs.

  • The system transitions between states based on an explicit specification (state diagram) triggered by inputs.

  • The State of a system is a snapshot of all relevant elements at a specific moment. For example, a basketball scoreboard captures the points, time, and possession.

  • Clock Circuits: Often used to trigger transitions. At the start of each clock cycle, the machine evaluates its current state and external inputs to move to the next state.

  • Master-Slave Flipflop:

    • A pair of gated D-latches used to store state bits while isolating the next state from the current state.

    • Clock Cycle Phase 1: The current state is sent to the logic circuit.

    • Clock Cycle Phase 2: The next state computed by the logic is stored in the latch.

Case Study: Data Path and Logical Implementation

  • The Data Path of a computer, such as the LC-3, integrates both combinational and sequential logic to process information.

  • Combinational components in the Data Path:

    • Decoders: Convert instructions into control signals.

    • Multiplexers: Select specific data inputs and outputs.

    • Arithmetic Logic Unit (ALU): Performs data operations.

  • Sequential components in the Data Path:

    • State Machine: Coordinates the timing of data movement and control signals.

    • Registers and Latches: Provide internal storage elements for the processor.