Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
Need Forum Guidance? Click here

Search our FPGA Knowledge Articles here.
19194 Discussions

Multiplication using file I/O

gazel
Beginner
364 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
346 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

 

gazel
Beginner
343 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.

EricMunYew_C_Intel
Moderator
291 Views

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


Reply