HexDef

LAYER 02 Digital Logic & Microarchitecture

The discrete computational bridge between physical silicon and software execution. Master curriculum spanning Boolean algebra, ALU design, RISC/CISC ISAs, 5-stage superscalar pipelining, cache coherence hierarchies, hardware security enclaves (ARM TrustZone, Intel CET, ARM MTE), and microarchitectural transient execution exploits (Spectre, Meltdown, MDS, Rowhammer).

6 Core Domains
32 Technical Modules
100% Microarchitectural Ground Truth

2.1 Digital Logic & Circuit Primitives

5 Modules
2.1.1

Logic Gates & Boolean Algebra

BS - Core

Definition: Semiconductor switching circuits (AND, OR, NOT, XOR, NAND, NOR) that evaluate discrete binary voltage states against fundamental Boolean algebraic identities and DeMorgan's laws.

Security & Hardware Application: XOR gates form the mathematical foundation of stream ciphers and one-time pads; universal NAND/NOR gate topologies construct all computing logic and are audited for hardware backdoors.

2.1.2

Combinational Logic (Adders, Multiplexers, Decoders & ALUs)

BS - Core

Definition: Stateless logic networks whose outputs depend solely on the instantaneous combination of present inputs, including ripple-carry/lookahead adders, barrel shifters, and Arithmetic Logic Units (ALUs).

Security & Hardware Application: The execution core of every microprocessor; arithmetic overflow and underflow conditions in ALU circuits create integer truncation vulnerabilities in compiled software.

2.1.3

Sequential Logic (Flip-Flops, Latches & Clocks)

BS - Core

Definition: Bistable multivibrator circuits (D flip-flops, SR latches) governed by strict setup (tsetup) and hold (thold) timing constraints that store state synchronously on master clock transitions.

Security & Hardware Application: Building CPU register files and pipeline stage boundaries; setup-time violations induced via clock-glitching cause flip-flops to enter metastable states, skipping security branch checks.

2.1.4

Finite State Machines (FSM: Mealy & Moore)

BS - Core

Definition: Mathematical models of sequential hardware control composed of discrete state registers, input combinational decoders, and transition functions (Mealy with asynchronous input dependency vs. Moore synchronous outputs).

Security & Hardware Application: Governs protocol controllers (USB, PCIe, DRAM) and instruction decoders; unhandled illegal state transitions allow fault-injection attacks to force hardware controllers into undefined privileged modes.

2.1.5

Hardware Description Languages (HDLs) & FPGAs (Verilog / VHDL)

BS/MS - Architecture

Definition: Register-Transfer Level (RTL) formal code standards used to synthesize digital logic onto Field-Programmable Gate Array Look-Up Tables (LUTs) or fabricate dedicated Application-Specific Integrated Circuits (ASICs).

Security & Hardware Application: Designing custom open-source cryptographic accelerators (RISC-V); RTL static analysis tools audit HDL source code for stealth silicon backdoors and malicious trigger circuits.

2.2 Instruction Set Architecture (ISA) & CPU Fundamentals

5 Modules
2.2.1

Instruction Set Architecture (ISA: x86-64, ARM64, RISC-V)

BS - Core

Definition: The formal architectural contract between hardware execution and software binary code, defining machine instructions, native word sizes, addressing modes, and programmer-visible register states.

Security & Hardware Application: The fundamental target for binary reverse engineering, shellcode crafting, and exploit payload generation; dictates instruction encoding (fixed-length 32-bit in ARM/RISC-V vs. variable-length 1–15 byte in x86).

2.2.2

Register Architecture & Special-Purpose Registers

BS - Core

Definition: Zero-latency on-chip storage directly wired to ALU data paths, split into General-Purpose Registers (GPRs) and Special Registers (Instruction Pointer RIP/PC, Stack Pointer RSP/SP, Frame Pointer, Status Flags).

Security & Hardware Application: Overwriting the Instruction Pointer (RIP) to hijack control flow is the primary objective of stack/heap memory corruption exploits; register preservation conventions govern calling ABIs.

2.2.3

Endianness & Memory Alignment Constraints

BS - Core

