-6

How will this loop work in SystemVerilog language ?

for(bit [2:0] i = 0; i < 4; i++)

What will be the values of i after each iteration provided i is 3 bit wire ?

dave_59
  • 39,096
  • 3
  • 24
  • 63
Ishan Kumar
  • 23
  • 1
  • 8

1 Answers1

0
bit [2:0] i;

As i is 3-bit value, it can take values from 0-7.

so i will get values 0,1,2,3

Matthew Taylor
  • 13,365
  • 3
  • 17
  • 44
  • 1
    3 bit values can hold 0-7 – Jim Garrison May 09 '19 at 07:00
  • 1
    Welcome to Stack Overflow! Regarding the [first revision of your answer](https://stackoverflow.com/revisions/56053633/1), it looks like you're linking to your own website. You **must** disclose this fact in future, else your answer may be deleted as spam. Please take a moment to read Stack Overflow's [self-promotion policy](//stackoverflow.com/help/promotion). – Michael Dodd May 09 '19 at 07:30