Question: Can you help me solve these two problems by coding? real and inputs s and c are non - negative integers. Each module has an

Can you help me solve these two problems by coding?
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 inter Problem 1: Module comp_fp has two floating-point (FP) inputs, a and b, two integer inputs s
and c, one-bit output gt, and a FP output ssum; it also has integer parameters w_c, w_s, w_exp,
w_sig and w_sig2.(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 carry values in a custom IEEE 754 FP 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
of 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 esting 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).
Can you help me solve these two problems by

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!