# 8/15/2015 1 Binary Representation Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons

## Presentation on theme: "8/15/2015 1 Binary Representation Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons"— Presentation transcript:

8/15/2015 http://numericalmethods.eng.usf.edu 1 Binary Representation Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons http://numericalmethods.eng.usf.edu Transforming Numerical Methods Education for STEM Undergraduates

Binary Representation http://numericalmethods.eng.usf.edu http://numericalmethods.eng.usf.edu

3 How a Decimal Number is Represented

http://numericalmethods.eng.usf.edu4 Base 2

http://numericalmethods.eng.usf.edu5 Convert Base 10 Integer to binary representation Table 1 Converting a base-10 integer to binary representation. QuotientRemainder 11/25 5/22 2/21 1/20 Hence

http://numericalmethods.eng.usf.edu6 Start Input (N) 10 i = 0 Divide N by 2 to get quotient Q & remainder R a i = R Is Q = 0? n = i (N) 10 = (a n...a 0 ) 2 STOP Integer N to be converted to binary format i=i+1,N=Q No Yes

http://numericalmethods.eng.usf.edu7 Fractional Decimal Number to Binary Number Number after decimal Number before decimal 0.375 0.75 1.50.5 1.00.0 Table 2. Converting a base-10 fraction to binary representation. Hence

http://numericalmethods.eng.usf.edu8 Start Input (F) 10 Multiply F by 2 to get number before decimal, S and after decimal, T a i = R Is T =0? n = i (F) 10 = (a -1...a -n ) 2 STOP Fraction F to be converted to binary format No Yes

http://numericalmethods.eng.usf.edu9 Decimal Number to Binary and we have Since

http://numericalmethods.eng.usf.edu10 All Fractional Decimal Numbers Cannot be Represented Exactly Number Number after decimal Number before Decimal 0.6 1.20.2 0.4 0.8 1.60.6 Table 3. Converting a base-10 fraction to approximate binary representation.

http://numericalmethods.eng.usf.edu11 Another Way to Look at Conversion Convert to base 2

http://numericalmethods.eng.usf.edu12

Additional Resources For all resources on this topic such as digital audiovisual lectures, primers, textbook chapters, multiple-choice tests, worksheets in MATLAB, MATHEMATICA, MathCad and MAPLE, blogs, related physical problems, please visit http://numericalmethods.eng.usf.edu/topics/binary_repr esentation.html

THE END http://numericalmethods.eng.usf.edu

Download ppt "8/15/2015 1 Binary Representation Major: All Engineering Majors Authors: Autar Kaw, Matthew Emmons"

Similar presentations