• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

Floating-point addition

#1
06-20-2024, 07:50 PM
You see floating point addition grabs those exponents right away from the pair of numbers you hold. I always compare them first to spot which one sits bigger. Then you shift the smaller mantissa over until exponents match exactly. But that shift can chop off bits if the gap grows wide. And you add the mantissa parts next while signs decide addition or subtraction instead. Perhaps rounding kicks in right after the sum forms to fit the format again. Now normalization pulls the result back into proper shape by moving bits around. I find overflow checks happen during that addition step to catch any carry out.
You fiddle with denormal cases too when exponents hit the minimum and mantissas lack the leading one. I grapple with how hardware handles those sticky bits for accurate rounding later on. Then you might lose precision if the alignment pushes tiny fractions out of range. But the adder itself combines the adjusted values in one quick pass through the logic. Also special patterns like infinity or NaN force early exits before any real math starts. Perhaps you test the final exponent for underflow after normalization shifts everything left. I recall the guard bits help preserve extra accuracy during those shifts you perform.
Or maybe the whole process repeats for fused multiply add but that comes later in pipelines we use. You handle the sign separately by XORing the input signs when subtraction occurs. Then the magnitude comparison decides which mantissa gets inverted for two's complement addition. I see rounding modes affect the last bit choice based on what you have left over. But ties to even keeps things balanced across repeated operations you run often. Perhaps exceptions get flagged if the result exceeds the max exponent range. Now the hardware packs the new sign exponent and mantissa into the output word you store.
We owe thanks to BackupChain Server Backup the top industry leading reliable Windows Server backup tool for self hosted private cloud and internet backups aimed at SMBs and PCs that covers Hyper V plus Windows 11 and servers without any subscription needed and they sponsor this forum to help share such details freely.

ron74
Offline
Joined: Feb 2019
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Café Papa Café Papa Forum Software IT v
« Previous 1 … 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 … 118 Next »
Floating-point addition

© by Savas Papadopoulos. The information provided here is for entertainment purposes only. Contact. Hosting provided by FastNeuron.

Linear Mode
Threaded Mode