COMP 105: HW #5
You are welcome to discuss these questions with your classmates, the
instructor, or a TA. However, If you make use of any outside
information in answering these questions, or if you receive help from
anyone, you need to acknowledge that along with your answer.
PART 1: Homework Exercises
* These questions are taken from A Balanced Introduction to
Computer Science, David Reed, 2005.
- Consider the following tasks: (1) adding 100 numbers stored in
main memory, and (2) adding a number to itself 100 times. Although
both tasks require 100 additions, the second would be executed much
more quickly than the first would. Why?* (2pts)
- Describe at least one advantage of assembly languages over machine
- Describe two advantages of high-level language programming over
machine language programming.* (2pts)
- What is the difference between a compiler and an interpreter?* (2pts)
- What is the difference between a compiler and an assembler?* (2pts)
- Provide both the Boolean formula (in terms of a and b) and the truth
table for the output z of the following circuit: (4pts)
- A 3-input majority function has an output of 1 if and only if
at least two of its three inputs are 1.
Construct a truth table for a 3-input majority function, and draw a
circuit that implements the truth table.(4pts)