Sie sind auf Seite 1von 16

Module 3

Binary Arithmetic
Conversion of binary , octal and hexadecimal to
decimal number
Conversion of decimal to binary, octal and
hexadecimal number.
Conversion of binary to Decimal number , octal
number and hexadecimal number.
Addition , subtraction and multiplication of binary
numbers .

Conversion to decimal number


Binary to Decimal
multiply the value in each position by its base (2)
weight and add each value. use the expansion
form
Octal to decimal
multiply the value in each position by its base (8)
weight and add each value. use the expansion
form
Hexadecimal to binary
multiply the value in each position by its base (16)
weight and add each value. use the expansion
form

Conversion of decimal to other


number system
Repeated Division By base
Divide the decimal number by 2 (binary), 8
(octal) ,(hexadecimal) 16, and write the
remainder on the side as the least significant
digit.
This process is continued by dividing the
quotient by base and writing the remainder until
the quotient is 0.
the remainders represent the respective
equivalent of the decimal number are written
beginning at the least significant digit (right) and
each new digit is written to the next more
significant digit (the left) of the previous digit.

Converting Binary to Octal


100011001010012

start

STEP ONE: Take the binary number and


from right to left, group all placeholders in
triplets. Add leading zeros, if necessary:

010

001

100
4

101 001

0010 001 100 101 0012

= 214518

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

001

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

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
11

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

12

Decimal fraction to B, O and H


Fraction

Product with New farction


Base

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

integer

17

Fraction

Product with
Base

New fraction

integer

0.0625

8X0.0625

0.5000

.0

0.5

8X0.5

4. 0

.04

Fraction

Product with
Base

New fraction

0.0625

16X0.0625

1.0000

0.062510 = .048
integer

.1

0.062510 = .116
18

Convert (1967.0626)10 to B,O,H


Division

Quotient

Remainder

Hex Number

1967/8

245

245/8

30

37

30/8

376

3/8

3637

(1967)10=

(3537)8

0.062510 = .048

(1967.0626)10= (3637.04)198

Binary Addition

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

10

20

Multiply Binary numbers

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

21

1111 carry
111101
100111+
1100100

1 1 1 (carry)
01101
1 0 1 1 1+
------------100100

22

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 01 1 1 0
23

Multiply Example

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

24

Das könnte Ihnen auch gefallen