95%(21)20 out of 21 people found this document helpful
This preview shows page 2 - 4 out of 9 pages.
8. Twos complement notation:(a) Has two representations of zero.(b) Has one representation of zero.(c) Is the current standard in computer architecture.(d) Both (b) and (c).9. Which of the following should be performed for good programming practice.10. A floating point number is representing using:Question 2 (10 points)Discuss the benefits and disadvantages of the following computer systems components. One benefit and one disadvantage (one point for each). ONLY one sentence for a benefit or disadvantage.1. Register file.Benefit: Quickly accessible.Disadvantage: Small capacity.2. Main memory.Benefit: Large capacity.Disadvantage: Slow access.3. Dynamically allocated memory (memory allocated using malloc( )).Benefit: Available for all function invocations.Disadvantage: Must be freed or memory leaks occur.
4. Sign and magnitude representation.Benefit: Easy to understand.Disadvantage: Two copies of zero.5. Secondary storage (e.g., hard-disk).Benefit: Massive capacity and persistent.Disadvantage: Extremely slow.Question 3 (4 points)A device is connected to a computer that can return various temperatures related to the weather. The GetTemps function returns the daily high temperature in bits 20–29, the daily low temperature in bits 10–19, and the current temperature in bits 0–9, all as 10-bit integers.In the following program fragment, lines 8 and 9 are incomplete. They should store thehigh temperature in highTemp and the current temperature in currTemp, so that these temperatures can be printed in line 10. Please complete lines 8 and 9, and implement code efficiently.