Showing posts with label binary. Show all posts
Showing posts with label binary. Show all posts

Wednesday, August 19, 2026

Spotlight: HP 16C Collector’s Edition

 Spotlight: HP 16C Collector’s Edition



Quick Facts: HP 16C Collector’s Edition



Model: HP 16C Collector’s Edition

Company: Hewlett Packard/Moravia


Type: RPN and Computer Science

Batteries: 2 x CR2032

Memory: Up to 34 memory registers

Programming Memory: Up to 203 memory registers

Years in Production:

Original: 1982-1989

Collector’s Edition: 2026 (limited edition)

Display: 8 digits (scrolling)


Store sites:

Europe: https://www.thecalculatorstore.com/i/the-hp16c

U.S.: https://shop.moravia.education/us/hp-16c-collector-s-edition.html





About the HP 16C


This is my first HP 16C from Hewlett Packard, and it’s a long awaited purchase. The HP 16C is a programmable calculator that is specialized in computer science. There are five main modes:


HEX: Hexadecimal integer mode (base 16, 2^4)

DEC: Decimal integer mode (base 10)

OCT: Octal integer mode (base 8, 2^3)

BIN: Binary integer mode (base 2)

FLOAT: Floating decimal mode.


The FLOAT mode is the only mode where calculations can involved fractions and non-integers. To make room for the Boolean logic and bit functions, the number of functions for floating point are limited to the reciprocal (1/x) and square root (√x).


The other four modes work with integers. The HP 16C is able to work with integers with up word sizes up to 64 bits. Each bit is is a binary bit. For example, a word size of 4 binary integers range from 0000 and 1111. Pressing [ 0 ] [ f ] [ STO ] (WSIZE) is a quick reset to a word size of 64 bits.


Integers can scroll beyond the initial screen of 8 digits, with multiple windows to show all the digits.


We have the classical Boolean functions available: AND, OR, NOT, and XOR. Part of what makes the HP 16C special is addition of bit manipulation functions:


* Shift bits left and right, including the carry over bit: SL, SR


* Arithmetic shift right, where bits are shifted right with the sign bit copied: ASR


* Rotate bits left and right: RL, RR, RL n, RR n (either a single bit or n bits); RLC, RRC, RLC n, RRC n (these are rotation functions including the carry over bit).


* Masks can be generated using the MASKL and MASKR functions.


* Integer division can be accomplished by finding the quotient (÷) and remainder (RMD).


* Finally, the HP 16C can work with double-sized words, potentially after 128 bits, with the double-multiply (DBL×), double-division (DBL÷), and double-remainder (DBLR).



The programming module can hold up to 203 steps, complete with loops, indirect addressing, testing, but no storage or recall arithmetic. Here are a couple of programs:


Integer Division: y |- x


Input Stack:
Y: dividend

X: divisor


Result: quotient, R/S, remainder


Code:


LBL D ; 001 43, 22, d

x<>y ; 002 34

STO 0 ; 003 44, 0

x<>y ; 004 34

÷ ; 005 10

R/S ; 006 31

RCL 0 ; 007 45, 0

LST x ; 008 43, 36

RMD ; 009 42, 9

RTN ; 010 43, 21


Examples


Example 1: 45 d |- 20 d = 2 d remainder 11 d

Keystrokes: DEC 45 ENTER 17 GSB D

Results: 2 d R/S 11 d


Example 2: 1F3 h |- 20 h = F h remainder 13 h

Keystrokes: HEX 1F3 ENTER 20 GSB D

Results: F h R/S 13 h


Hexadecimal: Showing One Hexadecimal Digit at a Time, From Right to Left


This program creates and then manipulates the mask to display each digit.


_ _ _ #

_ _ # 0

_ # 0 0

# 0 0 0


Code:


LBL A ; 001 43, 22, A

STO 0 ; 002 44, 0

CL x ; 003 43, 35

WSIZE ; 004 42, 44

HEX ; 005 23

