Fall Semester 2005: September 8, 2005 - December 12, 2005
Out on:
September 12, 2005
Due by:
September 18, 2005 by 5:59 pm for full credit (11:59 pm for 10% off, hard deadline)
Collaboration:
None
The first assignment for 600.102: Foundations of Computer Science covers material from Week 1 and the corresponding reading.
Assume you have an infinite supply of the "boxes" we used in lecture for numeric computations: constants, addition, multiplication, and square root. Now consider the following:
Describe how you can determine the number of directories (not files,
only directories) in a given directory by using the
ls, grep, and wc commands only.
The commands should be connected through a pipe which
is written as | in the Unix shell.
In lecture we discussed in some detail how to add two binary numbers in twos-complement representation. For this problem you need to give a description of how to multiply two numbers in twos-complement representation. The level of detail should be similar to what we did in lecture. You can use the "standard" method for doing multiplication of decimal numbers with suitable adaptation to binary numbers. Note that multiplication can involve addition as a step, but the number of additions should be given by the length of the binary numbers, not by the value they represent. Try to be as exact as possible, try to not forget a step anywhere.
You should include an example as well, but the process you describe should be generic and work for any two binary numbers.
Finally, please summarize briefly why you are taking this course and what topics (or kinds of topics) would be of interest to you. Thanks! :-)
Please turn in a simple Unix text file (not M$ Word, not PDF, just
plain ASCII text) with your answers. It should be formatted in a
decent way of course, and it should contain your contact information.
The file name should be cs102-assignment-1-login
with login replaced by your Unix login name
(so I would use cs102-assignment-1-phf).
If you really want to impress us, try the following. From the IRS website: "Filing Late and/or Paying Late: Information You Should Know" What exactly is the meaning of the connective "and/or"? Do you think that using "and/or" is good writing style? Is it logical? Note that we won't give you extra points for this, but we'll give you extra kudos. :-)