+ Post New Thread
Results 1 to 12 of 12

28th November 2019, 07:05 #1
 Join Date
 Jan 2016
 Posts
 86
 Helped
 0 / 0
 Points
 1,162
 Level
 7
Solve Equations Verilog
Dear all,
I am trying to solve equation of a^72a^5a^2 = 1. How can one implement this in verilog with minimum hardware?
TIA

28th November 2019, 10:56 #2
 Join Date
 Jun 2010
 Posts
 6,909
 Helped
 2030 / 2030
 Points
 38,153
 Level
 47
Re: Solve Equations Verilog
A text editor will do. Vi will run on any linux, so you could probably just use a rasberry PI. You'll probably need some kind of screen and a keyboard.

Advertisement

28th November 2019, 15:02 #3
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 46,057
 Helped
 14007 / 14007
 Points
 263,617
 Level
 100
Re: Solve Equations Verilog
The point is that the equation has no variable input, thus it can be calculated at compilation time and doesn't infer hardware.
The equation has however multiple (three or so) solutions, I'm not quite sure how you want to present it.
If you have a meaningful Verilog problem in mind, please share.

9th December 2019, 06:04 #4
 Join Date
 Jan 2016
 Posts
 86
 Helped
 0 / 0
 Points
 1,162
 Level
 7
Re: Solve Equations Verilog
So i basically start with an initial guess for variable 'a'. Then i try to compute the equation substituting my initial guess for 'a'. The problem is, 'a' can take a decimal value. As in, if a = 2.187, then, how can one compute 2.187^7 2*2.187^52.187^2 +1 in verilog?

9th December 2019, 06:09 #5
 Join Date
 Jan 2016
 Posts
 86
 Helped
 0 / 0
 Points
 1,162
 Level
 7
Computing exponential in verilog
Dear all,
I have been trying to use exponential function in verilog. I want to calculate an expression like below.
Let x = 3.987
x^6 + x^8 x^5 = 10.
How can this be done in verilog?
TIALast edited by FvM; 9th December 2019 at 09:12. Reason: Merged with previous closely related thread

Advertisement

9th December 2019, 09:11 #6
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 46,057
 Helped
 14007 / 14007
 Points
 263,617
 Level
 100
Re: Solve Equations Verilog
It's power of n, not exponential function and can be calculated as cascaded multiply.
What do you want to achieve? The equation has multiple solutions, but can be calculated at compile time.

9th December 2019, 15:23 #7
 Join Date
 Dec 2017
 Location
 Bydgoszcz  Poland
 Posts
 168
 Helped
 21 / 21
 Points
 1,272
 Level
 8
Re: Solve Equations Verilog
Hello,
maybe first famiiarize yourself with one of methods for approximation solving of nonlinear equations  for example Nwewton's method. See links:
https://en.wikipedia.org/wiki/Newton%27s_method
https://www.sciencedirect.com/scienc...10256X1300028X
After you read these descriptions and understood them, you could try to implement one of these method in Verilog.
Regards
BTW: this equotation is contrary and has not solutions ! Substitute 1 for a variable and check it yourself.
See: 1^72*1^51^2 = 1
121 =1
2=1 > equotqtions is contrary and has no solutions!Last edited by FlyingDutch; 9th December 2019 at 15:43.

9th December 2019, 15:29 #8
 Join Date
 Jan 2019
 Posts
 489
 Helped
 126 / 126
 Points
 2,677
 Level
 12
Re: Solve Equations Verilog
in post 1, its a^7, in post its x^6 ?
the number of roots is equal to the highest exponent, so 7 roots and 6 roots, receptively
if all you want is a solution, then use Wolfram Alpha
type in something like "what are the roots of a^72a^5a^2 = 1"
enter, and wait a little while
when i did it, Wolfram Alpha provided 3 real roots and 4 more roots as complex conjugates
it took about 10 seconds
side issue: exponentials involve the base of the natural logs, such as e^x,
or the base of the common logs, such as 10^x
the variable is in the exponent
these equations are polynomials  the exponents are integersLast edited by wwfeldman; 9th December 2019 at 15:34.

9th December 2019, 18:27 #9
 Join Date
 Dec 2017
 Location
 Bydgoszcz  Poland
 Posts
 168
 Helped
 21 / 21
 Points
 1,272
 Level
 8
Re: Solve Equations Verilog
[QUOTE=FlyingDutch;1668043]
BTW: this equotation is contrary and has not solutions ! Substitute 1 for a variable and check it yourself.
See: 1^72*1^51^2 = 1
121 =1
2=1 > equotqtions is contrary and has no solutions![/QUOTE
Sorry English is not my mother tounge. It shouyld be: contradictory equotation
There is no point to solving these eqotation because it is contradictory, and has no solution.
Maybe you made mistake during writing this equotation if yes please give proper form of this eqotqtion.
Regards

9th December 2019, 23:16 #10
 Join Date
 Jan 2008
 Location
 Bochum, Germany
 Posts
 46,057
 Helped
 14007 / 14007
 Points
 263,617
 Level
 100
Re: Solve Equations Verilog
this equotation is contrary and has not solutions ! Substitute 1 for a variable and check it yourself.
Post #1 suggests that you want to synthesize hardware logic to perform the calculation. But this is neither useful nor simple.
Firstly it's not useful because the solution is constant and can be calculated at compile time. You can however define a different problem involving variable coefficients as input. Then there's something to calculate at run time.
Secondly it's not simple because real variables aren't synthesisable in logic hardware. You can use either fixed or floating point variables for the calculation.

Advertisement

10th December 2019, 03:19 #11
 Join Date
 Sep 2013
 Location
 USA
 Posts
 7,398
 Helped
 1734 / 1734
 Points
 31,974
 Level
 43
Re: Solve Equations Verilog
I wonder if the OP wants to create an iterative algorithm to compute the real roots of a polynomial, i.e. enter the polynomial and the design computes the root(s).
One of the issues they seem to be struggling with is that A**B in verilog can't be synthesized unless B is a power of 2 (as that is just a shift operation). To implement an exponentiation of A you have to multiply A (B1) times using an FSM for example.

10th December 2019, 08:02 #12
+ Post New Thread
Please login