Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
fx_s1615
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RealCoding2_Team1
fx_s1615
Commits
ce3ed85e
Commit
ce3ed85e
authored
4 years ago
by
최형택
Browse files
Options
Downloads
Patches
Plain Diff
Add TOC for README
parent
c0defab7
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+42
-10
42 additions, 10 deletions
README.md
with
42 additions
and
10 deletions
README.md
+
42
−
10
View file @
ce3ed85e
...
...
@@ -14,6 +14,38 @@ Sign bit를 포함한 fixed point number의 arithmetic 구현
| 최형택 | 201620989 |
<br>
## Table of Contents
-
[
What is Fixed Point sXXYY?
](
#what-is-fixed-point-sxxyy-
)
*
[
Example
](
#example
)
-
[
Fixed Point vs Floating Point
](
#fixed-point-vs-floating-point
)
-
[
How to Convert Fixed Point Binary to Decimal
](
#how-to-convert-fixed-point-binary-to-decimal
)
-
[
Fixed Point Arithmetic Library
](
#fixed-point-arithmetic-library
)
*
[
Project1
](
#project1
)
+
[
Macros
](
#macros
)
+
[
Functions
](
#functions
)
*
[
Makefile
](
#makefile
)
*
[
gcc -O flag
](
#gcc--o-flag
)
+
[
-O 옵션별 세부 사항
](
#-o----------
)
+
[
최적화 성능 비교
](
#---------
)
-
[
결과
](
#--
)
-
[
원인 분석
](
#-----
)
-
[
gprof 사용법
](
#gprof----
)
*
[
Project2
](
#project2
)
+
[
Macros
](
#macros-1
)
+
[
Functions
](
#functions-1
)
*
[
정확도 테스트
](
#-------
)
*
[
속도 테스트
](
#------
)
*
[
Sine
](
#sine
)
+
[
sine table
](
#sine-table
)
+
[
fx_s1615 sine_fx_s1615_longlong(fx_s1615 angle) function에 대하여...
](
#fx-s1615-sine-fx-s1615-longlong-fx-s1615-angle--function-----
)
*
[
double vs long long
](
#double-vs-long-long
)
-
[
0819 과제
](
#0819---
)
*
[
요구사항 명세
](
#-------
)
*
[
코딩 규칙 검사(MISRA-C 2012)
](
#---------misra-2012-
)
*
[
검사 결과 리포트
](
#---------
)
-
[
0820 과제
](
#0820---
)
## What is Fixed Point sXXYY?
sXXYY는 2진수로 실수를 표현하는 방법 중 하나다. (1 + XX + YY)개의 비트로 실수를 표현하며 1개 비트는 부호, XX개 비트는 정수부, YY개 비트는 소수부를 표현한다.
...
...
@@ -105,7 +137,7 @@ s1615를 10진수로 표현하는 방법은 간단하다.
#### Functions
*
`fx_s1615 sine_fx_s1615_int(fx_s1615 a)`
fx_s1615로 표현된 값의 sin 을 구해주는 함수
fx_s1615로 표현된 값의 sin
e
을 구해주는 함수
*
`fx_s1615 sqrt_fx_s1615_int(fx_s1615 a)`
...
...
@@ -263,7 +295,7 @@ gprof
#### Functions
*
`fx_s1615 sine_fx_s1615_longlong(fx_s1615 angle)`
fx_s1615로 표현된 각의 sin 을 구해주는 함수
fx_s1615로 표현된 각의 sin
e
을 구해주는 함수
...
...
@@ -341,14 +373,14 @@ DIV_03의 경우 오차율이 조금 증가하지만 범용적으로 사용할
<br>
<br>
### Sin
### Sin
e
####
s
in
t
able
angle 이 0도부터 90도까지인 경우, sin 값을 fx_s1516으로 표현한 SinTable이다.
불필요한 연산을 줄이고자 아래와 같은 SinTable을 사용하게 되었다.
####
S
in
e T
able
angle 이 0도부터 90도까지인 경우, sin
e
값을 fx_s1516으로 표현한 Sin
e
Table이다.
불필요한 연산을 줄이고자 아래와 같은 Sin
e
Table을 사용하게 되었다.
```
const static fx_s1615 fx_1615_SinTable[91] = {
const static fx_s1615 fx_1615_Sin
e
Table[91] = {
0, 571, 1143, 1714, 2285, 2855, 3425, 3993, 4560, 5126,
5690, 6252, 6812, 7371, 7927, 8480, 9032, 9580, 10125, 10668,
11207, 11743, 12275, 12803, 13327, 13848, 14364, 14876, 15383, 15886,
...
...
@@ -367,7 +399,7 @@ const static fx_s1615 fx_1615_SinTable[91] = {
#### fx_s1615 sine_fx_s1615_longlong(fx_s1615 angle) function에 대하여...
이 함수는 파라미터를 각도로 받아오는 경우, 해당하는 sin값을 찾아서 반환해주는 함수이다.
sin은 360도를 주기로 하는 함수이기 때문에, angle이 360도로 나누었을때의 나머지에 대한 값의 sin 값을 찾아주고자 하였다.
sin은 360도를 주기로 하는 함수이기 때문에, angle이 360도로 나누었을때의 나머지에 대한 값의 sin
e
값을 찾아주고자 하였다.
```
idx = angle >> 15;
...
...
@@ -464,7 +496,7 @@ double로 input을 받아서 fx_s1615로 변환하여 사칙연산을 수행한
| FX_S1615_MUL(a,b) | fx_s1615로 표현된 두 값을 곱해준다. | |
| FX_S1615_DIV(a,b) | fx_s1615로 표현된 두 값을 나눠준다. | |
| ---- | ---- | ---- |
| fx_s1615 sine_fx_s1615_int(fx_s1615 a) | fx_s1615로 표현된 값의 sin 을 구해준다. | |
| fx_s1615 sine_fx_s1615_int(fx_s1615 a) | fx_s1615로 표현된 값의 sin
e
을 구해준다. | |
| fx_s1615 sqrt_fx_s1615_int(fx_s1615 a) | fx_s1615로 표현된 값의 제곱근을 구해준다. | |
| fx_s1615 power_fx_s1615_int(fx_s1615 a, double n) | fx_s1615로 표현된 값의 n승을 구해준다. | |
| ---- | ---- | ---- |
...
...
@@ -507,7 +539,7 @@ double로 input을 받아서 fx_s1615로 변환하여 사칙연산을 수행한
<br>
### 코딩 규칙 검사(MISRA 2012)
### 코딩 규칙 검사(MISRA
-C
2012)
총 39였던 오류를 아래의 20개의 오류로 수정하였다.
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment