[CSCI2321] Re: 16 bit adder input

John Howland jhowland at ariel.cs.trinity.edu
Fri Feb 24 12:32:14 CST 2006


On Thu, 23 Feb 2006, Tim Nunamaker wrote:

> Hi Dr. Howland,
>
> Jason and I are going over some of the things we talked about in class and 
> how they relate to the assignment. We are trying to figure out how to 
> actually use the 16 bit adder that you showed us in class. For the four bit 
> adder we are able to use input such as the following:
>
> fourBitAdder 0;0;0;1;0;0;1;0;0
> 0 0 0 1 1
>
> for 0001 + 0010 = 0011, which is 1+2 = 3
>
> But how does the 16 bit adder take input? Instead of a seperate argument for 
> each bit, it has this line:
>
> 'a b cin' =: dtb y.
>
> ...and it looks like a, b, and c each become an array or box of bits. Also, 
> somewhere along the way the input gets converted from decimal to binary, so 
> do we enter input in decimal? And how do we format the input?

I know we discussed this after class, but another thing you can always do
is to get the latest copy of my /users/jhowland/.jhistory file and look at what
I did with it in lecture, i.e.,

[jhowland at Ariel jhowland]$ grep sixteen /users/jhowland/.jhistory
sixteenBitAdder 1 1 0
sixteenBitAdder 1 _1 0
sixteenBitAdder 1 _1 1
sixteenBitAdder 32768 _1 1
sixteenBitAdder 32768 1 0
sixteenBitALU 1 1 1
sixteenBitALU 2 1 1
sixteenBitALU
sixteenBitALU 32767      1 0
sixteenBitALU 32767      1 0
# sixteenBitALU 32767      1 0
sixteenBitALU 32767      1 0
sixteenBitALU 32767      1 0
sixteenBitALU rows test
test ,. sixteenBitALU rows test
sixteenBitAdder 2 3 0

John

>
> Thanks
>
> Tim/Jason
>

_______________________________________________________________
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


More information about the CSCI2321 mailing list