Question: Can you help me solve the coding problems for this homework. If test bench code is needed I can provide. ( The remaining parameters, w

Can you help me solve the coding problems for this homework. If test bench code is needed I can provide.
(The remaining parameters, w_fp and w_fp2, are set to the full size of the two
FP formats used, don't change them.) Inputs a and b format
with a w_exp-bit exponent and a w_sig-bit significand. The total size of each of these inputs is
1+w?exp+w_sig bits. (The custom format is recognized by the Chipware modules.) The value on
input c is a w_c-bit unsigned integer. The value on output ssum is expected to be a IEEE-format
FP number with a w_exp-bit exponent and w_sig2-bit significand.
The output ssum (scaled sum) is to be set to a2s+b and output gt is to be set to 1 if a2s+b>c
and 0 otherwise.
For this problem one should review the IEEE 754 notes, plus the use of the Verilog concate-
nation (like {2'(b)11,a,4'd0}), shift (a2), and bit slice (a[6:1]) operators.
(a) Modify comp_fp so that it computes a2s without using Chipware modules. The value does not
have to be assigned to any particular object, but it should be used to compute a2s+b. To solve
this subproblem one must understand the IEEE 754 format. A correct solution requires just a line
or two of Verilog code. (Just one line if overflow is ignored, which is okay.)
Compute a2s without Chipware modules.
(b) Modify comp_fp so that ssum is set to a2s+b.(For partial credit, or to get started quickly
set ssum to a+b. If this is done correctly the testbench s=0 tests should show zero ss errors.)
Compute the sum using Chipware modules and the value of a2s from the previous part.
Note that a and b have a w_sig-bit significand, but the sum should have a w_sig2-bit signif-
icand. So, the significands of a2s and b must be lengthened (assume that w_sig2> w_sig). See
the description of the IEEE 754 format. Please don't look for a module to do this for you.
Convert a2s and b into FP types with a w_sig2-bit significand.
Using the value from the previous part, set ssum to a2s+b.
(c) Modify comp_fp so that gt is correctly set using a floating-point comparison. Don't forget that
input c carries an unsigned integer so that to do a FP comparison c will need to be converted.
Set gt.
Use Chipware modules for floating-point computation and floating-point/integer conversion.
Use procedural or implicit structural (assign) code for any integer computation.
Pay attention to cost: don't use more bits than are needed.
The modules must be synthesizable.
Problem 2: Module comp_int has the same connections as comp_fp and its outputs should be
set to the same values.
(a) Modify comp_int so that it computes ssum using an instantiation of comp_fp. The ssum output
the comp_fp instance should connect to the ssum output of comp_int. Don't use the gt output
of comp_fp so that the synthesis program doesn't synthesize comp_fp hardware for gt.
Compute ssum using an instance of comp_fp a2^(s)+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
wirithem tIt also requires an understanding of when and how to convert
two modules are to be completed, comp_fp and coe
greater-than comparison is to be done in floating point (using a Chipware module and in comp_ using an integer c Compute gt using an integer co //
Can you help me solve the coding problems for

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!