v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

Editing v0.34:Adder (Computing)

Jump to navigation Jump to search

Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.

You are editing a page for an older version of Dwarf Fortress ("Main" is the current version, not "v0.34"). Please make sure you intend to do this. If you are here by mistake, see the current page instead.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 83: Line 83:
  
 
==Look-ahead carry==
 
==Look-ahead carry==
While a simple adder is capable of reliable addition, it can be extremely slow.  Consider a 8-bit adder: the value of the 8th bit depends on the carry derived from the 7th bit, which in turn depends on the carry derived from the 6th bit, and so on.  The entire addition has to be carried out sequentially, rather than adding the bits in parallel.  Because of the way the carry ripples through the value, such systems are called ''ripple carry adders.'' When water or creatures are used in the circuits, this can mean a day or more to add two 8 bit values.  However, the process can be improved considerably, at the expense of greater complexity, by implementing a look-ahead system.
+
While a simple adder is capable of reliable addition, it can be extremely slow.  Consider a 8-bit adder: the value of the 8th bit depends on the carry derived from the 7th bit, which in tun depends on the carry derived from the 6th bit, and so on.  The entire addition has to be carried out sequentially, rather than adding the bits in parallel.  Because of the way the carry ripples through the value, such systems are called ''ripple carry adders.'' When water or creatures are used in the circuits, this can mean a day or more to add two 8 bit values.  However, the process can be improved considerably, at the expense of greater complexity, by implementing a look-ahead system.
  
 
Look ahead systems break the values up into sequences of bits, based on the fact that if both values of the nth bit are 0 ((NOT[n])AND(NOT[n'])), any carry will end at that bit, and that if both values are 1 ([n]AND[n']), that bit will generate a carry.  Based on this, it's possible to process, in parallel, the addition of various bit-lengths based on the knowledge that carries will not propagate past a carry-ending bit.  This can vastly improve the time necessary to add two values.
 
Look ahead systems break the values up into sequences of bits, based on the fact that if both values of the nth bit are 0 ((NOT[n])AND(NOT[n'])), any carry will end at that bit, and that if both values are 1 ([n]AND[n']), that bit will generate a carry.  Based on this, it's possible to process, in parallel, the addition of various bit-lengths based on the knowledge that carries will not propagate past a carry-ending bit.  This can vastly improve the time necessary to add two values.

Please note that all contributions to Dwarf Fortress Wiki are considered to be released under the GFDL & MIT (see Dwarf Fortress Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)