[sv-bc] Enum value question

From: Andy Tsay <andytsay@yahoo.com>
Date: Mon Jun 14 2004 - 16:58:36 PDT

Hi,

What is the value of 'yellow' in the following example?
module test(output [1:0] out);
  typedef enum bit [1:0] { red=2'b01, green=2'b11, yellow} Colors;
  assign out = red;
endmodule

The section '3.10 Enumerations' seems to say 'yellow' is assigned
with an automatically incremented value after 'green'.
Does 'yellow' get 2'b00 without error
or 3'b100 with error?

Thanks,
Andy Tsay
Received on Mon Jun 14 16:58:39 2004

This archive was generated by hypermail 2.1.8 : Mon Jun 14 2004 - 16:58:48 PDT