COMP 3050讲解、program程序辅导、辅导CSS,Python,Java编程语言

2021-05-27 COMP 3050讲解、program程序辅导、辅导CSS,Python,Java编程语言
COMP 3050 Computer ArchitectureHomework #1/2 Summer, 2021• This assignment is due no later than midnight (11:59:59 PM) May 26.• Your submission must be made electronically using the submit command as described below.• File 1: A short write-up that first specifies what you think your degree of success with aproject is (from 0% to 100%), followed by a brief discussion of your approach to the projectalong with a detailed description of any problems that you were not able to resolve for thisproject. Failure to specifically provide this information will result in a 0 grade on yourassignment. If you do not disclose problems in your write-up and problems are detectedwhen your program is tested, you will receive a grade of 0. Make sure that you includeyour email address in your write-up so that the corrector can email you your grade.• File(s) 2(a, b, c, …): Your complete source code, in one or more .c and/or .h files• File 3: A make file to build your assignment. This file must be named Makefile. You shouldbe familiar with makefiles from the prerequisite courses. If you are not, google it. The firstfew hits will be tutorials, including those at Colby.edu and pitt.edu.• File 4: A file that includes your resulting output run(s) from your project. This is a simpletext file that shows your output, but make sure that you annotate it so that it is self-descriptiveand that all detailed output is well identified.• The files described above should be the only files placed in one of your subdirectories, and thissubdirectory should be the target of your submit command (see the on-line fileAssignment_Submit_Details.pdf for specific directions).• This problem requires you to add two positive only IEEE floating point numbers together byemulating the floating point hardware in software:1. You are only allowed to use the integer operations in C (i.e. shift, integer add, bitwise logicaloperators, etc.) to do the addition.2. You will need to scan in two floating point numbers into unions which allows access to themantissa, exponent and sign components as shown in class.3. Using the bit field components of the two numbers you must compute the result of their additionand rebuild a new floating point number which you can printf as output. As shown below, you mustinclude printed bit output which shows the steps you're using to complete the addition.• Your program interface must look like what follows between the two lines of asterisks. (What isbelow that second line of them are descriptive hints for you.)This program will emulate the addition of two IEEE 754 floating point numbersPlease enter two positive floating point values each with:- no more than 6 significant digits- a value between + 10**37 and 10**-37Enter Float 1: 34.5Enter Float 2: 1.250Original pattern of Float 1: 0 1000 0100 000 1010 0000 0000 0000 0000Original pattern of Float 2: 0 0111 1111 010 0000 0000 0000 0000 0000Bit pattern of result : 0 1000 0100 000 1111 0000 0000 0000 0000EMULATED FLOATING RESULT FROM PRINTF ==>>> 35.75HARDWARE FLOATING RESULT FROM PRINTF ==>>> 35.75To get the result of the addition constructed into the union for the exampleshown above you must:-COPY THE MASNTISSA PARTS INTO THEIR OWN HELPER INT VARIABLES AND-EXPOSE HIDDEN BITS INTO MANTISSA HELPER VARIABLES TO GET 24 BITS:Slam hidden bit into Float 1: 1000 1010 0000 0000 0000 0000Slam hidden bit into Float 2: 1010 0000 0000 0000 0000 0000-SHIFT MANTISSA OF SMALER VALUE FOR COMMON EXPONENT:Post shift pattern of mant. 1: 1000 1010 0000 0000 0000 0000Post shift pattern of mant. 2: 0000 0101 0000 0000 0000 0000-ADD AND ADJUST FINAL MANTISSA OF RESULT:Bit sums before adjustment: 1000 1111 0000 0000 0000 0000-SINCE HIDDEN BIT IS PERFECT FOR RESULT JUST REMOVE ITFinal 23 bit pattern for result: 000 1111 0000 0000 0000 0000-NOW PUT RESULT INTO THE MANTISSA BIT PART OF THE FINAL ANSWER-WITH COMMON EXPONENT AND CORRECT SIGN PLACED IN THEIR BIT FIELDSAND PRINT THE UNIT AS A FLOAT• You must generate output for at least the numbers that are found in this file on Blackboard:COMP3050_Assignment2_testdata.txt