In VHDL, if I take create a type like this
type example is (
ex_0,
ex_1,
ex_2,
ex_3
);
signal example_signal : example
Then ex_0 would synthesize to something like '00', ex_1 to '01' , ex_2 to '10', and ex_3 to '11'. Maybe it'd be gray code but I don't know.
Is there a way to assign each of those to a specific value? For example it would look something like
type example is (
ex_0 := '11',
ex_1 := '10',
ex_2 := '01',
ex_3 := '00'
);
signal example_signal : example
"1000"
,"0100"
,"0010"
,"0001"
) and optimize from there, especially for state machines this usually gives a fairly efficient representation. A more compact encoding needs to generate comparators in every place the value is used. \$\endgroup\$std_logic_vector
, I'd use a function with a case mapping. \$\endgroup\$