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?

    Thanks..
    bipper, Mar 19, 2014
    #1
    1. Advertising

  2. bipper wrote:

    > 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?


    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:
    https://en.wikipedia.org/wiki/Double_dabble

    --
    Paul Uiterlinden
    www.aimvalley.nl
    Paul Uiterlinden, Mar 20, 2014
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Weng Tianxiang
    Replies:
    36
    Views:
    3,413
    Brannon
    Jul 15, 2006
  2. Replies:
    1
    Views:
    320
    Tom Hawtin
    Jan 24, 2007
  3. seung

    using 64-bit integers on 32-bit machine

    seung, Sep 28, 2007, in forum: C Programming
    Replies:
    5
    Views:
    1,487
    David Thompson
    Oct 15, 2007
  4. Steven D'Aprano
    Replies:
    0
    Views:
    75
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    69
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page