[CSCI2321] sixteenBitAdder

John Howland jhowland at ariel.cs.trinity.edu
Mon Feb 14 15:13:47 CST 2005


On Mon, 14 Feb 2005, John Howland wrote:

> I have attached a copy of 16b-adder.js which has been modified

The code inside of SixteenBitAdder can be cleaned up a bit (since
cin is no longer an argument) to not name the binary values
until after applying dtb.  I have attached this model.

> since class time.  Note:
> 
> 1)  The file now loads the file circuits.js
> 2)  I have eliminated the cin argument of SixteenBitAdder for reasons
>     which are explained in the code comments.
> 3)  A couple of definitions have been added to the model to facilitate
>     testing.  One new word (transpose) has been used in building test
>     cases.
> 
> The question I left you at the end of class is:
> 
> "What changes need to be made to support signed arithmetic?"
> 
> Hint:  signed arithmetic is implemented using 2's complement
> arithmetic, which requires ignoring the carry output from
> or adder circuit. So ...
> 
> You should add other test cases to the test suite and make
> appropriate changes to SixteenBitAdder.
> 
> 

-- 
_______________________________________________________________
John E. Howland       url: http://www.cs.trinity.edu/~jhowland/
Computer Science    email: jhowland at ariel.cs.trinity.edu
Trinity University  voice: (210) 999-7364
One Trinity Place     fax: (210) 999-7477
San Antonio, Texas  78212-7200
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 16b-adder.js
Type: application/x-javascript
Size: 1142 bytes
Desc: 
Url : http://www.cs.trinity.edu/pipermail/csci2321/attachments/20050214/d772cb8c/16b-adder.js


More information about the CSCI2321 mailing list