4 ms·
While I am not an expert on FPGA design, I believe Figures 1 and 2 are slightly exaggerated. The C program is very ad-hoc (returning a double from main is actua
by jbangert 14y ago
While I am not an expert on FPGA design, I believe Figures 1 and 2 are slightly exaggerated. The C program is very ad-hoc (returning a double from main is actually illegal and will lead to interesting results) and avoids all I/O, whereas the Verilog program seems to be quite complicated (in particular with the use of ready flags and clocks). Please correct me if I am wrong, but couldn't the authors just have used a continuous assignment (or maybe a simple clock) for their conversion? Also, don't newer verilogs support specifying IEEE floating point numbers in their natural form, as opposed to having to manually convert them to hex? This seems a little like catching attention and potentially trying to make the alternative products (SystemVerilog, etc.) look nicer.
- deleted 14y ago[deleted]
- deleted 14y ago[deleted]
- knz42 14y ago" it's valid for C code to define the main() function as something other than int." It's a bit more complicated than that. True, C defines two environments called "freestanding" (without OS) and "hosted" (with OS). As per the ISO specification (sect. 5.1.2.2.1 for both 9899:1999 and :2011), main() must return int for hosted implementations, whereas anything goes in freestanding. Meanwhile, while it is true that most embedded systems are indeed "freestanding" as per the C standard, an increasing number is not. So one needs to be careful about these things.