Last visit was: Wed May 22, 2024 3:38 am
It is currently Wed May 22, 2024 3:38 am



 [ 4 posts ] 
 Question: Floating Point for 8 Bit Systems 
Author Message
User avatar

Joined: Sun Dec 19, 2021 1:36 pm
Posts: 75
Location: Michigan USA
Given an 8-Bit homebrew computer with more or less some of the basic assembly language instructions, and a 64KB memory space, what would be a reasonable approach to a model or system for handling floating point numbers? I'm thinking along of the lines of 16 bit, which I see described as half precision

https://en.wikipedia.org/wiki/Half-prec ... int_format

Can anyone point to good reference or discussion on how to code a simple floating point number system? (The simpler the better!) It's also quite fascinating to me the different numbering and coding systems people have devised to represent data, like audio codecs. Thanks! Michael


Sun Mar 03, 2024 12:21 pm WWW

Joined: Sat Feb 02, 2013 9:40 am
Posts: 2095
Location: Canada
Did you have a look at these routines for the 6502?
http://6502.org/source/floats/wozfp1.txt

I have used these in the past. It is a two's complement significand representation instead of sign-magnitude.
It is for 32-bit floating-point IIRC. But the same approach could be used for 16-bit.
The code is reasonably short, probably okay for a micro-controller.

_________________
Robert Finch http://www.finitron.ca


Sun Mar 03, 2024 4:18 pm WWW

Joined: Mon Oct 07, 2019 2:41 am
Posts: 599
Microsoft switched from a 4 byte floating point to a 5 byte floating point with a later version of Basic.


Sun Mar 03, 2024 5:26 pm
User avatar

Joined: Sun Dec 19, 2021 1:36 pm
Posts: 75
Location: Michigan USA
robfinch wrote:
Did you have a look at these routines for the 6502?
http://6502.org/source/floats/wozfp1.txt

I have used these in the past. It is a two's complement significand representation instead of sign-magnitude.
It is for 32-bit floating-point IIRC. But the same approach could be used for 16-bit.
The code is reasonably short, probably okay for a micro-controller.



Thanks Rob. That's just the kind of jump-start I was looking for! I always enjoy looking at code like that.


Sun Mar 03, 2024 11:22 pm WWW
 [ 4 posts ] 

Who is online

Users browsing this forum: claudebot and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software