|
|
|
|
|
by amavect
64 days ago
|
|
00 -> 0.0
01 -> +1.0
10 -> NaN
11 -> -1.0
Arithmetic: 0.0 + x = x
NaN + x = NaN
+1.0 + -1.0 = 0.0
+1.0 + +1.0 = NaN
-1.0 + -1.0 = NaN
-0.0 = 0.0
-(+1.0) = -1.0
-(-1.0) = +1.0
-NaN = NaN
x - y = x + (-y)
NaN * x = NaN
+1.0 * x = x
-1.0 * x = -x
0.0 * 0.0 = 0.0
/0.0 = NaN
/+1.0 = +1.0
/-1.0 = -1.0
/NaN = NaN
x / y = x * (/y)
More interestingly, how to implement in logic gates. Addition with a 2's complement full adder and NaN detector. Negation with a 2's complement negation circuit. Reciprocal with a 0.0 detector.Multiplication with a unique logic circuit (use a Karnaugh map): (ab * cd) = (a&~b | c&~d | ~a&b&c | a&~c&d)(b & d)
|
|