## HP15c software: number conversion dec->binary

command display
f LBL D 001-42,21,14
0 003- 0
STO 0 003- 44 0
STO 1 004- 44 1
R_arrow_down 005- 33
f LBL 8 006-42,21, 8
1 007- 1
STO + 0 008-44,40, 0
R_arrow_down 009- 33
2 010- 2
/ 011- 10
Enter 013- 36
g INT 014-43 44
g TEST 9 015-43,30, 9
GTO 8 016- 22 8
RCL 0 017- 45 0
1 018- 1
- 019- 30
10^x 020- 13
STO + 1 021-44,40, 1
R_arrow_down 022- 33
g TEST 1 023-43,30, 1
GTO 8 024- 22 8
RCL 1 025- 45 1
g RTN 026- 43 32

This program uses the following label: LBL D and LBL 8

### Using the program

This program can convert decimal numbers between 1 and 1023 into their binary
representation.

I start every program with a label. This way you can have a number
of programs in your 15c and you just select which one to run by pressing f LABELNAME (f D in this case) or GSB LABELNAME (GSB D in this case).

Let's say you would like to convert decimal 19 into its binary representation.

You type: 19, GSB D

The display shows "running" and then you see: 10011

### Algorithm

19 / 2 = 9 remainder **1**
9 / 2 = 4 remainder **1**
4 / 2 = 2 remainder **0**
2 / 2 = 1 remainder **0**
1 / 2 = 0 remainder **1**
The result are the remainders read from bottom to top: 10011

© Guido Socher