Skip to content
Snippets Groups Projects
Commit 990a2341 authored by baewoojin's avatar baewoojin
Browse files

Update README.md

parent 18e1f211
Branches
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@
- 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.
- in iteration2, with using shift operation can create a variety of functions that perform differently under different conditions.
- 1.1.3 concept of fixed-point number
- ![image](/uploads/0ae109d4300d11722c53531d1a9615ac/image.png)
- a. data types in computer langauge always have fixed length
......@@ -23,7 +24,7 @@
## 2. overall description
### - 2.1 product functions
- 2.1.1 list of fuctions
- 2.1.1.1 stpe 1
- 2.1.1.1 iteration 1
- a. add
~~~
#define fx_add(a, b) ((a)+(b))
......@@ -84,3 +85,34 @@
- 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.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment