Floats should work for sure now

This commit is contained in:
Bartłomiej Szostak 2024-05-01 18:15:50 +02:00
parent fb3ab7491c
commit bbd3c4dea4
No known key found for this signature in database
GPG Key ID: 562DACF230A18086
2 changed files with 5 additions and 3 deletions

View File

@ -124,7 +124,7 @@ package body Shardware is
Mantissa := Mantissa + 1.0;
Result := Sign * Mantissa * (2.0 ** (Exponent - 127));
elsif Exponent = 255 and Mantissa = 0.0 then
Result := 1.0 / Zero;
Result := Sign * 1.0 / Zero;
elsif Exponent = 0 then
Result := 1.0 + Sign * Mantissa * (2.0 ** (Exponent - 127));
else

View File

@ -149,8 +149,10 @@ begin
--Put_Line(Unsigned_32'Image(RegisterU(0)));
--Put_Line(Unsigned_32'Image(RegisterU(1)));
Put_Line(Integer'Image(RegisterI(0)));
Put_Line(Integer'Image(RegisterI(1)));
--Put_Line(Integer'Image(RegisterI(0)));
--Put_Line(Integer'Image(RegisterI(1)));
Put_Line(Float'Image(RegisterF(0)));
Put_Line(Float'Image(RegisterF(1)));
PC := PC + 16; -- increment program counter to next instruction
end loop;