F ; 006 F

ENTER ; 007 36

1 ; 008 1

+ ; 009 40

WSIZE ; 010 42, 44


RCL 0 ; 011 45, 0

4 ; 012 4

MASK4 ; 013 42, 8

AND ; 014 42, 40

R/S ; 015 31


3 ; 016 3

STO I ; 017 44, 32

LBL 0 ; 018 43, 22, 0

LST x ; 019 43, 36

4 ; 020 4

RL n ; 021 42 E

RCL 0 ; 022 45, 0

x<>y ; 023 34

AND ; 024 42, 20

R/S ; 025 31

DSZ ; 026 43, 23

GTO 0 ; 027 22, 0

RTN ; 028 43, 21


Examples


4F37 h GSB A: 1 R/S 20 R/S 400 R/S 5000


17695 d GSB A: F R/S 10 R/S 500 R/S 4000 (451F h)


The speed of the HP 16C Collector’s Edition is comparable to the HP 15C Collector’s Edition. I found the keys to be responsive and reliable.


Eddie


Sources:


“HP-16C” The Museum of HP Calculators. https://www.hpmuseum.org/hp16.htm Retrieved August 17, 2026.


Hewlett Packard. HP 16c Collector’s Edition: Owner’s Handbook. Edition 2, November 2025. From the HP Calculator Literature website: https://literature.hpcalc.org/items/2714





Eddie


All original content copyright, © 2011-2026. Edward Shore. Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited. This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.


Sunday, October 30, 2022

HP 71B and TI-84 Plus CE: Binary Decimal Conversions Revised

HP 71B and TI-84 Plus CE:  Binary Decimal Conversions Revised


The programs presented can easily convert integers without the needs of lists or strings in input.  



HP 71B Programs:  BINDEC, DECBIN


No modules are required.


BINDEC (137 bytes)


100 DISP "BIN>DEC" @ WAIT .5

105 DESTROY A,B,C,D,E

110 INPUT "BIN? ";A

115 B=1 @ D=0 @ C=A

200 E=A/10 @ A=INT(E)

205 D=D+10*B*(E-A) @ B=2*B

210 IF A THEN 200

300 DISP "(2)";C;"="D


DECBIN (130 bytes)


100 DISP "DEC>BIN" @ WAIT .5

105 DESTROY A,B,C,D

110 INPUT "DEC? ";D

115 B=0 @ A=D @ C=1

200 E=D/2 @ D=INT(E)

205 B=B+C*(D<E)

210 C=C*10

215 IF D THEN 200

300 PRINT A;"=(2)";B



TI-84 Plus CE Programs:  BINDEC2, DECBIN2



BINDEC2


"V.2"

Disp "BIN>DEC"

Input "BIN? ",A

1→B:0→D:A→C

Lbl 2

A/10→E:iPart(E)→A

D+10*B*(E-A)→D

2*B→B

If A:Goto 2

Disp "(2) "+toString(C)+"= "+toString(D)



DECBIN2


"V.2"

Disp "DEC>BIN"

Input "DEC? ",D

0→B:D→A:1→C

Lbl 2

D/2→E:iPart(E)→D

B+C*(D<E)→B

10*C→C

If D:Goto 2

Disp toString(A)+"=(2) "+toString(B)


This is recommended for only integer values of 512 (decimal base) or less.  


Example


Decimal: 476  (DEC>BIN)

Result Binary:  111011100


Binary:  10111011 (BIN>DEC)

Result Decimal:  187



Source


Craig, John Clark.  119 Practical Programs For The TRS-80 Pocket Computer  TAB Books Inc.  Blue Ridge Summit, PA.  1982 pg. 133



Happy computing,

Eddie 



All original content copyright, © 2011-2022.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Thursday, September 6, 2018

Floating Point Base Conversions with Scientific Calculators


Floating Point Base Conversions with Scientific Calculators

Introduction

