CONCORDIA UNIVERSITY
COMP 228
DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING
Fall 2009
ASSIGNMENT 1
Due: Oct 1, 2009 ___________________________________________________________________________________ 1. von Neumann Architecture [20%] (a) The von Neumann architecture contains three key functional blocks: (i) memory, (ii) processor and (iii) input/output. Concisely explain the roles played by these functional blocks in ‘executing’ a program in the von Neumann paradigm. (b) Explain the roles played by the ‘registers’ and the ‘program counter’ inside a processor. Which of these two must be present in the von Neumann model? Why? (c) An architect refines the memory block of the von Neumann architecture by partitioning the memory into two distinct blocks, one for storing program code and the other for storing program data. Suggest a key advantage of such a design. Suggest a key disadvantage of such a design. 2. Levels of Abstraction and Moore’s Law [20%] (a) What is the motivation behind creating a hierarchy of abstractions of a computer system? (b) The machine layer is sometimes referred to as the ISA (instruction set architecture) layer, abstracted by the instruction set that a machine language programmer uses in program development. The control layer below it implements the machine layer using a set of components some of which are hidden from the ISA layer. Which of the following components exist in the control layer but not (visible) in the ISA layer? (i) program counter, (ii) cache, (iii) ALU, (iv) RAM chips. (c) In an exactly analogous manner, some of the components in the assembly language layer are hidden from the high level language layer. Which of the following components exist in the assembly language layer but not in the high level language layer? (i) program variables, (ii) program counter, (iii) registers. (d) Moore’s Law is a postulate on the scale of integration of transistors in a chip. (i) Suppose we started with 10000 transistors in a chip in year 1 to build a very simple 4-bit processor [with 4-bit registers, ALU]. How many transistors will a chip contain after 30 years? If we can scale a processor correspondingly from 4bit to k-bit after 30 years, what will be the value of k? If for practical reasons we restrict k ≤ 128, how many such 128-bit processors can be implemented on a single chip? (ii) Why was parallel processing not a necessity in third generation computers but a necessity in later generations, especially in recent years?
COMP 228 (System Hardware), Fall 2009 ⎯ Assignment 1
Page 2
3. Conversion to Computer World and 2’s Complement Addition [24%] Assume a 32-bit word on a given computer. (a) How would the computer represent the unsigned decimal value 291 in a word? Express your answer in hexadecimal form. (b) Assuming 2’s complement representation is used, how would the computer represent the signed decimal value –291 in a word? Express your answer in hexadecimal form. (c) Perform 1 – 291 in 2’s complement. Show the detailed steps performed in both binary and hexadecimal forms, starting with the 2’s complement representation of 1 and 291 respectively. (d) If our computer uses 8-bit ASCII, how would the computer represent the character string 291 in a word? Repeat it for the character string – 291. (e) Suppose 2’s complement arithmetic is used in computing 291 + x. Find the smallest value of x that would cause overflow. (f) Explain why subtracting a positive integer from another positive integer will never overflow. 4. Conversion to the Human World [18%] Suppose a 32-bit word on a computer contains the hexadecimal data 30324E5C. This word can also be interpreted as two half-words, 3032 and 4E5C respectively. (a) If the full word (32 bits) is an unsigned integer, what is its actual decimal value? Repeat the problem for the two half-words separately. (b) If the full word is a 2’s complement integer, what is its actual decimal value? (c) If the above data is 8-bit ASCII character string, what is the actual string? (d) If someone ‘steals’ the content of the memory that contains words such as the one above, what difficulties he may face in interpreting the content? 5. Error Correcting Code [18%] Suppose we want an error-correcting code that will allow all single-bit errors to be corrected for memory words of length 32. Consider the 32-bit data word 0100600A. (a) If a single parity bit is used for the 32-bit word, under the even parity invariant, what is the value of the parity bit? Why is a single parity bit not adequate to locate an error bit (for example, when the most significant bit is erroneously toggled from 0 to 1)? (b) Under the Hamming SEC, how many parity bits are needed for the 32-bit word? Determine the value of these parity bits. (c) Suppose the least significant bit of the 32-bit data word is incorrectly toggled (from 0 to 1). Explain how the parity bits in (b) can be used to detect and correct the error.
2