Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • Start Here6
  • SystemVerilog Language Foundations28
    • SystemVerilog Data Types
      • 4-State vs 2-State Types
      • Nets vs Variables
      • Integer Types & Casting
      • Enums, Structs & Unions
      • Strings, Reals & Special Types
    • Arrays: Packed, Dynamic, Queues & Associative
    • Procedural Code & Scheduling
    • Operators, Expressions & Width Rules
    • Packages, Typedefs & Compilation
    • Interfaces, Modports & Clocking Blocks
  • Object-Oriented SystemVerilog for Verification30
  • Constraint Randomization — Interview-Critical Deep Dive36
  • SystemVerilog Assertions — Interview-Critical Deep Dive40
  • Functional Coverage in SystemVerilog22
  • Testbench Architecture in SystemVerilog23
  • Advanced Language & Integration25
  • Senior & Interview Preparation21
  • Principal-Level Verification28
Loading lesson

‹SystemVerilog Language Foundations
  1. Topics
  2. SystemVerilog
  3. SystemVerilog Language Foundations
  4. SystemVerilog Data Types

Part 1 · Language Foundations · Intermediate

SystemVerilog Data Types

How 4-state and 2-state types, nets, casting, and composite types fit together.

  • 5topics
  • 5lessons

Every declaration answers two questions: can this bit hold X or Z, and is its value resolved from drivers or stored. The five lessons below turn those answers into habits for ports, casts, and testbench types.

Two questions pick the type: must the value show X and Z, and how many things drive it.

Lesson

What it covers

4-State vs 2-State Types

X and Z modelling, the 2-state discount, the guarded boundary, and X tracing.

Nets vs Variables

Resolution against storage, one-driver logic, and buses that still need wires.

Integer Types & Casting

Widths, signedness, the three casts, and silent truncation rules.

Enums, Structs & Unions

Named states, shaped vectors, shared storage, and checked conversions.

Strings, Reals & Special Types

Dynamic text, testbench reals, opaque handles, and event sync.

Check yourself Testbench code copies a DUT bus into a 2-state variable and the checking code sees clean zeros. Where did the X go?

The 4-state to 2-state copy mapped X to 0 silently. The first lesson guards that boundary with an explicit unknown check before the copy.

Interview

Expect questions that cross lesson lines: the reset value of bit versus logic, why logic cannot have two drivers, and what a suspicious zero in a checker suggests about an upstream X.

PreviousNext: 4-State vs 2-State Types

Up next

Up next4-State vs 2-State Types

Sign in to save progress

Practice this lessonReport an error

See also

  • Arrays: Packed, Dynamic, Queues & Associative
  • Procedural Code & Scheduling
  • Operators, Expressions & Width Rules