Binary, Octal and Hex Numbers Copyright Thaddeus Konar Introduction to Binary, Octal and Hexadecimal Numbers Part 2 – Binary Numbers Thaddeus Konar 11/20/2018 Slide # 1 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary, Octal and Hex Numbers Copyright Thaddeus Konar Binary Integers 1 Just as the each digit (position) in decimal integer is represented by the power of 10, binary integers are numbers where each digit is represented by the power of 2 (Base = 2). Digits range: 0 -> (Base - 1) Number of values represented by a single digit: Base Digits range: 0 -> 1 (0,1) Number of values represented by a single digit : 2 11/20/2018 Slide # 2 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary, Octal and Hex Numbers Copyright Thaddeus Konar Binary Integers 2 In the decimal number the digits could be 0,1,2,3,4,5,6,7,8,9. (0 -> Base-1). As we can see the binary number digits could only be either 0 or 1 (0 ->Base-1). The single decimal number can represent 10 values, and the single binary number can represent only 2 values. 11/20/2018 Slide # 3 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary, Octal and Hex Numbers Copyright Thaddeus Konar Binary Integers 3 Binary integer will be a combination of 1s and 0s. Please recall the formula (and remember that now Base=2): (D0*B0)+(D1*B1)+(D2*B2)+(D3*B3)+…(Dn*Bn) B0=1, B1=2, B2=4, B3 =8, B4=16, B5=32, B6 =64… Lets look at the binary number 101110 D0=0, D1=1, D2=1, D3=1, D4=0, D5=1 11/20/2018 Slide # 4 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary, Octal and Hex Numbers Copyright Thaddeus Konar Binary Integers 4 …101110 means: (0*20)+(1*21)+(1*22)+(1*23)+(0*24)+(1*25) = (0*1)+(1*2)+(1*4)+(1*8)+(0*16)+(1*32) = 4610 Here are the first few binary numbers: 00002 = 010 01002 = 410 10002 = 810 11002 = 1210 100002 = 1610 00012 = 110 01012 = 510 10012 = 910 11012 = 1310 100012 = 1710 00102 = 210 01102 = 610 10102 = 1010 11102 = 1410 100102 = 1810 00112 = 310 01112 = 710 10112 = 1110 11112 = 1510 100112 = 1910 11/20/2018 Slide # 5 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Binary Conversion Example Convert binary number 10111 to decimal: 10111 1 * 1 =1 1 * 2 =2 1 * 4 =4 0 * 8 =0 1 * 16 =16 =23 11/20/2018 Slide # 6 Binary, Octal and Hex Numbers Copyright Thaddeus Konar
Convert binary number to decimal: 10111001 1 * 1 =1 0 * 2 =0 0 * 4 =0 1 * 8 =8 1 * 16 =16 1 * 32 =32 0 * 64 =0 1 * 128 =128 =185 11/20/2018 Slide # 7 Binary, Octal and Hex Numbers Copyright Thaddeus Konar