Floating Point Representation
Floating Point Representation
HW
Real Numbers
21. 564.
Left
2.1 x 101
.21 x 102
.021 x 103
Right
21.
210.0 x 10-1
2100 x 10-2
2345
.2345 x 104
1101.
11.01 x 210
.1101 x 2100
Mantissa – Exponent
24 = ? FP Binary
11000.
.11000
Mantissa
0 1 1 0 0 0 0 0
Exponent
0 0 0 0 0 1 0 1
5–5=0
Day – 2
Positive Binary to FP Binary
Negative Binary to FP Binary
Positive Decimal to FP Binary
Negative Decimal to FP Binary
Positive FP Binary to Decimal
Negative FP Binary to Decimal
1011
.1011
0.1011000 00000100
100101
1.1001010 00000110
1099
10999
99
999
.324589
.3246
.32458900
Positive Decimal to FP Binary (8+ 8)
74 = FP Bin? (8+8)
128 64 32 16 8 4 2 1
0 1 0 0 1 0 1 0
0.1001010 00000111
31.25
11111
.25 x 2 = .5 = 0
.5 x 2 = 1 = 1
.01
0.1111101 00000101
31.75
11111.11
31.33 (8:8)
11111.0
.33 x 2 = .66 = 0
.66 x 2 = 1.3 = 1
.3 x 2 = .6 = 0
.6 x 2 = 1.2 = 1
.2 x 2 = .4 = 0
11111.010
0.1111101 00000101
0.1111101 00000101 +5 -5 = 0
011111.01 00000000
32 16 8 4 2 1 ½ ¼
0 1 1 1 1 1 0 1
31 + .25
31.25
-31.25
+31.25
0.1111101 00000101
1.0000011 00000101
1.0000011 00000101
100000.11 00000000
-32 16 8 4 2 1 ½ ¼
1 0 0 0 0 0 1 1
-32 + .75
-31.25
Day – 3
Accuracy = Mantissa
Range = Exponent
23.456 23
10999
Normalisation
0.0010111 00000100
000.10111 4-2 = 2
0.1011100 00000010
10010110
-128+16+4+2
-106-2 = -108
-30 11111111
1.1110101
1.0101000 00000010
0.1011000 2-3 = -1
32.45 x 103
324.5 x 102
.3245 x 105
Day – 4
Past Papers
0.1101000 0100
01101.000 0000
+13
+001 10-99
0111
0.1000000
1000 (2-8)
1111 (-8+4+2+1)
.00000001 0000
1/512
10000000
23 x 100
23 x 10-9
0.1111111 01111111
Day – 5
Past Papers
3.5
11.1
0.1110000 0010
0.1110000 0010
10001111+1
10010000 0010
-000 x 109999
21.75
10101.11
.1010111
10110000 1110
01001111 + 1
0.1010000 1110 = -8 + 4 + 2 = -2
0.0010100 0000
1/8 + 1/32 =
- 5/32
File Organisation
(Create + Access)
1. Serial
2. Sequential
3. Random (Direct)
Serial(Serial)
Easier to setup
Easy to update
Difficult and slower to access the record
Sequential(Sequential, Serial)
Data is in order
Difficult to setup
Difficult to update
Easier and faster to access the record
(Data is compared with the search string one after the other)
Data is accessed directly, data isn’t in any order using hashing algorithm
Difficult to setup
Moderately Difficult to update
Fastest access of data
Ali 1+12+9 = 22 (Record key/address)
Zain 26+1+9+14 = 50
Zain 50
Access
16 8 4 2 1 ½ ¼ 1/8
0 0 0 0 0 1 0 1
½ + 1/8
4+1 = 5/8
½ ¼ 1/8 1/16
8 +4+ 2 +1
16
0.1001000 00000000
10110111
10111000 00000000