Week 3
Week 3
5 Floating-Point Representation
(1 of 33)
thing, many people use these terms interchangeably. We use the term
2.5 Floating-Point Representation
(6 of 33)
The one-bit sign field is the sign of the stored
value.
The size of the exponent field determines the
range of values that can be represented.
The size of the significand determines the
precision of the representation.
2.5 Floating-Point Representation
(7 of 33)
it is better to use:
if (abs(x - 2) < epsilon) then ...
(assuming we have epsilon defined correctly!)
2.6 Character Codes (1 of 6)
The Unicode
codespace allocation
is shown at the right.
The lowest-numbered
Unicode characters
comprise the ASCII
code.
The highest provide
for user-defined
codes.
2.7 Error Detection and Correction
(1 of 25)
It is physically impossible for any data recording or
transmission medium to be 100% perfect 100% of
the time over its entire expected useful life.
As more bits are packed onto a square centimeter
of disk storage, as communications transmission
speeds increase, the likelihood of error increases
sometimes geometrically.
Thus, error detection and correction is critical to
accurate data transmission, storage and retrieval.
2.7 Error Detection and Correction
(2 of 25)
Check digits, appended to the end of a long
number, can provide some protection against data
input errors.
The last characters of UPC barcodes and ISBNs are
check digits.
Longer data streams require more economical and
sophisticated error detection mechanisms.
Cyclic redundancy checking (CRC) codes provide
error detection for large blocks of data.
2.7 Error Detection and Correction
(3 of 25)
Checksums and CRCs are examples of systematic
error detection.
In systematic error detection a group of error control
bits is appended to the end of the block of
transmitted data.
This group of bits is called a syndrome.
CRCs are polynomials over the modulo 2 arithmetic
field.
The mathematical theory behind modulo 2 polynomials is beyond
our scope. However, we can easily work with it without knowing
its theoretical underpinnings.
2.7 Error Detection and Correction
(4 of 25)
Modulo 2 arithmetic works like clock arithmetic.
In clock arithmetic, if we add 2 hours to 11:00, we
get 1:00.
In modulo 2 arithmetic if we add 1 to 1, we get 0.
0+0=0 0+1=1
1+0=1 1+1=0
You will fully understand why modulo 2 arithmetic is so handy
after you study digital circuits in Chapter 3.
2.7 Error Detection and Correction
(5 of 25)
Find the quotient and
remainder when 1111101
is divided by 1101 in
modulo 2 arithmetic.
As with traditional
division, we note that the
dividend is divisible once
by the divisor.
We place the divisor under
the dividend and perform
modulo 2 subtraction.
2.7 Error Detection and Correction
(6 of 25)
Find the quotient and
remainder when
1111101 is divided by
1101 in modulo 2
arithmetic.
Now we bring down the
next bit of the dividend.
We see that 00101 is not
divisible by 1101. So we
place a zero in the
quotient.
2.7 Error Detection and Correction
(7 of 25)
Find the quotient and
remainder when
1111101 is divided by
1101 in modulo 2
arithmetic.
1010 is divisible by
1101 in modulo 2.
We perform the
modulo 2 subtraction.
2.7 Error Detection and Correction
(8 of 25)
Find the quotient and
remainder when 1111101
is divided by 1101 in
modulo 2 arithmetic.
We find the quotient is
1011, and the remainder
is 0010.
This procedure is very
useful to us in calculating
CRC syndromes.
magnitude representation.
Floating-point numbers are usually coded
using the IEEE 754 floating-point standard.
Conclusion (2 of 2)