Integers which are more than 32 bit

Discussion in 'VHDL' started by bipper, Mar 19, 2014.

  1. bipper

    bipper Guest

    Hello everyone..

    I have a top module which has an output in std_logic_vector format of 81 bits. In the test bench code I want to write this output vector
    (of size 81 bits) into a text file in integer format. But due to the 32 bit size limit of integers its not working. Any round ways to achieve this?

    bipper, Mar 19, 2014
    1. Advertisements

  2. If I where to write these vectors into a text file, being lazy, I would
    choose to write them hexadecimally. That is quite easy by looping over the
    vector in steps of four (after making the length dividable by four) and
    spewing out the nibbles.

    If you really want to write out in integer format, you could convert the
    binary string into BDC (binary coded decimal) and then print the nibbles,
    which are now the decimal digits.

    For the binary to BCD conversion, look at the double dabble algorithm:
    Paul Uiterlinden, Mar 20, 2014
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.