Forum Discussion
Altera_Forum
Honored Contributor
10 years ago --- Quote Start --- I was under the conception that HDL is for designing chips or hardware itself, so what's the point to make a book with no synthesizable coding in HDL in the first instance. I can understand it for Test Benchs because they won't become a chip ever. Updating: If direct verilog isn't correct for doing this kind of operation, would it be a better way to design a kind of processor, with registers, stacks, simple add and subs? I know I could easily do this equation in Assembly. --- Quote End --- You're entering the hardware world. So forget everything you know about programming and assembler. Their concepts and coding style will give you poor results in HDL (if they work at all). You need to start from scratch - learn about basic componenets (rams, registers, gates etc) and DRAW out your intended circuit on a peice of paper. Only then can you transcribe it into HDL. Verilog has a problem because it looks like C, so many people think it must be written in a similar fashion. This is a dangerous trap (as you're finding). As you're starting from scratch, you may be better off learning VHDL instead (as it is nothing like C). I have no knowledge of the book you're talking about - but if it did work it would give very poor performance - loops like the one above unroll into sequential logic, which will give a terrible FMax (maybe 20Mhz if you're lucky). Also, floating point is rubbish in FPGAs as it requires large amounts of logic and lots of pipelining (latency). FPGAs are built to suit integer (fixed point) arithmatic. Is there any reason why you want floating and not fixed? "direct verilog" as you put it would be perfectly suited to your application - just not with the code you've used above. I suggest using the floating point IP provided by altera.