Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16605 Discussions

reading interger digits independently

Altera_Forum
Honored Contributor II
1,217 Views

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
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
286 Views

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

 

Regards
0 Kudos
Altera_Forum
Honored Contributor II
286 Views

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.

0 Kudos
Reply