Question: Can you help solve my errors Homewo Overview In this assignment modules will be completed that compute a 2 s + b > c where

Can you help solve my errors
Homewo Overview
In this assignment modules will be completed that compute a2s+b>c where inputs a and b are
real and inputs s and c are non-negative integers. Each module has an output gt, which should be
set to 1 if the comparison is true and 0 otherwise. There is also an output ssum which should be
set to a2s+b. What makes this interesting is that the sizes of all inputs are parameters, and that
in the instantiations tested the number of bits in the significands of a and b can be less than the
number of bits in c.
The floating point calculations and conversion(s) are to be done using Chipware modules.
Solving this assignment requires a straightforward application of Verilog techniques for instantiating
modules and wiring them together. It also requires an understanding of when and how to convert
numbers from floating-point to integer representations.
As of this writing two modules are to be completed, comp_fp and comp_int. In comp_fp the
greater-than comparison is to be done in floating point (using a Chipware module) and in comp_int
it is to be done using an integer comparison (using the > operator). file: actual: Fri Oct 420:04:572024
: hw02.v
assign ssum =(shifted_exp, a_sig)+ b_sig;
xmvlog: *E,EXPRPA (hw02.v,95|29): expecting a right parenthesis (')')[4.3][9.7(IEEE)].
assign ssum =(shifted_exp, a_sig)+ b_sig;
l
xmvlog: *E,MISEXX (hw02.v,95|36): expecting an '=' or '=' sign in an assignment [9.2(IEEE)].
assign ssum =(shifted_exp, a_sig)+ b_sig;
l
xmvlog: *E,EXPSMC (hw02.v,95|38): expecting a semicolon (';')[6.1(IEEE)].
module worklib.comp_fp:v
errors: 3, warnings: 0
comp_fp #(.w-c(w_c),.w_s(w_s),.w_exp(w_exp),.w_sig(w_sig),.w_sig2(w_sig2)
|
xmvlog: *E,EXPLPA (hw02.v,136|15): expecting a left parenthesis ('(')[7.2.3(AMSLRM)].
.sum(ssum),
|
xmvlog: *E,EXPRPA(hw02.v,137|6): expecting a right parenthesis (')')[12.1.2][8.6][7.1][7.15.1(IEEE)].
.gt(),
|
xmvlog: *E,EXPLPA (hw02.v,138|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
.a(a),
l
xmvlog: *E,EXPLPA (hw02.v,139|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
b(b),
|
xmvlog: *E,EXPLPA (hw02.v,140|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
.s(s),
l
xmvlog: *E,EXPLPA (hw02.v,141|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
.c(c),
xmvlog: *E,EXPLPA (hw02.v,142|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
;
|
xmvlog: *E,EXPLPA (hw02.v,143|6): expecting a left parenthesis ('(')[12.1.2][7.1(IEEE)].
module worklib.comp_int:v
errors: 8, warnings: 0
xrun: *E,VLGERR: An error occurred during parsing. Review the log file for errors with the code *E and fix those identified problems to proceed. Exiting
swith code (status 1).
TOOL: ,24.03-s005: Exiting on Oct 04,2024at20:04:57CDT(total: 00:00:00)////////////////////////////////////////////////////////////////////////////////////
/// Problem 1
//
/// Complete scaled_comp_fp so the comparison is done in FP.
//
//[] Use Chipware modules for floating-point operations and conversions.
//
//[] Make sure that the testbench does not report errors.
//[] Module must be synthesizable. Use command: genus -files syn.tcl
//
//[] Don't assume any particular parameter values.
//
//[] Code must be written clearly.
typedef enum logic [2:0]
{ Rnd_to_even =0, Rnd_to_0=1, Rnd_to_plus_inf =2,
Rnd_to_minus_inf =3, Rnd_to_near_up =4, Rnd_from_0=5}
Rnd;
module comp_fp
int w_fp =1+ w_exp + w_sig, w_fp2=1+ w_exp + w_sig2)
( output logic gt,
output logic [w_fp2-1:0] ssum,
input uwire [w_fp-1:0] a, b,
input uwire [w_s-1:0] s,
input uwire [w_c-1:0] c);
logic [w_sig2-1:0] a_sig, b_sig;
logic [w_exp-1:0] a_exp, b_exp;
assign a_sig ={a[w_sig-1:0],{w_sig2-w_sig{1'b0}}};
assign b_sig ={b[w_sig-1:0],{w_sig2-w_sig{1'b0}}};
assign a_exp = a[w_fp-1:w_sig];
logic [w_exp-1:0] shifted_exp;
assign shifted_exp = a_exp + s;
assign ssum =(shifted_exp, a_sig)+ b_sig;
//[] Convert a and b to FP values with w_sig2-bit significands.
//[] Compute a *2**s.
//[] Compute ssum = a*2**s + b;
//[] Compute gt = a *2**s + b >c;
//[] The greater-than comparison must be done as FP comparison.
assign ssum =0;
assign gt =1;
assign gt =(ssum > c)?1'b1 : 1'b0;
endmodule // Problem 2
/
/// Complete scaled_comp_int so the comparison is done as an int.
1
I [] Use Chipware modules for floating-point operations and conversions.
I/[] Make sure that the testbench does not report errors.
//[] Module must be synthesizable. Use command: genus -files syn.tcl
[] Don't assume any particular parameter values.
[] Code must be written clearly.
module comp_int
#( int w_c =5, w_s =2, w_exp =5, w_sig
Can you help solve my errors Homewo Overview In

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!