Any scientific calculator that has base conversions will operate on integers only.  But what if we want to find hexadecimal representation of Ï€?  According to the TI LCD Programming there is a procedure. 

This blog post will focus on conversions between binary (base 2), octal (base 8), hexadecimal (base 16), and decimal (base 10).  This can easily be worked with other bases.

Decimal to Other Bases

Let x = the number to be converted.

Steps:

1. Let n be the number of decimal places x has.  Designate b to the designated base.  Here’s a point:  please be aware of your decimal point.  Being aware of your values is key coming up with the correct conversion. 

2. In Decimal mode, Multiply x * b^(n-1).

3. Convert the result to the destination base. The conversion will be shown as a decimal.  You will need to place the decimal point in the answer yourself. 

Example:  Convert 3.1415 to Binary, Octal, and Hexadecimal. 

x = 3.1415 has 4 decimal places, hence n = 4.

Binary   (b = 2)

In Decimal mode:  3.1415 * 2^(4- 1) = 25.132

Convert to Binary ([2nd/SHIFT] (BIN)), display:  11001

Since 3_10 = 11_2, place the decimal point as such:  11.001

Octal  (b = 8)

In Decimal mode:  3.1415 * 8^(4- 1) = 1608.448

Convert to Octal ([2nd/SHIFT] (OCT)), display:  3110

Since 3_10 = 3_8, place the decimal point as such:  3.110

Hexadecimal (b = 16)

In Decimal mode:  3.1415 *16^(4- 1) = 12867.584

Convert to Octal ([2nd/SHIFT] (HEX)), display:  3243

Since 3_10 = 3_16, place the decimal point as such:  3.243

As a result:  3.1415_10 ≈ 11.001_2 ≈ 3.110_8 ≈ 3.243_16

Other Bases to Decimal

Let x = the number to be converted.

Steps:

1. Let n be the number of decimal places x has.  Designate b to the designated base.  Here’s a point:  please be aware of your decimal point.  Being aware of your values is key coming up with the correct conversion. 

2. In the destination base mode, type the number without the decimal point. 

3. Convert the number to decimal. (Change the number to Decimal mode) 

4. Divide the result by b^n.

Examples

Example 1:  Convert 11.01101_2 to decimal.

1.01101_2 has 5 decimal places, n = 5. Enter in BIN mode:  1101101.  Remember not to include decimal point.

Convert to decimal ([2nd/Shift] (DEC)):  109

To get the final result:  109 / 2^5 = 3.40625

Example 2:  Convert 4.7076_8 to decimal.

4.7076_8 has 4 decimal places, n = 4. Enter in OCT mode:  47076.  Remember not to include decimal point.

Convert to decimal ([2nd/Shift] (DEC)):  20030

To get the final result:  20030 / 8^4 = 4.890136719

Example 3:  Convert  3A.19B1_16 to decimal

3A.19B1_16 has 4 decimal places, n = 4. Enter in HEX mode:  3A19B1.  Remember not to include decimal point.

Convert to decimal ([2nd/Shift] (DEC)):  3807665

To get the final result:  3807665 / 16^4 = 58.10035706

Source:

Texas Instruments TI LCD Programmer User Manual.  Texas Instruments. 1981.

You can find a PDF of the manual from Datamath’s website here:  http://www.datamath.org/Sci/Slanted/LCD-Programmer.htm 

Hopefully you find this helpful.

P.S.  I hope the next update to the TI-84 Plus CE and the Casio fx-CG 50 have adds operating system base conversions and Boolean functions. HP Prime has base conversions.

I have am working on a retro review, working on blog about adjustable rate mortgages, and HHC 2018 is coming up at the end of the month (http://hhuc.us/2018/). 

Eddie

All original content copyright, © 2011-2018.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author.  Please contact the author if you have questions.

Symmetric Quartic Equation - Python

Symmetric Quartic Equation - Python Note: The code is programmed with a TI-84 Evo. No modules are used, so the scripts should be adopt...