Integers which are more than 32 bit

B

bipper

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..
 
P

Paul Uiterlinden

bipper said:
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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top