HP NonStop NS manual Binary to Decimal, Binary Value Decimal Value

Models: NonStop NS

1 266
Download 266 pages 1.32 Kb
Page 245
Image 245

Converting Numbers

Binary to Decimal

Binary to Decimal

To convert a binary number to a decimal number:

1.Starting from the right, multiply the least significant (rightmost) binary digit by the first placeholder value. Moving towards the left, multiply each new binary digit by its corresponding placeholder value until the binary number is exhausted.

To establish placeholder values, the first placeholder value (on the far right) is 1. Then for each new placeholder value to the left, multiply the value to the right by 2.

2.Add the results of the multiplications in Step 1.

Example

Convert the binary value 11011 to its decimal equivalent. (In this example, the symbol “*” indicates multiplication.) Refer to Figure D-1.

Figure D-1. Binary to Decimal Conversion

Placeholder

...

64

32

16

8

4

2

1

 

 

values

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Binary number

...

 

 

1

1

0

1

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

= 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 * 1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 * 2

 

 

= 2

 

 

 

 

 

 

 

 

 

 

 

 

0 * 4

 

 

 

= 0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 * 8

 

 

 

 

 

= 8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1 * 16

 

 

 

 

 

 

 

 

= 16

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

27

CDT 607.CDD

1.Take the rightmost binary digit and multiply it by the rightmost placeholder value.

2.Moving to the left, take the next binary digit and multiply it by the next placeholder value. Continue to do this until the binary number has been exhausted.

3.Add the multiplied values together. The result is:

Binary Value Decimal Value

%B11011 27

HP Integrity NonStop NS-Series Operations Guide529869-005

D-3

Page 245
Image 245
HP NonStop NS manual Binary to Decimal, Binary Value Decimal Value