Go to last post By: charliecoultas
Today 08:15
Forum: The Lounge
Starter: RGV250
Views: 0
Replies: 3
Go to last post By: AlbertoFS
Today 07:07
Forum: Proton Plus Compiler v3
Starter: Dave-S
Views: 0
Replies: 16
Today 02:00
Forum: New devices and techniques
Starter: normnet
Views: 0
Replies: 1
Go to last post By: John Drew
Today 00:04
Forum: The Lounge
Starter: fanie
Views: 0
Replies: 14
Yesterday 17:34
Forum: Proton 24
Starter: johngb
Views: 0
Replies: 5
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Floating Point Overflow39 days old

  1. #1
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,032
    Thumbs Up
    Received: 32
    Given: 34
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Floating Point Overflow

    Could somebody give me a hand please? I am dipping my toes into the world of 64 bit floating point, but the manual says that:

    _FP_FLAGS.1 ' Floating point overflow
    _FP_FLAGS.2 ' Floating point underflow

    ..are system variables that will inform me of overflow/underflow. But I get a compiler error saying "_FP_FLAGS not found".
    Compiler vsn 3.5.9.3 2.0.3.3 and the chip is 24HJ128GP502

    Any help happily received.

    Charlie

    Device = 24HJ128GP502 ;24 bit jobbie
    Declare Xtal = 79.23
    Declare Stack_Size = 200
    Declare Hserial1_Baud = 9600 ;the diagnostic port IN
    Declare Hserial2_Baud = 9600 ;port IN
    Declare HRSOut1_Pin = PORTB.8 ;this is pin 17
    Declare HRSOut2_Pin = PORTB.10 ;
    Declare Optimiser_Level = 2 ;recommended by Les
    Declare Dead_Code_Remove = On ; .. .. ..
    PLL_Setup(43, 2, 2, $0300) ;Configure the Oscillator to operate at 79.23MHz

    Symbol ram_clk PORTB.3 ;SPI CLK to sram chip clock
    Symbol ram_dout PORTB.2 ;input to sram chip, output of PIC
    Symbol ram_din PORTB.4 ;output of sram chip, input to PIC
    Symbol ram_ce PORTA.4 ;SPI CS to .. .. /E

    _FP_FLAGS.1 = 0

  2. #2
    Developer Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,178
    Thumbs Up
    Received: 215
    Given: 77
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    _FP_FLAGS is only for 32-bit floating point. Sorry that the manual isn't clear on that Charlie.

    I never got round to adding error flags for 64-bit types, as I worked around division by 0 because I still think division by 0 is not an error! Overflow will be difficult with 64-bits and underflow is also managed within the code itself.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  3. #3
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,032
    Thumbs Up
    Received: 32
    Given: 34
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    Thanks Les. I can probably get away with 32 bit FP instead.

  4. #4
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,888
    Thumbs Up
    Received: 73
    Given: 25
    Total Downloaded
    1.37 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    G'day Charlie,
    I've used 64 bit arithmetic with the same chip for some very complex calculations where accuracy is critical and it works beautifully. Where there is a possibility of a divide by zero I just put a test like: If Var1<0.0000001 then Var1=0.0000001 and all is sweet. In my use the issue came up in a recursive routine solving a Keplarian equation.
    John

  5. #5
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,032
    Thumbs Up
    Received: 32
    Given: 34
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    G'day John

    I am writing an emulator for the Elliott 803B - the first fully transistorised computer. The word length is 39 bits and floating point is held as:

    Sign 9 bits exponent 29 bits mantissa The exponent has a bias of 256

    I am not after really high accuracy but I've never done much with floating point, not to this level. I want to take an 803 "instruction" and emulate it.

    I think it will be OK to use 32 bit floating point and chop a few bits off.

    I'm using a 2424HJ128GP502 with a 1Meg bit SRAM attached - the 803 memory is 8192 words of 39 bits.

    Thanks for your help, I might come back and ask you some more later (when I know what I don't know!)

    Regards
    Charlie

  6. #6
    Article Author johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,077
    Thumbs Up
    Received: 55
    Given: 0
    Total Downloaded
    1.09 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    What, not using a core memory???
    I used to work on the Elliott 920, the first computer to have Autonomous Memory access as far a I know.
    At the time it seemed so cutting edge!
    JohnB

  7. #7
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,032
    Thumbs Up
    Received: 32
    Given: 34
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    I'd LOVE to use core memory John but that would involve so much work, I'm lazy.

    I'm not usually nostalgic but the 803B holds special memories for me.

    Charlie

  8. #8
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,888
    Thumbs Up
    Received: 73
    Given: 25
    Total Downloaded
    1.37 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    I remember a cube of core memory being passed around a Physics class when I was in first year uni and we all marvelled at its wonderful miniaturisation. It would have stored a few hundred bits I guess. Memory is a bit hazy but it was about 1958 so its okay to be vague on details. Sounds a great project Charlie. Did you get your facial recognition project finished?
    John

  9. #9
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,032
    Thumbs Up
    Received: 32
    Given: 34
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    We have a memory "cube" on display at the museum. It's about 10" high and 8" on each side. You can see the top layers of ferrite cores, there are 4096 x 40 of them: 163,840, all assembled by hand!

    Yes, I got the facial recognition board going but never did much with it. It was attached to my Turing Test demonstration but it turned out to be a bit of a gimmick. (I just noticed that the forum spellchecker hasn't heard of ferrite! Or else I can't spell it.)

    Best
    Charlie

  10. #10
    Article Author johngb's Avatar
    Join Date
    Oct 2003
    Posts
    2,077
    Thumbs Up
    Received: 55
    Given: 0
    Total Downloaded
    1.09 GB

    0 Not allowed!

    Default Re: Floating Point Overflow

    Elliott's used to use Spanish lace makers to lace the cores, three wires had to pass through each core.

    The 920B computer was a military grade machine, It was really futuristic in design, totally monolithic is design it opened up like a clam shell and every logic module was encapsulated in a solid resin block and each block plugged into multi-layer back plane constructed of flexible printed circuit which bridged the two sides for the clam shell. It was packaged to go in an aircraft.
    JohnB

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Floating point anomaly?
    By joesaliba in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 20th January 2015, 22:27
  2. [SOLVED !] Floating point to Byte?
    By Russ_Meyer in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 28th August 2009, 20:55
  3. Floating point resolution
    By shantanu@india in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 9th January 2008, 13:41
  4. Floating point errors
    By Dave-S in forum Proton Plus Compiler v3
    Replies: 6
    Last Post: 4th June 2007, 21:20
  5. [SOLVED !] floating point precision
    By ryan.reeve in forum Proton Plus Compiler v3
    Replies: 14
    Last Post: 30th June 2006, 22:20

Members who have read this thread : 32

Actions :  (Set Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts