Name: ______91.101 Computing I Homework 3 Due: Next Class

Fall 2006 Chapter 0 in the ANSI C Book Care about Your Work

Please answer the following.

1) How long did it take you to do this homework? ______minutes

2) Did you do this homework in a well-lit area? ______

3) Did you do this homework in a relatively distraction free location?______

4) Did you make a commitment to do this work with pride? ______

5) Does this homework contain any spelling errors? ______

6) Is this homework neat? Are you being courteous to your reader? ______

7) Are you passing this homework in on-time? ______

Your best friend in this course is your white textbook. Its title is Applications Programming in ANSI C. You need to live with this book. Chew it. Squeeze it, Gnarl it and sleep with it under your pillow. You need to know how to use it as a reference book. You must learn how to read it. We also need to work our way through it systematically. So you will need to use it in two ways. First you will need to bounce around it looking for information and second, you will need to go through it page by page. You can do it.

There are a total of twelve chapters in it numbered 0 through 11. Our goal is to master the information contained within chapters 0 through 9. We also need to know how to extract and use the information in appendix A, appendix D, appendix E, and appendix G.

This homework concerns Chapter 0. Chapter 0 is 29 pages long. There are 6 sections in this chapter.

Question 1: Fill in the table below.

Section / What is the title of this section / How many page long is this section? / How long in minutes did it take you to read the section once?
0.1
0.2
0.3
0.4
0.5
0.6
Total amount of minutes it took you to read Chapter 0 once.

Question 2: From whose name is the word algorithm derived?

Question 3: What is an algorithm?

Question 4: What is the assignment operator?

Question 5: What is the equality operator?

Question 6: How many pages long is section 0.2?

Question 7: The components of a computer system can be divided into

______and ______.

Question 8: At the heart of a computer’s hardware are

______and ______.

Question 9: The three main components of a CPU are:

a) ______

b) ______

c) ______

Question 10: The main memory stores

______and ______.

Question 11: Local scratchpad storage within the CPU are called ______.

Question 12: “Jim, I have looked at and I have thought about Figure 0.3”

Sign here if you did: ______

Question 13: A storage area is considered what if its contents are lost when the power is lost?

Question 14: What is the title of Section 0.3? ______

Question 15: Including the 28 questions given on pages 17 and 18 – how long in pages is section 0.3?

______

Question 16: Section 0.3 is divided into subsections. The subsections have headings that are given in blue font. Please give me the names of the five subsections contained within section 0.3.

a) ______

b) ______

c) ______

d) ______

e) ______

Question 17: Modern digital computers can only store a 0 or a 1. A single 0 or a single 1

is called a binary digit. It is also called a ______.

Question 18: Eight bits make a ______.

Question 19: Main memory consists of a sequence of bytes. Each byte of memory has both a content and an

______.

Question 20: The word integer is spelled I N T E G E R. This word does not contain the letter i. Integers are represented in the computer hardware using the binary or base-2 number system. Your textbook, on pages 9 and 11, identifies two different systems used to represent integers. They do not call them systems – perhaps technique is a better word. They are:

a) ______

b) ______

In addition to these two techniques – there are three other techniques used to represent integers. They are: Signed Magnitude, One’s Complement, and Excess notation.

Question 21: Represent the decimal integer value 62 using 8-bit unsigned binary representation.

______

Question 22: Hexadecimal notation is a shorthand method used to represent a string of 0s and 1s by writing fewer symbols on the paper. You can do this by batching up 0s and 1s in groups of 4 bits starting from the right side and moving left. Each group of four bits is translated according to the table given in Example 0.3.4 on page 10.

“Jim, I have looked at the table and I understand how to convert from unsigned binary to hexadecimal.”

Sign here if you do: ______

Question 23: Express 0011 1111 0001 1001 0011 as a hexadecimal number.

______

Question 24: What is the largest one-byte unsigned binary number. Express your answer using the decimal notation we grew up with.

______

Question 25: On pages 11, 12, and 13 you will find examples 0.3.5, 0.3.6, 0.3.7, and 0.3.8. Please study these four examples – do not just jump over them and think that you do not have to read them closely. After doing so, sign one of the two spaces below.

“Jim, I have read the examples and I understand them.”

Signed: ______

or

“Jim, I have read the examples and I do not understand them.”

Signed______

You will be required to know how to represent, add, and subtract twos complement numbers.

Question 26: On pages 13, 14, and 15 you will find examples 0.3.9, 0.3.10, and 0.3.11. They all concern floating point numbers. I will explain floating point numbers to you in class some day soon. However, I do want you prepared to listen. You should work your way through these three examples. For now, I want you to know that a floating point number is expressed using scientific notation. Scientific notation has three components:

Mantissa

Base

Exponent

Today, computers generally used the IEEE 754 format to represent floating point numbers. The single precision format is 32 bits long. The double precision format is 64 bits long.

I will expect you to know how to take a decimal floating point number, say 53.1219, and then represent it in IEEE 754 format.

“Jim, I am ready, eager, able, and willing to learn how to do this. I will give it my all and I will not whine about it.”

Signed: ______

Question 27: What does the acronym ASCII stand for?

______

Question 28: “Jim I know that a computer program written in a high level language like C needs to be converted into its machine instruction equivalent.”

Signed: ______

Question 29: Section 0.4 is entitled Programming Languages. It introduces the notion that an algorithm can be represented in a high level language, say C, or it could be represented in assembly language, or it can be represented in machine language (1s and 0s). A compiler converts a program written in a high level language into is assembly language equivalent. An assembler converts a program written in assembly language into its machine language equivalent. A linker is responsible for building an executable image. A loader is responsible for moving an executable image and putting it into main memory. A process image is the part of main memory dedicated to an executable image. For us, a process image will contain four areas. They are: Code, Global and Static Data Area, Heap, and the Run-Time Stack.

Got it? Sign here if you do: ______

Question 30: Perhaps the most difficult skill to acquire is loosely discussed in section 0.5. In brief, the skill you need to acquire is how to read a problem specification and then convert it into an algorithm. For some of you this will come easy. For others – this will not come so easy. I cannot help you a whole lot. Experience matters. You just need to begin solving lots of problems and adding solutions to your history. You can learn by reading solutions too. For most problems you need to find the correct insight. This is same situation you were in when your middle and high school math teachers asked you to solve word problems. You must read and reflect. I do believe all of you can do it – but some of you will require time and practice. The good news is – once acquired – you own it. Like bicycle riding.

Will you be up for the programming challenges that lie ahead ?

“Yes Jim, bring them on. Let’s play ball.” Sign here: ______

Question 31: Section 0.6 is entitled, Why C?

List the eight reasons why the authors give for learning C.

Congratulations. If you’ve taken this homework seriously you have now read Chapter 0 for the first time. We have not yet practiced too many problems, but you have started a wonderful journey. Stay committed to learning all that you can. I am here to help you – but you need to do it yourself. You can do it. I am mostly here to show you the way. Let’s be strong. You can be strong. You need to start removing whatever accumulated error is stuck on your back. When distractions come your way – leave them behind and come to Olsen Hall with your textbooks. It would be worth it.

Question 32: