Forum Discussion
Altera_Forum
Honored Contributor
15 years agoVHDL - FSM Design
Hello, I've posted this on comp.lang.vhdl, but it seems to be overridden with spam these days, so I don't think anyone will see it. I'm learning about FSMs and I'm having a hard time getting my ...
Altera_Forum
Honored Contributor
15 years agox"123ABC" represents a string with hexedecimal represenation. It can be mapped easily to any array of bit or std_logic (bit_vector, std_logic_vector, unsigned, signed, ufxied, sfixed).
to_unsigned is a function that converts an integer into an unsigned type (which is an array of std_logic). VHDL is strongly typed, and so you have to be careful. PS. if you actually want a number in binary assigned to led, you can do this: led <= to_unsigned(2#000001000#, 9); The 2#N# tells the compiler the number between the hashes is in base 2. otherwise it defaults to base 10.