Binary Representation - Numerical Methods - Lecture Slides, Slides of Mathematical Methods for Numerical Analysis and Optimization

Main points are: Binary Representation, Decimal Number, Base-10 Integer, Fractional Decimal Number, Decimal Number to Binary, Additional Resources, Digital Audiovisual Lectures, Multiple-Choice Tests, Mathcad and Maple

Typology: Slides

2012/2013

Uploaded on 04/16/2013

mmadhav
mmadhav ๐Ÿ‡ฎ๐Ÿ‡ณ

5

(8)

74 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Binary Representation
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Binary Representation - Numerical Methods - Lecture Slides and more Slides Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity!

Binary Representation

How a Decimal Number is Represented

2 1 0 1 2

โˆ’ โˆ’

= ร— + ร— + ร— + ร— + ร—

Convert Base 10 Integer to binary

representation

Table 1 Converting a base-10 integer to binary representation. Quotient Remainder 11/2 5 5/2 2 2/2 1 1/2 0

1 = a 0
1 = a 1
0 = a 2
1 = a 3

Hence

2

10 3 2 1 0 2 ( 1011 )

( 11 ) ( )

=

= a a a a

Start

Input (N) (^10)

i = 0

Divide N by 2 to get quotient Q & remainder R

ai = R

Is Q = 0?

n = i (N) 10 = (an.. .a 0 ) (^2)

STOP

Integer N to be converted to binary format

i=i+1,N=Q

No

Yes

Start

Input (F) (^10)

Multiply F by 2 to get number before decimal, S and after decimal, T

ai = R

Is T =0?

n = i (F) 10 = (a-1.. .a-n) (^2)

STOP

Fraction F to be converted to binary format

No

Yes

i= iโˆ’1,F= T

i =โˆ’ 1

Decimal Number to Binary

( ) ( )

( 11 ) 10 = ( 1011 ) 2

( 0. 1875 ) 10 = ( 0. 0011 ) 2

and

we have ( 11. 1875 ) 10 = ( 1011. 0011 ) 2

Since

Another Way to Look at Conversion

Convert (^11.^1875 ) 10 to base 2

3 2 1 0

3 1 0

3 1

3 10

1011

1 2 0 2 1 2 1 2

2 2 2

2 2 1

11 2 3

=

= ร— + ร— + ร— + ร—

= + +

= + +

= +

1 2 3 4

3 4

3 10

= ร— + ร— + ร— + ร—

โˆ’ โˆ’ โˆ’ โˆ’

โˆ’ โˆ’

โˆ’