forked from alan-minchan-kim/ca-pa2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpa2.c
77 lines (41 loc) · 1.03 KB
/
pa2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//---------------------------------------------------------------
//
// 4190.308 Computer Architecture (Fall 2021)
//
// Project #2: FP10 (10-bit floating point) Representation
//
// October 5, 2021
//
// Jaehoon Shim (mattjs@snu.ac.kr)
// Ikjoon Son (ikjoon.son@snu.ac.kr)
// Seongyeop Jeong (seongyeop.jeong@snu.ac.kr)
// Systems Software & Architecture Laboratory
// Dept. of Computer Science and Engineering
// Seoul National University
//
//---------------------------------------------------------------
#include "pa2.h"
/* Convert 32-bit signed integer to 10-bit floating point */
fp10 int_fp10(int n)
{
/* TODO */
return 1;
}
/* Convert 10-bit floating point to 32-bit signed integer */
int fp10_int(fp10 x)
{
/* TODO */
return 1;
}
/* Convert 32-bit single-precision floating point to 10-bit floating point */
fp10 float_fp10(float f)
{
/* TODO */
return 1;
}
/* Convert 10-bit floating point to 32-bit single-precision floating point */
float fp10_float(fp10 x)
{
/* TODO */
return 1.0;
}