diff --git a/README.md b/README.md index 83392f6c14d5377307e67262d02e385b0413ed7c..96912f945c4684eb76885b0ce93e81497df56bb3 100644 --- a/README.md +++ b/README.md @@ -327,4 +327,16 @@ - Unsolved content - problem of bitwise operator. - printf is a fobidden function. - - some macros are forbidden. \ No newline at end of file + - some macros are forbidden. + +# Dynamic Test(fx_s3132) + +## Code Coverage + - One of the indicators of how much testing is sufficient when discussing software testing. + +## Project Coverage (60% -> 100%) +### Before + + +### After + diff --git a/testing/image/testing 1.png b/image/4.png similarity index 100% rename from testing/image/testing 1.png rename to image/4.png diff --git a/testing/image/testing 2.png b/image/5.png similarity index 100% rename from testing/image/testing 2.png rename to image/5.png diff --git a/testing/report.pdf b/testing.pdf/report.pdf similarity index 100% rename from testing/report.pdf rename to testing.pdf/report.pdf diff --git a/testing/reportafter.pdf b/testing.pdf/reportafter.pdf similarity index 100% rename from testing/reportafter.pdf rename to testing.pdf/reportafter.pdf diff --git a/testing/README.md b/testing/README.md deleted file mode 100644 index bcc9e8f3608f7bf52187ad52e5d6eeee3fd27367..0000000000000000000000000000000000000000 --- a/testing/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# Requirements Specification(fx_s3132) - -## 1. introduction -### - 1.1 purpose -- 1.1.1 basic purpose - - This product is a kind of calculator that performs various operations related to fixed point number. - - For fixed-point arithmetic, c langauge's math library and type conversion are required. - - in iteration2, with using shift operation can create a variety of functions that perform differently under different conditions. - -### - 1.2 concept -- 1.1.2 basic concept - - To operate several calculation for fixed-point numebr type casting is essential. - - Correct type conversion is very important in order to accurately calculate and avoid missing bits. -- 1.1.3 concept of fixed-point number - -  - - a. data types in computer langauge always have fixed length - - b. in fixed point decimal point position of specific number should be fixed - - c. mean of s3132 - - s(sign) / 31(interger) / 32(decimal point) - - first s bit is used for number's sign (+ or -) - - second 31bits are used to represent interger part - - third 32bits are used to represent decimal - -## 2. overall description -### - 2.1 product functions -- 2.1.1 list of fuctions - - 2.1.1.1 iteration 1 - - a. add - ~~~ - #define fx_add(a, b) ((a)+(b)) - ~~~ - - to add two fixed point numbers there is no need to conversion of data type - - just add two fixed point numbers and return result - - b. sub - ~~~ - #define fx_sub(a, b) ((a)-(b)) - ~~~ - - to sub one fixed point number from another fixed point number there is no need to conversion of data type. - - just operate function without conversion of data type and return result - - c. mul - ~~~ - #define fx_mul(a, b) double_to_fx(fx_to_double (a) * fx_to_double (b)) - ~~~ - - to mul two fixed pouint number shoul do type conversion - - first convert two fixed point number to double type and do mul operation - - second result calculated from first step should be converted to fixed point number(type conversion) - - d. div - ~~~ - #define fx_div(a, b) double_to_fx(fx_to_double (a) / fx_to_double (b)) - ~~~ - - to div two fixed pouint number shoul do type conversion - - first convert two fixed point number to double type and do div operation - - second result calculated from first step should be converted to fixed point number(type conversion) - - e. fixed -> double - ~~~ - #define fx_to_double(a) (a/P2_2to32) - ~~~ - - to convert fixed point to double should divide fixed point number by 2^32(s31(32)=>decimal part bits) - - f. double -> fixed - ~~~ - #define double_to_fx(a) (long long)(a*P2_2to32) - ~~~ - - to convert double to fixed point should multiply double number and 2^32(s31(32)=>decimal part bits) - - h. sine - ~~~ - #define fx_sin(a) double_to_fx(sin(fx_to_double(a))) - ~~~ - - to convert fixed point number to sine value there is need to type conversion - - first convert fixed number to double - - second do sine operation with math library - - thrid conver result calculated by second step to double and return result - - i. power - ~~~ - #define fx_power(a, b) double_to_fx(pow(fx_to_double(a), fx_to_double(b))) - ~~~ - - to do power operation with fixed point number there is need to type conversion - - first convert fixed number to double - - second do sqrt operation with math library - - thrid conver result calculated by second step to double and return result - - j. sqrt - ~~~ - #define fx_sqrt(a) double_to_fx(sqrt(fx_to_double(a))) - ~~~ - - to do sqrt operation with fixed point number there is need to type conversion - - first convert fixed number to double - - second do sqrt operation with math library - - thrid conver result calculated by second step to double and return result - - 2.1.1.2 iteration 2 - - a. mul - ~~~ - ((fa * fb) >> FX32_QNUM ) - ~~~ - - fuction that multiplies fa and fb and divides it by 2^32 - - b. mul1 - ~~~ - ((fa>>16) * fb)>>16) - ~~~ - - Same as fx32_mul, the same fuction as fa*fb>>32, first multiply fa/2^16 and fb, and divide the remaining 2^16 - - c. mul2 - ~~~ - (((fa>>8)*(fb>>8))>>16) - ~~~ - - Same as above, the same fuction as fa*fb>>32, first multiply fa/2^8, fb/2^8, and divide the remaining 2^16 - - d. div - ~~~ - ((((fixed64)(fa) << FX32_QNUM) /(fb))) - ~~~ - - fuction that multiplies fa by 2^32 and divides fb. - - e. div1 - ~~~ - ((((fa)<<16)/(fb))<<16) - ~~~ - - Same as above, it has the same fuction as (fa<<32)/fb. First, fa is multiplied by 2^16 and divided by fb, and then the remaining 2^16 is multiplied - - f. div2 - ~~~ - ((((fa)<<24)/(fb))<<8) - ~~~ - - same as above, it has the same fuction as (fa<<32)/fb. First, fa is multiplied by 2^24, divided by fb, and then the remaining 2^8 is multiplied. - -# Dynamic Test(fx_s3132) - -## Code Coverage - - One of the indicators of how much testing is sufficient when discussing software testing. - -## Project Coverage (60% -> 100%) -### Before - - -### After - \ No newline at end of file