بسم الله الرحمن الرحيم

   

 

 

 

     
 

Number base Conversion:

Binary to Decimal

It is very easy to convert from a binary number to a decimal number. Just like the decimal system, we multiply each digit by its weighted position, and add each of the weighted values together. For example, the binary value 1100 1010 represents:

1*2^7 + 1*2^6 + 0*2^5 + 0*2^4 + 1*2^3 + 0*2^2 + 1*2^1 + 0*2^0 =202

Decimal to Binary

To convert decimal to binary is slightly more difficult. There are two methods, that may be used to convert from decimal to binary, repeated division by 2, and repeated subtraction by the weighted position value.

Repeated Division By 2

For this method, divide the decimal number by 2, if the remainder is 0, on the side write down a 0. If the remainder is 1, write down a 1. This process is continued by dividing the quotient by 2 and dropping the previous remainder until the quotient is 0. The remainders are written beginning at the least significant digit (right). Consider the number 2671.

Division

Quotient

Remainder

Binary Number

2671 / 2

1335

1

1

1335 / 2

667

1

11

667 / 2

333

1

111

333 / 2

166

1

1111

166 / 2

83

0

0 1111

83 / 2

41

1

10 1111

41 / 2

20

1

110 1111

20 / 2

10

0

0110 1111

10 / 2

5

0

0 0110 1111

5 / 2

2

1

10 0110 1111

2 / 2

1

0

010 0110 1111

1 / 2

0

1

1010 0110 1111

Binary to Hex Conversion

It is easy to convert from an integer binary number to hex. This is accomplished by:

1.      Break the binary number into 4-bit sections.

2.      Convert the 4-bit binary number to its Hex equivalent.

For example, the binary value 1010111110110010 will be written:

1010

1111

1011

0010

A

F

B

2

Hex to Binary Conversion

It is also easy to convert from an integer hex number to binary. This is accomplished by:

  1. Convert the Hex number to its 4-bit binary equivalent.
  2. Combine the 4-bit sections by removing the spaces.

For example, the hex value 0AFB2 will be written:

A

F

B

2

1010

1111

1011

0010

This yields the binary number 1010111110110010 or 1010 1111 1011 0010 in our more readable format.

 

Hex to Decimal Conversion

To convert from Hex to Decimal, multiply the value in each position by its hex weight and add each value. Using the value from the previous example, 0AFB2H, we would expect to obtain the decimal value 44978.

A*16^3

F*16^2

B*16^1

2*16^0

10*4096

15*256

11*16

2*1

40960

3840

176

2

40960 + 3840 + 176 + 2 = 44978

 

Decimal to Hex Conversion

To convert decimal to hex is slightly more difficult. The typical method to convert from decimal to hex is repeated division by 16. While we may also use repeated subtraction by the weighted position value, it is more difficult for large decimal numbers.

 

Binary to Octal Conversion

It is easy to convert from an integer binary number to octal. This is accomplished by:

1.      Break the binary number into 3-bit sections from the LSB to the MSB.

2.      Convert the 3-bit binary number to its octal equivalent.

For example, the binary value 1010111110110010 will be written:

001

010

111

110

110

010

1

2

7

6

6

2

 

Octal to Binary Conversion

It is also easy to convert from an integer octal number to binary. This is accomplished by:

1.      Convert the decimal number to its 3-bit binary equivalent.

2.      Combine the 3-bit sections by removing the spaces.

For example, the octal value 127662 will be written:

1

2

7

6

6

2

001

010

111

110

110

010

This yields the binary number 001010111110110010 or 00 1010 1111 1011 0010 in our more readable format 

 

Number Systems

    - Conventional Number System

         >Properties

         >Binary, Decimal, Hexadecimal

         >Number Base Conversion

    - Unconventional Number System

         >Roman Number System

         >Signed Digit Number System

         >Binary SD Number System

Fast Addition

    - Half and Full Adders

    - Ripple Carry Adder

    - Carry Look-Ahead Adders

Fast Multiplication

    - Carry Save Adders

    - Additive & Non-additive Multiplier

    - Counters