-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotes_20130205_csit2860.txt
More file actions
82 lines (64 loc) · 2.15 KB
/
Copy pathnotes_20130205_csit2860.txt
File metadata and controls
82 lines (64 loc) · 2.15 KB
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
78
79
80
81
82
February 05, 2013
CSIT 2260: Machine organization and architecture
Multiplication
--------------
Arithmetic shift-
when multiplying by powers of 2, shift numerals
to the left by however many powers of 2 you are
multiplying
e.g.
0100 = 4
x0010 = 2
-----
1000 = 8
Notice the one in 0100 was multiplied by one power of
2, hence the bit was moved once to the left- 1000
Otherwise, just add the multiplicand for each 1 bit in the
multiplier and shift the next addition to the left. For a 0
bit in the multiplier, just shift for the next addition.
e.g.
1011
x 1110
------
0 (1011 x 0) just shift to the left
10110 (1011 x 1) shift to the left
101100 (1011 x 1) shift to the left
+ 1011000 (1011 x 1) shift to the left
-------
10011010
Floating Point Representation
-----------------------------
floating point calculations can be performed with any integer format
floating point emulation is the calculation of floating point
numbers without actually storing them
Usually hardware, not special software, is used to do these
calculations.
floating point numbers
allow arbitrary number of decimal places to the right
Scientific notation:
Sign Mantissa Exponent
+/- x.xx X base^x
1 bit precision range
Mantissa = Significand
e.g.
0 00110 10000000 = 2^6 X 0.1 = 32
Because
0 00110 10000000 = 2^6 X 0.1 = 32
is the same as
0 00111 01000000 = 2^7 X 0.01 = 32
hence normalization- a rule stating the mantissa must always
start with 1.
biased exponent
number midway between the range expressible by
the exponent.
With a 5 bit exponent we use 16 as our bias- called
"excess- 16" representation.
e.g.
0 10110 10000000 = 2^(22-16) x 0.1 = 2^6 x 0.1
Class examples
-------------
+0.5 (base 10) = 0.1 (base 2) = 0.1 x 2^0 (i.e. 0.1 x 1)
0 10000 10000000 = 2^(16 - 16) x 0.1 = 2^0 x 0.1
-1.125 (base 10) = -1.001 (base 2) = 0.1001 x 2^1
1 10001 100100000 = - 2^(17 - 16) x 0.1001
3.576