Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

OE 3 0 2 0 1 T 2 3 2 Assignment # 3 Design and Implementation of a Quadratic Equation Solver in Verilog Objective: Your

OE30201 T232
Assignment #3
Design and Implementation of a Quadratic Equation Solver in Verilog
Objective:
Your task is to model a digital circuit using Verilog that solves quadratic equations. This circuit should be
capable of handling signed fixed-point numbers for its calculations. You will apply your knowledge of Verilog
coding and digital circuit design to create an efficient and accurate solver that adheres to the specifications
outlined below.
Parameters:
WIDTH: Specifies the width (in bits) of the fixed-point numbers used in this assignment.
SCALE: Specifies the number of bits used for the fractional part in the fixed-point representation.
Note: All fixed-point numbers used for this assignment must be signed.
Inputs:
reset: Resets the circuit to the initial state.
go: This input signal is used to initiate the reading of equation coefficients, a, b, and c.
din: A WIDTH-bit data input port through which the coefficients a, b, and c are sequentially read.
Outputs:
rdy: An output signal that indicates when the output (solution to the equation) is ready to be consumed.
dout: A WIDTH-bit data output port that serially outputs the solutions (real and imaginary parts) over
four consecutive clock cycles.
Algorithm:
1. rdy <=1
2. wait for +ve edge on go
3. a <= din; rdy <=0;
4. wait for +ve edge on go
5. b <= din
6. wait for +ve edge on go
7. c <= din
8. D <= b*b 4*a*c
9. if D ==0// simplest case --> Repeated real root
x0_r <=-b/(2*a); x0_i <=0;
x1_r <=-b/(2*a); x1_i <=0;
else if D>0// Two distinct real roots
s <= sqrt(D); // done in a separate clock cycle than the assignments below it
x0_r <=(-b+s)/(2*a); x0_i <=0;
x1_r <=(-b-s)/(2*a); x1_i <=0;
else
s <= sqrt(D); // done in a separate clock cycle than the assignments below it
x0_r <=(-b)/(2*a); x0_i <= s/(2*a);
x1_r <=(-b)/(2*a); x1_i <=s/(2*a);
end if
10. rdy <=1; dout <= x0_r;
11. dout <= x0_i;
12. dout <= x1_r;
13. dout <= x1_i; goto 2
Deliverables:
As part of your submission for the Quadratic Equation Sol

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David Kroenke

11th Edition

0132302675, 9780132302678

More Books

Students also viewed these Databases questions