1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all...

21
1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary: 10001100101001 2 010 001 101 100 001 start

Transcript of 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all...

Page 1: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

1

Converting Binary to Octal

STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

100011001010012

010 001101100001

start

Page 2: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

2

STEP TWO: Convert each triplet to its single-digit octal equivalent. (HINT: For each triplet, the octal conversion is the same as converting to a decimal number):

010 001 100 101 0012

010 001101100001

2 1 154

214518

=0

Page 3: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

3

Converting Octal to Converting Octal to BinaryBinary

STEP ONE: Take each octal digit and convert each digit to a binary triplet. Keep leading zeros:

435208

100 0000101010114 3 025

1000111010100002

=

0 0

Page 4: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

4

Hexadecimal System• Sometimes, it is necessary to use a numbering

system that has more than ten base digits

• One such numbering system, hexadecimal, is useful on the Web

• Hexadecimal number, a Base-16 numbering system, is used in specifying web colors

Page 5: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

5

Hexadecimal Numbering There are new symbols for the Base-16 equivalents

of the Base-10 numbers 10, 11, 12, 14 and 15. Examine:

DEC 0 1 2 3 4 5 6 7

HEX 0 1 2 3 4 5 6 7

DEC 8 9 10 11 12 13 14 15

HEX 8 9 A B C D E F

Page 6: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

6

Decimal Hexadecimal Octal Binary

0 0 0 0000

1 1 1 0001

2 2 2 0010

3 3 3 0011

4 4 4 0100

5 5 5 0101

6 6 6 0110

7 7 7 0111

8 8 10 1000

9 9 11 1001

Page 7: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

7

Decimal Decimal HexadecimalHexadecimal OctalOctal BinaryBinary

10 A 12 1010

11 B 13 1011

12 C 14 1100

13 D 15 1101

14 E 16 1110

15 F 17 1111

Page 8: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

8

• Convert a hexadecimal number to a binary number,

• simply divided the binary number into 4-bit groups

• substitute the corresponding four bits in binary for each hexadecimal digit in the number.

• For example, convert ABCD to a binary value, The binary equivalent is:

• ABCD= 1010 1011 1100 1101

Page 9: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

9

• Binary to Hex Conversion• Break the binary number into 4-bit groups from

the Left to the right. • Convert the 4-bit binary number to its Hex

equivalent. • For example, the binary value 101011111011

0010 will be written:• 1010 1111 1011 0010=AFB2

Page 10: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

10

• Hex to Binary Conversion• Convert the Hex number to its 4-bit binary

equivalent. • Combine the 4-bit groups by removing the

spaces. • For example, the hex value AFC7 will be

written:• AFC7=1010 1111 1110 0111

Page 11: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

11

• To convert from Hex to Decimal,• multiply the value in each position by its hex

weight and• add each value. use the expansion form• AFB.2=10*163 +15*162 +11*16+2*16-1

Hex to Decimal ConversionHex to Decimal Conversion

Page 12: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

12

Decimal to Hex Conversion

• Repeated Division By 16• Divide the decimal number by 16, and write the Divide the decimal number by 16, and write the

remainder on the side as the least significant digit.remainder on the side as the least significant digit.• This process is continued by dividing the quotient by This process is continued by dividing the quotient by

16 and writing the remainder until the quotient is 0. 16 and writing the remainder until the quotient is 0. • the remainders represent the hex equivalent of the the remainders represent the hex equivalent of the

decimal number are written beginning at the least decimal number are written beginning at the least significant digit (right) and each new digit is written significant digit (right) and each new digit is written to the next more significant digit (the left) of the to the next more significant digit (the left) of the previous digit. previous digit.

Page 13: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

13

Example convert 196710 to Hex

Division Quotient Remainder Hex Number

1967/16 122 15 F

122/16 7 10 AF

7/16 0 7 7AF

Then (1967)10 =(7AF)16

Page 14: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

14

Decimal fraction to B, O and HFraction Product with

BaseNew farction integer

0.0625 2X0.0625 0.1250 .0

0.1250 2X0.125 0.250 .00

0.250 2X0.25 0.5 .000

0.5 2X0.25 1.0 .0001

0.062510 = .00012

Page 15: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

15

FractionFraction Product with Product with BaseBase

New fractionNew fraction integer

0.06250.0625 8X0.06258X0.0625 00.5.5000000 .0

0.50.5 8X0.58X0.5 44. 0. 0 .04

0.062510 = .048

FractionFraction Product with Product with BaseBase

New fractionNew fraction integer

0.06250.0625 16X0.062516X0.0625 11.0.0000000 .1

0.062510 = .116

Page 16: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

16

Convert (1967.0626)10 to B,O,H

Division Quotient Remainder Hex Number

1967/8 245 7 7

245/8 30 3 37

30/8 3 6 376

3/8 0 3 3637

(1967.0626)10= (3637.04)8

0.062510 = .048(1967)10= (3537)8

Page 17: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

17

Binary Addition

• 0 + 0 = 0• 0 + 1 = 1• 1 + 0 = 1• 1 + 1 = 10

+ 0 1

0 0 1

1 1 10

Page 18: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

18

Multiply Binary numbers

0 * 0 = 0 0 * 1 = 0 1 * 0 = 0 1 * 1 = 1

* 0 1

0 0 0

1 0 1

Page 19: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

19

– 1111 carry–111101 100111+

• 1100100

1 1 1 (carry) 0 1 1 0 1

1 0 1 1 1+-------------

1 0 0 1 0 0

Page 20: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

20

Multiply 1011 and 1010

– 1 0 1 1 × 1 0 1 0

--------------- 0 0 0 0 1 0 1 1 0 0 0 0

+ 1 0 1 1 ------------------ 1 1 0 1 1 1 0

Page 21: 1 Converting Binary to Octal STEP ONE: Take the binary number and from right to left, group all placeholders in triplets. Add leading zeros, if necessary:

21

1 1 0 1 1 11 1 0 1 1 1 1 1 11 1 1

1 1 0 1 1 11 1 0 1 1 1 1 1 0 1 1 11 1 0 1 1 1

1 1 0 1 1 11 1 0 1 1 1------------------------------------------------------------------------

1 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1

Multiply ExampleMultiply Example