i want to create program that have expression -> (x divided ((y/100) squared))) {x and y = input}. this vhdl code will be implemented with FPGA-DE1 board. input consist binary number.. can you help me?
i want to create program that have expression -> (x divided ((y/100) squared))) {x and y = input}. this vhdl code will be implemented with FPGA-DE1 board. input consist binary number.. can you help me?
Post the code that you've written so far, including your testbench...then ask for help. Asking for help before you've expended even minimal effort, or explained why you are unable to expend such minimal effort, is showing that you're lazy.
A pretty good question. You can implement the code as written and it synthesizes to (basically) working hardware, as the RTL viewer shows
Code VHDL - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
entity test1 isport(
x :inintegerrange0to1023;
y :inintegerrange0to1023;
op :outintegerrange0to1023);endentity;architecture rtl of test1 isbegin
op <= x/((y/100)**2);end rtl;
Finding out what's possibly wrong with the solution would involve a considerable learning curve.
i want to create program that have expression -> (x divided ((y/100) squared))) {x and y = input}. this vhdl code will be implemented with FPGA-DE1 board. input consist binary number.. can you help me?
First, divisions should be avoided where possible. The (y/100) isn't needed, and the expression can become (10000 * x / (y**2)).
The first real question is how much precision is needed by the division by non-power of two. In fixed-point, you can have integral and fractional bits. eg, 6.25 becomes 0110.0100 . From there you should size the inputs/outputs/intermediates to ensure no overflow and sufficient precision.
The second question is performance. At what rate do you need to process new inputs? How much delay can you allow for processing.
The last question is area vs engineering time. If bandwidth/latency isn't a large concern, is there any value in trying to make a smaller implementation? In some cases this is critical, in others it wastes a large amount of development time for very little benefits.