Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21152 Discussions

Multiplication using file I/O

gazel
Beginner
1,231 Views

I was able to implement a multiplication circuit using high-level synthesis and display the calculation results on the screen using nios.
Now, I want to change the system to read the two numbers to be multiplied from a file and output the calculation results to another file.

We think it will mainly be a rewrite of test.c.
I know that I need to write FILE*fp; etc., but I would like to know in detail how to pass the numbers from the file to a and b, and how to output the calculation results to a file.

 

gazel_0-1629112227941.pnggazel_1-1629112268690.png

gazel_2-1629112337617.png

gazel_0-1629121492638.png

 

0 Kudos
3 Replies
gazel
Beginner
1,213 Views

Now that I have a better understanding of how to input files, I tried only outputting files and got this error.

gazel_1-1629124836870.png

 

0 Kudos
gazel
Beginner
1,210 Views

It seems that the on-chip memory is not large enough.

I want to do file I/O, so I can't use hello world small.

0 Kudos
EricMunYew_C_Intel
Moderator
1,158 Views

You can try fread and fscanf for file read, write.


0 Kudos
Reply