From f969b02630679f4ccf0f2fce33e5174f5ae1fc78 Mon Sep 17 00:00:00 2001 From: EDiasAlberto Date: Tue, 15 Oct 2024 14:57:37 +0100 Subject: [PATCH] define fixed point arithmetic constants gitignore clion files --- .gitignore | 2 ++ src/threads/fixed-point.h | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/threads/fixed-point.h diff --git a/.gitignore b/.gitignore index 5d8d05c..a4fe502 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ *.nav *.toc +#ignore files from CLion IDE +.idea \ No newline at end of file diff --git a/src/threads/fixed-point.h b/src/threads/fixed-point.h new file mode 100644 index 0000000..201ccb4 --- /dev/null +++ b/src/threads/fixed-point.h @@ -0,0 +1,9 @@ +#ifndef FIXED_POINT_H +#define FIXED_POINT_H + +/* Fixed Point Arithmetic bit count constants */ +#define NUM_INT_BITS 11 +#define NUM_FRAC_BITS 20 +#define CONVERSION_CONST 1 << NUM_FRAC_BITS /* f = 2^q, (2^20) */ + +#endif //FIXED_POINT_H