Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

reading interger digits independently

Hi,

I would like to know if its possible to read digits of an integer independent of each other.... for example, say i have an integer with a value "100". is it possible to assign each digit of an integer to say maybe 3 variables.. first one loaded with '1', 2nd & 3rd loaded with '0's? how do i code it if its possible?

i hope im clear

Regards

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    found some info on the net n then wrote a code for converting Binary to BCD :)

    Regards
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The whole point with the type system in VHDL is that things like integer do not have individual bits that you can access. For doing that, use unsigned/signed types instead.