Week 5 Assignment
ITEC625 MIDTERM DUE OCT. 21 NAME:___________________
I. Multiple Choices – Choose Only One Answer (2 points each, 30 points total)
1. For 8-bit sign-and-magnitude numbers, which of the following is correct?
A) The most significant bit has a weight of 26
B) The representation range is −128 to +127
C) The representation range is −127 to +128
D) To calculate −x from x, we flip all the bits and subtract 1
2. The von Neumann architecture has which of the following features?
A) Programs cannot be modified while the processor is running
B) Data and programs have separate address space
C) Each machine instruction contains the address of the next instruction
D) Programs have to be stored in a memory addressable by location
3. The processing of a program does not required which of the following:
A) instruction cycle B) fetch cycle
C) execute cycle D) packet cycle
4. In ________ representation the rule for forming the negation of an integer is to invert all the bits.
A) two’s complement B) sign-and-magnitude
C) biased D) one’s complement
5. ________ is when the result may be larger than can be held in the word size being used.
A) Underflow B) Arithmetic shift
C) Overflow D) Partial product
6. In IEEE Standard 754, negative numbers greater than -2-149 could cause ________.
A) negative underflow B) negative overflow
C) positive underflow D) positive overflow
7. In a Little Man Computer, any loop program must include which of the following instruction:
A) ADD B) SUBTRACT
C) BRANCH D) OUTPUT
8. The ________ extracts instructions from ________ and decodes them.
A) arithmetic / logic unit, I/O devices B) control unit, I/O devices
B) arithmetic / logic unit, memory D) control unit, memory
9. Which of the following about IEEE 754 single precision floating point numbers is correct?
A) 0000 000116 is the largest denormalized number.
B) The exponent is represented in two’s complement.
C) The number 1.11110 × 102 can be represented with no precision loss.
D) Integers larger than or equal to 2128 can not be exactly represented.
10. When using binary multiplication to calculate 1101 × 101, the carry bit happens ___ times.
A) one B) two
C) three D) four
11. Using binary division, the remainder of 11000000000/1011 is:
A) 011 B) 010
C) 101 D) 111
12. Using hex addition table in homework, the carry bit happens ___ times in 1FF9 + F7.
A) one B) two
C) three D) four
13. If we use 20-bit two’s complement to store the result of 2E26 × 4A, does it cause overflow?
A) Yes B) No
14. Using the division method to convert 1234510 to base 16, ______ division iteration(s) is/are needed.
A) one B) two
C) three D) four
15. Which of the following properties belongs to CISC but no in RISC:
A) Fixed format instructions
B) Single register set
C) Few instructions and mode
D) Complexity is in the compiler
II. For each statement below, Explain Why It is True or False (2 points each, 1 point for correct answer of True or False, another 1 point for explanation, 20 points total)
1. In IEEE 754 single precision floating point standard, 8000 000016 represents the number −0.
2. In von Neumann architecture, a program must be loaded from secondary storage to main memory.
3. Addition and subtraction can be performed on numbers in one’s complement notation by treating them as unsigned integers.
4. One drawback of two’s complement representation is that there are two representations of 0.
5. Both sign-and-magnitude representation and two’s complement representation use the most significant bit as a sign bit.
6. RISC systems typically have a small ISA (fewer instructions) but make up for it with faster hardware.
7. Control unit carries out the logic operations required by the instructions being executed by the computer system.
8. When you want to represent -0.0000000000001 as an 8-bit float point number but the float point system cannot represent it due to limit of bits, you have a negative overflow.
9. Superscalar architectures allow several instructions to be issued and completed per clock cycle.
10. The value of a signed integer is interpreted as the magnitude of its underlying binary pattern.
III. Short Answers (4 points each, 32 points total)
1. Explain the difference between lossless and lossy data compression. Which type normally provides a smaller file? What is ‘‘lost’’ in lossy audio data compression? Under what circumstances is it impossible to use lossy data compression?
2. Convert the following numbers from decimal to binary and then to hexadecimal (Don’t use IEEE 754 format for this question):
a. 31.875
b. 4128.3125
3. Carefully describe the advantages and disadvantages of master-slave multiprocessing and symmetric multiprocessing. Which would you select for fault-tolerant computing? Why?
4. Give an example that shows the disadvantage of using a sign-and-magnitude format for manipulating signed integers.
5. Represent 127.625 in a 32-bit IEEE 754 format.
6. Why are there two different registers (MAR and MDR) associated with memory? What are the equivalents in the Little Man Computer?
IV. 2’s Complement (4 points each, 16 points total)
Using 4-bit two’s complement numbers for questions (a) & (b), show how to represent the following operations and their results. If operation cannot be done, explain why.
a. 5 – 8
b. 12 – 5
c. Let the decimal numbers A= 66, B= –65, give their 8-bit 2’s complement representation.
d. Compute A–B in 2’s complement, and explain the steps of your solution. If there is any problem in finding the solution, explain as well .
V. Little Man Computer (5 points each, answer ONLY TWO QUESTIONS, 10 points total)
Using the Little Man Computer and Instruction Set, answer ANY TWO of the following three questions:
1. Write a program that asks for 3 numbers (say, A, B, and C) and then calculate –A–B–C. Output the result.
2. Write a program which outputs the numbers 9,8,7,6,5,4,3,2,1,0 then stops.
3. The following program tries to find the positive difference between two input numbers, read the code to check whether there are some errors and correct them (without using more DAT mail boxes, that is, data location is only the cell 99).
Mailbox Mnemonic code Numeric code
00 IN 901
01 STO 99 399
02 IN 901
03 SUB 99 299
04 BRP 06 806
05 ADD 99 199
06 OUT 902
07 COB 000
… … …
99 DAT 00 000