0% found this document useful (0 votes)
10 views2 pages

MAT104 Lectures 105056

1) This document provides information on converting between binary and decimal number systems as well as representing real numbers using binary machine numbers based on IEEE 754 standards. It defines the floating point format for binary machine numbers and provides examples of converting specific bit strings to decimal numbers. It also lists exercises to convert additional binary machine numbers to floating point format.

Uploaded by

renn tenn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

MAT104 Lectures 105056

1) This document provides information on converting between binary and decimal number systems as well as representing real numbers using binary machine numbers based on IEEE 754 standards. It defines the floating point format for binary machine numbers and provides examples of converting specific bit strings to decimal numbers. It also lists exercises to convert additional binary machine numbers to floating point format.

Uploaded by

renn tenn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Mindanao State University

Tawi-Tawi College of Technology and Ocenaography


College of Arts and Sciences
MAT104-Descrete Mathematics

Prepared by: Prof. Jeffrey Imer C. Salim


Topics: 1) Converting Binary to Decimal
2) Binary Machine Number

1) Binary to Decimal Formula

The formula to convert binary number system into decimal can be represented by,

A = xn * bn + xn-1 * bn-1 + . . . + x1 * b1 + x0 * b0 , where A represent the integer


x represent the digit value
b represent the base value
For example: The binary number (1000)2 = 1 × 23 + 0 × 22 + 0 × 21 + 0 × 20 = 8

Tabular Representation of Binary to Decimal Number

Binary Decimal Binary Decimal


0000 0 1000 8
0001 1 1001 9
0010 2 1010 10
0011 3 1011 11
0100 4 1100 12
0101 5 1101 13
0110 6 1110 14
0111 7 1111 15

2) Binary Machine Numbers


Binary Machine Numbers
In 1985, the IEEE (Institute for Electrical and Electronic Engineers) published a
report called Binary Floating Point Arithmetic Standard 754–1985. An updated version was
published in 2008 as IEEE 754-2008. This provides standards for binary and decimal floating
point numbers, formats for data interchange, algorithms for rounding arithmetic operations,
and for the handling of exceptions. Formats are specified for single, double, and extended
precisions, and these standards are generally followed by all microcomputer manufacturers
using floating-point hardware.
A 64-bit (binary digit) representation is used for a real number. The first bit is a sign
indicator, denoted s. This is followed by an 11-bit exponent, c, called the characteristic, and
a 52-bit binary fraction, f , called the mantissa. The base for the exponent is 2. Since 52
binary digits correspond to between 16 and 17 decimal digits, we can assume that a number
represented in this system has at least 16 decimal digits of precision. The exponent of 11
binary digits gives a range of 0 to 211−1 = 2047. However, using only positive integers for
the exponent would not permit an adequate representation of numbers with small magnitude.
To ensure that numbers with small magnitude are equally representable, 1023 is subtracted
from the characteristics, so the range of the exponent is actually from -1023 to 1024.
(-1)s 2c – 1023(1+ f ) floating point form for binary machine numbers.
Examples:
0 10000000011 1011100100010000000000000000000000000000000000000000
The leftmost bit is s = 0, which indicates that the number is positive. The next 11 bits,
10000000011, give the characteristics and are equivalent to the decimal number

c = 1 ∙ 210 + 0 ∙ 29 + ⋯ + 0 ∙ 22 + 1 ∙ 21 + 1 ∙ 20 = 1024 + 2 + 1 = 1027

The exponential part of the number is, therefore, 21027-1023 = 24. The final 52 bits specify that
the mantissa is
1 1 1 3 1 4 1 5 1 8 1 12
f=1 ∙ 2
+ 1 ∙ 2
+ 1 ∙ 2
+ 1 ∙ 2
+ 1 ∙ 2
+ 1 ∙ 2

As a consequence, this machine number precisely represent the decimal number


1 1 1 1 1 1
(-1)s 2c – 1023 (1 + f) = (-1)0 ∙ 21027 – 1023 1 + 2
+ 8 + 16 + 32 + 256 + 4096

= 27.56640625

NOTE:
The smallest normalized positive number that can be presented has s = 0, c = 1, and f = 0 is
equivalent to
2-1022 ∙ (1 + 0) ≈ 0.22251 x 10-307
and the largest has s = 0, c = 2046 and f = 1 – 2-52 and is equivalent to
21023 ∙ (2 + 2-52) ≈ 0.17977 x 10309
Number occurring in calculation that have a magnitude less than 2-1022 ∙ (1 + 0). Result in
underflow and are generally set to zero. Number greater than 21023 ∙ (2 + 2-52) result in
overflow and typically cause the computation to stop.

Exercise 1
Directions: Transform the following binary machine number into floating point numbers.
1) 0 00110010111 0010010101010100000010100000000000000000000000000000
2) 1 10101010101 1111100101001100000000000000000000000000000000000000
3) 0 11100100011 0000000111100010100010000000000000000000000000000000
4) 0 01010101001 0010101100010011011000000000000000000000000000000000
5) 1 11100000111 1111000000100110000010000000000000000000000000000000
6) 1 10110101111 1010000101011000000100000000000000000000000000000000

You might also like