Last time | Next time |
I put my solutions up with the caveat that I didn't add the reasons for my steps. Consider it an exercise to the reader to fill those in...:) I may have also combined a few steps at once.
A few of you had solutions more elegant than mine. Kudos to you if you found one!
Eric emailed, and got his login restored. Others?
I know that some of you didn't get your logins for the wiki. When you're ready email me and I'll activate it. That way we'll know that it's just been sent out.
I've made a handout, so that you can play along.
So if you want to try the binary adder I created, here ya go. And it's easy enough to build other little machines (but there are certain pains, because we're using a tool which really wasn't intended for this...:)
This writes the input vectors for random integers (with padding), and tells what settings to fix, etc. Also the expected output, so one can confirm that the machine is working....
This was fun to program, but probably more trouble than it was worth. A direct approach, as in my implementation of Bellman-Ford below, would have been simpler to code. But, if I can do something recursively, I probably will...:)
If you check out this code, you'll see where I compute the power set ("all-subsets") of a set, to cover all the bases. I think that the end result is pretty beautiful, too!
(coded up following our author's algorithm, in section 3.3, p. 214, as closely as possible).