Definition: Byte-ordering conventions in multi-byte memory wordsβ€”Little-Endian (least significant byte first in x86/ARM) vs. Big-Endian (network order)β€”alongside natural 4-byte/8-byte memory alignment rules.

Security & Hardware Application: Binary exploit payloads fail if address pointers or shellcode bytes are reversed; unaligned memory access induces bus lock penalties or hardware alignment check faults (#AC).

2.2.4

Microcode Engine & Processor Control Units

MS - Advanced

Definition: An internal hardware translation engine inside CISC processors (x86) that decomposes complex architectural instructions into sequences of primitive hardware micro-operations (μops) stored in on-die Microcode ROM.

Security & Hardware Application: CPU manufacturers issue cryptographically signed microcode patches to mitigate hardware vulnerabilities (Spectre, Downfall, Meltdown) in field-deployed silicon without physical chip replacement.

2.2.5

Vector Architectures & SIMD Acceleration (AVX-512, NEON, SVE)

BS/MS - Core

Definition: Single Instruction, Multiple Data (SIMD) execution units with wide 128-bit, 256-bit, and 512-bit registers engineered to execute high-throughput parallel data processing on floating-point and cryptographic arrays.

Security & Hardware Application: Vector execution units introduce microarchitectural leakage channels (e.g., Downfall / Gather Data Sampling), where speculative execution on vector GATHER instructions leaks stale cross-process register data.

2.3 CPU Pipelining & High-Performance Microarchitecture

6 Modules
2.3.1

Instruction Execution Pipeline (Classic 5-Stage)

BS - Core

Definition: Partitioning instruction processing into discrete sequential stages (Fetch, Decode, Execute, Memory, Writeback), allowing up to five instructions to execute concurrently across different hardware functional units.

Security & Hardware Application: Pipeline execution overlaps create instruction cycle timing variations; attackers measure execution latency deltas to infer cryptographic secret data in constant-time algorithms.

2.3.2

Pipeline Hazards & Forwarding Networks

BS/MS - Core

Definition: Microarchitectural stalls resulting from Structural hazards (hardware contention), Data hazards (RAW, WAR, WAW dependencies), and Control hazards (branch jumps), resolved via data forwarding bypass paths or pipeline bubbles.

Security & Hardware Application: Forwarding network race conditions and pipeline stall delays expose side-channel timing artifacts; analyzing stall frequency reveals memory access patterns inside victim cryptographic processes.

2.3.3

Superscalar Execution & Register Renaming

MS - Advanced

Definition: Parallel multi-issue microarchitectures that map a small set of architectural registers to a larger pool of physical registers via Register Alias Tables (RAT), eliminating false Write-After-Read (WAR) and Write-After-Write (WAW) hazards.

Security & Hardware Application: Physical register file entries can retain transient stale data from prior security contexts, susceptible to speculative microarchitectural data sampling (MDS) before physical register clearing.

2.3.4

Branch Prediction & Branch Target Buffers (BTB)

MS - Advanced

Definition: Hardware speculative prediction engines using 2-bit saturating counters, TAGE multi-history tables, and Branch Target Buffers (BTB) to predict the outcome and target address of conditional jump instructions in advance.

Security & Hardware Application: Poisoning BTB cache states allows attackers to mistrain the CPU into speculatively jumping to arbitrary unauthorized code gadgets (Spectre-V2 Branch Target Injection).

2.3.5

Out-of-Order Execution (OoO) & Speculation

MS - Advanced

Definition: Dynamically reordering instruction streams via Reservation Stations and Reorder Buffers (ROB) to execute operations as soon as operands are ready, retiring architectural state in-order and rolling back speculative errors.

Security & Hardware Application: The foundational hardware performance mechanism underlying transient execution attacks (Spectre, Meltdown); discarded speculative execution paths leave physical side-channel traces in CPU caches.

2.3.6

Simultaneous Multithreading (SMT / Hyper-Threading)

MS - Advanced

Definition: Microarchitectural hardware slicing that presents multiple logical CPU cores to the OS while sharing underlying physical execution pipelines, ALUs, and L1/L2 cache resources across co-located sibling threads.

Security & Hardware Application: Cross-thread side-channel exploitation (PortSmash, SMoTherSpectre); a malicious unprivileged thread running on a sibling logical core measures ALU port contention to extract private keys in real time.

2.4 Memory Hierarchy, Interconnects & CPU Caches

5 Modules
2.4.1

Cache Architecture (L1I/L1D, L2, L3 / LLC)

BS/MS - Core

Definition: Multi-tier on-die SRAM memory pools organized into fixed 64-byte Cache Lines with Tag, Index, and Offset bit fields designed to bridge the nanosecond latency gap between CPU cores and main DRAM memory.

Security & Hardware Application: The ~1ns cache hit vs. ~60ns DRAM cache miss latency delta is the physical timing oracle utilized by microarchitectural side-channel attacks to reconstruct secret memory data.

2.4.2

Cache Placement & Replacement Policies (Set-Associative, LRU)

BS/MS - Core

Definition: Mathematical algorithms determining which cache set an address maps to (N-way set-associativity) and which cache line is evicted (Least Recently Used LRU, Pseudo-LRU) when a set reaches full capacity.

Security & Hardware Application: Exploited in eviction-based cache attacks (Prime+Probe); attackers prime target cache sets with probe lines and measure victim eviction patterns to track private key operations.

2.4.3

Cache Coherence Protocols (MESI, MOESI)

MS - Advanced

Definition: Hardware finite state machines (Modified, Exclusive, Shared, Invalid, Owner) operating across snooping buses or directory fabrics to ensure multi-core processors maintain a consistent view of shared physical memory.

Security & Hardware Application: Inter-core cache invalidation requests and coherence snooping traffic across on-chip interconnects leak shared memory access patterns to unprivileged observer cores.

2.4.4

Memory Management Unit (MMU) & Hardware TLBs

BS/MS - Core

Definition: Dedicated hardware multi-level page table walkers and Translation Lookaside Buffer (TLB) associative caches that accelerate virtual-to-physical address translation directly in silicon.

Security & Hardware Application: TLB eviction timing side-channels (TLBleed) bypass cache-isolation defenses; speculative MMU page-table walking without immediate privilege faulting enabled the original Meltdown exploit.

2.4.5

System Interconnects & Bus Fabrics (PCIe, CXL, AXI, Crossbars)

MS - Architecture

Definition: High-bandwidth point-to-point packetized buses (PCI Express, Compute Express Link CXL, ARM AXI) and on-chip crossbar switches connecting CPU cores to GPUs, accelerators, and system RAM.

Security & Hardware Application: Direct Memory Access (DMA) attack surfaces; malicious PCIe hardware devices can bypass CPU access controls to read/write physical kernel memory unless strict IOMMU access policies are enforced.

2.5 Hardware Security Primitives & Silicon Roots of Trust

5 Modules
2.5.1

Hardware Root of Trust (HRoT) & eFuses

BS/MS - Architecture

Definition: Immutable on-die silicon Mask ROM containing factory initial boot code, paired with microscopic One-Time Programmable (OTP) physical electronic fuses that store public key hashes and security lifecycle states.

Security & Hardware Application: Anchors the cryptographic chain of trust for Secure Boot; prevents firmware rollback attacks and locks JTAG debug interfaces once production devices leave the assembly facility.

2.5.2

Hardware Security Modules (HSM) & Secure Elements (SE)

BS/MS - Core

Definition: Physically isolated, tamper-resistant cryptographic coprocessors (Apple Secure Enclave SEP, Google Titan M2, discrete TPM 2.0) with dedicated cryptographic accelerators, internal SRAM, and active physical sensor shielding.

Security & Hardware Application: Generates and stores private cryptographic keys isolated from the main host OS; handles biometric authentication and disk encryption key unlocking.

2.5.3

Trusted Execution Environments (ARM TrustZone, Intel SGX, AMD SEV)

MS - Advanced

Definition: Hardware architectural privilege extensions that partition the processor into Secure and Non-Secure states (TrustZone) or dynamically encrypt RAM pages (AMD SEV / Intel SGX enclaves) to protect memory from a compromised host kernel.

Security & Hardware Application: Enables confidential computing in untrusted cloud environments; vulnerable to enclave side-channel extraction (SGX-Pore, SGAxe) via unmitigated cache timing leaks.

2.5.4

Hardware Control-Flow Integrity (Intel CET, ARM PAC & BTI)

MS - Advanced

Definition: Silicon-enforced execution integrity mechanisms, including hardware Shadow Stacks (Intel CET) and cryptographic Pointer Authentication Codes (ARM PAC) that validate return addresses and indirect jump targets in hardware.

Security & Hardware Application: Hardware-level mitigation against Return-Oriented Programming (ROP) and Jump-Oriented Programming (JOP) attacks, rendering traditional memory corruption control-flow hijacking inert.

2.5.5

Hardware Memory Tagging (ARM MTE) & Capabilities (CHERI)

MS/PhD - Frontier

Definition: Silicon-level memory safety extensions that attach 4-bit metadata tags to 16-byte memory granules, validating pointer tags against allocated memory tags on every load and store instruction at hardware wire speed.

Security & Hardware Application: Eliminates entire classes of memory vulnerabilities (Use-After-Free, out-of-bounds spatial overflows) directly in silicon with negligible software execution overhead.

2.6 Microarchitectural Attacks & Silicon Exploitation

6 Modules
2.6.1

Spectre (Speculative Execution / Branch Target Exploitation)

MS - Advanced

Definition: Inducing CPU branch predictors (BTB / PHT) to speculatively execute unauthorized code paths beyond bounds checks (Spectre-V1) or target indirect branch targets (Spectre-V2), recovering secret data via cache timing side-channels.

Security & Hardware Application: Breaks process boundaries, virtual machine isolation, and browser sandboxes; allows JavaScript in a browser tab to read cross-origin passwords and cryptographic keys from memory.

2.6.2

Meltdown (Rogue Data Cache Load)

MS - Advanced

Definition: Exploiting microarchitectural race conditions where out-of-order execution loads kernel memory into L1 data caches before the CPU's architectural privilege check completes and raises a page fault exception.

Security & Hardware Application: Allowed unprivileged standard user applications to dump entire physical kernel memory at megabytes per second; required Kernel Page Table Isolation (KPTI) operating system redesign.

2.6.3

Speculative Store Bypass & RSB Exploits (Retbleed / Spectre-V4)

MS - Advanced

Definition: Exploiting CPU memory disambiguation logic (Store-to-Load Forwarding bypasses in Spectre-V4) and Return Stack Buffer (RSB) underflows during deep call trees to hijack speculative return addresses.

Security & Hardware Application: Defeats software Retpoline mitigations; forces the CPU to speculatively execute unauthorized return gadgets across kernel and hypervisor security boundaries.

2.6.4

Transient Execution Buffer Sampling (MDS, Downfall, Inception)

MS/PhD - Frontier

Definition: Leaking transient, uncommitted data residing inside internal microarchitectural buffers (Line Fill Buffers LFB, Load/Store Queues, Vector Register Files) across logical sibling threads and virtual machines.

Security & Hardware Application: Exploits like ZombieLoad, RIDL, and Downfall allow unprivileged adversaries to sniff secret encryption keys and TLS master secrets across multi-tenant cloud hypervisors.

2.6.5

Rowhammer (DRAM Disturbance Bit-Flipping)

MS - Advanced

Definition: Repeatedly opening and closing specific physical memory rows (wordlines) in modern dense dynamic RAM (DRAM), causing electromagnetic cross-talk that leaks electrical charge and flips bits in adjacent unaccessed rows.

Security & Hardware Application: Pure hardware-induced memory corruption; flips bits in kernel Page Table Entries (PTEs) or RSA modulus keys to achieve arbitrary kernel read/write without software bugs.

2.6.6

Precision Cache-Timing Attack Primitives (Flush+Reload, Prime+Probe)

MS - Advanced

Definition: High-precision CPU cycle counting methodologies using RDTSC/RDTSCP instructions to measure nanosecond memory access latency, determining whether target memory addresses reside in cache or DRAM.

Security & Hardware Application: The universal measurement oracle powering microarchitectural exploitation; enables non-invasive reconstruction of AES S-boxes and RSA private keys from shared crypto libraries.

← Back to 9-Layer Systems Architecture HEXDEF SYSTEMS ARCHITECTURE TAXONOMY