[Csci1301] question re: lab 3
Stafford, Christian
Christian.Stafford at Trinity.edu
Wed Oct 6 12:12:23 CDT 2004
Dr. Howland:
I am struggling with how to make the 4 bitAdder for lab 3. In J I have made the following definition:
fourBitAdder=: monad define script
('a3' ; 'a2' ; 'a1' ; 'a0' ; 'b3' ; 'b2' ; 'b1' ; 'b0' ; 'cin') =. y.
t0 =. twoBitAdder a3, a2, b3, b2, cin
t1 =. twoBitAdder a1, a0, b1, b0, wireOutput 0 ; t0
(wireOutput 0 1 ; t1), wireOutput 1 ; t0
)
This is obviously incorrect because when I give it a 9 bit number input it gives me a 3 bit number in response. I guess I am stuck with how to use my manipulated definition for the twoBitAdder in a definition for my fourBitAdder.
Thank you for your help.
Christian
More information about the CSCI1301
mailing list