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

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
    • Covergroup and Coverpoint Puzzles
      • Auto vs explicit bins with illegal transition context
      • Default bin denominator puzzle
      • Bin array math with mixed declarations
      • Transition bin sequence counting
      • illegal_bins vs ignore_bins accounting
      • Same traffic, different denominator
    • Cross Coverage Puzzles
    • Coverage Options Puzzles
    • Coverage Closure and Sampling Timing Puzzles
    • Functional Coverage Puzzles: Tricky Q&A
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Covergroup and Coverpoint Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Functional Coverage Puzzles
  4. Covergroup and Coverpoint Puzzles
  5. Bin array math with mixed declarations

VLSI DV Interview Puzzles · All levels

Bin array math with mixed declarations

Compute total bin count and final percentage for this coverpoint with array bins and scalar bins.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 3 of 6 · Topic: Covergroup and Coverpoint Puzzles

    Compute total bin count and final percentage for this coverpoint with array bins and scalar bins.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    covergroup cg with function sample(bit [4:0] len);
      cp_len: coverpoint len {
        bins small[4] = {[0:15]};
        bins med      = {[16:23]};
        bins big[]    = {[24:31]};
      }
    endgroup
    
    initial begin
      cg c = new();
      c.sample(0);
      c.sample(7);
      c.sample(12);
      c.sample(18);
      c.sample(24);
      c.sample(26);
      c.sample(31);
    end

    Hint

    small[4] gives 4 bins over 0..15, while big[] over 24..31 creates one bin per value.

    Step-by-step solution

    Diagram
    1) small[4] contributes 4 bins, med contributes 1, big[] contributes 8 -> total 13 bins.
    2) Hits: small bins hit by 0,7,12 -> 3 of 4; med hit by 18 -> 1 of 1; big bins hit by 24,26,31 -> 3 of 8.
    3) Total hit bins = 3 + 1 + 3 = 7.
    4) Coverage = 7/13 = 53.85%.

    Answer

    Answer: Total bins = 13, hit bins = 7, so coverage is 53.85%.

    Why candidates get it wrong

    Many candidates treat big[] as one aggregated bin. Unsized array bins over a range create one bin per value.

    Interviewer follow-up

    If big[] were changed to bins big = {[24:31]}, what would the new percentage be with the same samples?

    Related topics

    • Back to Covergroup and Coverpoint Puzzles

    • Functional Coverage Puzzles section

    Previous

    132 / 210

    Next: Transition bin sequence counting

    Up next

    Up nextTransition bin sequence counting

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Auto vs explicit bins with illegal transition context
    • illegal_bins vs ignore_bins accounting
    • Same traffic, different denominator