# Transition coverbins

**URL:** <https://verificationacademy.com/forums/t/transition-coverbins/38303>\
**Category:** SystemVerilog\
**Tags:** covergroup, SystemVerilog, coverage-transition-bins\
**Created:** [November 4, 2020, 6:20pm UTC](https://verificationacademy.com/forums/t/transition-coverbins/38303 "2020-11-04T18:20:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Suman\_Valsange](https://verificationacademy.com/forums/letter_avatar_proxy/v4/letter/s/7ea924/32.png) [@Suman\_Valsange](https://verificationacademy.com/forums/u/Suman_Valsange)\
**Post date:** [November 4, 2020, 6:20pm UTC](https://verificationacademy.com/forums/t/transition-coverbins/38303/1 "2020-11-04T18:20:53Z")

</div>

Hi, I am trying to cover a scenario using transition bins(using 2 variables) and wanted to know if the code written below works  
With the change in the value of either a or b, will the bins get a hit?

```verilog
bit[1:0] a;
  int b;

  covergroup check@(a or b)
  option.per_instance =1;
  cover_point_a : coverpoint a {
	           bins low = ((2'b00 && (b==32'd10)) => (2'b01 && (b==32'd20)));
                   bins medium = ((2'b00 && (b==32'd10)) => (2'b10 && (b==32'd30)));
                   bins high = ((2'b00 && (b==32'd10)) => (2'b11 && (b==32'd40)));
                   }

```

---

<div class="post-metadata">

**Author:** ![dave\_59](https://verificationacademy.com/forums/user_avatar/verificationacademy.com/dave_59/32/4499_2.png) [@dave\_59](https://verificationacademy.com/forums/u/dave_59)\
**Post date:** [November 7, 2020, 6:48am UTC](https://verificationacademy.com/forums/t/transition-coverbins/38303/2 "2020-11-07T06:48:56Z")

</div>

_In reply to [Suman Valsange](https://verificationacademy.com/forums/t/transition-coverbins/38303):_

You haven’t explained what “works” means, but it most likely does not.

@(a or b) is not a good sampling event, you should be using a clock or an explicit call to sample(). If a and b both change at the same time, there’s no guarantee if you get one or two sample events.

Bins are constructed when the covergroup gets constructed, so the value of b is most likely 0 at that time. so your transition bins get evaluated as 0 =\> 0, which is not a transition,
