Computer Architecture and Number Conversion Problems
Classified in Electronics
Written at on English with a size of 5.03 KB.
Problem 1: Calculating Clock Rate
When a program is run on Computer X, 50% of the execution time is CPU time. A better Computer Y reduces the execution time by 20%. It is known that Computer Y has a clock rate of 2 GHz, and it takes Computer Y 10% more clock cycles to execute the program. In addition, Computer Y can only reduce CPU time. What is the clock rate in GHz of Computer X? The answer must have exactly one digit after the decimal point, even if it is zero, e.g. 2.0 or 0.9.
[Clock Rate Y - (Clock Rate Y)(Clock Cycle % Y)] - [Clock Rate Y - (Clock Rate Y)(Clock Cycle % Y)][Computer Y Reduction Time]
2 GHz - (2 GHz)(10%) = 1.8 GHz
1.8 GHz - 1.8 GHz(20%) = 1.44 GHz
Answer: 1.4 GHz
Problem 2: Base-2 Fractional Number Conversion
When converting a base-N fractional number 0.a1a2...an-1an to decimal, the formula of a1×N-1 + a2×N-2 + ... + an-1×N-(n-1) + an×N-n is used. Given a base-2 number 0.11001111111, what is the value of am×N-m for m being 5? If the answer has more than 15 digits after the decimal point, round and keep only 15 digits after the decimal point.
Digit = Count m digits from the right of the base-x integer starting with 0
0.110011111112
= 1 / [Digit*(base number integer)m]
= 1 / [1*(2)5]
= 1 / 32
= 0.03125
Answer: 0.03125
Problem 3: Decimal to Base-2 Conversion
When converting the decimal integer 112 to base-2 using the subtraction method, a number of non-zero integers will be subtracted from the integer to be converted. Show those integers from large to small, separated by a comma.
112 - 26 = 48; 26 = 64
48 - 25 = 16; 25 = 32
16 - 24 = 0; 24 = 16
Answer: 64, 32, 16
Problem 4: 9-bit Binary Sequence (Negative)
Given a 9-bit binary sequence 110111010, show the decimal integer it represents in sign magnitude, one's complement, two's complement, and excess-255 respectively in the given order, separated by a comma.
The first three answers will be negative and the excess will be positive
Sign Magnitude: Take 1 at the beginning off the binary number and convert it to decimal and make it negative
110111010 = 10111010
2 + 8 + 16 + 32 + 128 = -186
One’s Complement: Take the sign-magnitude binary number, set the 1 at the beginning aside, and switch the numbers (1 = 0, 0 = 1)
110111010 = 01000101
1 + 4 + 64 = -69
Two’s Complement: Subtract 1 from one’s complement
-69 - 1 = -70
Excess-Number: Convert the whole binary number, including the 1 at the beginning, subtract the excess from that number.
110111010 = 442
442 - 255 = 187
Answer: -186, -69, -70, 187
Problem 5: 9-bit Binary Sequence (Positive)
Given a 9-bit binary sequence 011000101, show the decimal integer it represents in sign magnitude, one's complement, two's complement, and excess-255 respectively in the given order, separated by a comma.
Sign Magnitude: Convert binary to decimal
011000101 = 1 + 4 + 64 + 128 = 197
One’s Complement and Two’s Complement: Same as sign magnitude for positive numbers, so 197
Excess-255: Subtract the excess number from the sign magnitude
197 - 255 = -58
Answer: 197, 197, 197, -58
Problem 6: Representing -134 in 9-bit
Show the decimal integer -134 in 9-bit sign magnitude, one's complement, two's complement, and excess-255 respectively in the given order, separated by a comma.
Sign Magnitude: Convert 134 to binary and add a 1 at the beginning
10000110 = 110000110
One’s Complement: Take the sign-magnitude binary number, set the 1 at the beginning aside, and switch the numbers (1 = 0, 0 = 1)
110000110 = 101111001
Two’s Complement: Take one’s complement and add 1
101111001 + 1 = 101111010
Excess-Notation: Excess number - positive decimal integer = answer in binary
255 - 134 = 121
121 to binary = 001111001
Answer: 110000110, 101111001, 101111010, 001111001