Computer Organization & Architecture 2024 Q&A
Q1.Convert the two decimal number X and Y to IEEE754 single precision arithmetic and then perform the floating point arithmetic to give the result Z in normalized floating point representation. Mention only 13 bits in the fraction part. X=345.25 and Y=250.875 Z=X+Y
- Convert to binary:
- Convert to binary:
So, in binary is .
Now, let's normalize it:
In IEEE754, the exponent is represented using bias notation. The bias for single precision is . So, the exponent for will be which in binary is .
The fractional part (mantissa) is , but we only need 13 bits, so it becomes .
Thus, in IEEE754 single precision format is:
For :
- Convert to binary:
- Convert to binary:
So, in binary is .
Now, let's normalize it:
The exponent for will be , which in binary is .
The fractional part (mantissa) is , but we only need 13 bits, so it becomes .
Thus, in IEEE754 single precision format is:
Performing Floating Point Addition:
We'll add these two numbers in floating-point representation.
We need to align the exponents first. has a larger exponent, so we'll shift 's mantissa to the right and decrease its exponent accordingly.
After aligning the exponents:
Now, we can simply add the mantissas:
Performing addition:
Now, let's normalize this result. The exponent will be , and the mantissa will be .
Converting back to Decimal:
in binary is .
Converting this back to decimal:
This is the normalized form of the result in IEEE754 single precision arithmetic.
Q2. Use Booth's algorithm to multiply two signed numbers, negative 9 and positive 2 to give the result (2X-9 = -18) where -9 is the multiplier and 2 is the multiplicand.
Here's how we can use Booth's algorithm to multiply -9 and 2:
Step 1: Convert numbers to binary:
-9: (4-bit representation) 2: (4-bit representation)
Step 2: Extend the numbers to the same number of bits (here, 5 bits):
-9: (Original) 2: (Padded with one zero on the left)
Step 3: Perform Booth's Algorithm Multiplication:
Initialize:
- Product = 00000
- Multiplier = 10010 (Negative 9 in Booth's algorithm)
- Multiplicand = 00010 (2)
Iteration 1:
- Last Bit = 0, Skip
- Second Last Bit = 1, Add Multiplicand (00010) to Product
- Product = 00000 + 00010 = 00010
- Shift Right
- Multiplier = 11001
- Product = 00010
Iteration 2:
- Last Bit = 1, Subtract Multiplicand (00010) from Product
- Product = 00010 - 00010 = 00000
- Second Last Bit = 0, Skip
- Shift Right
- Multiplier = 11100
- Product = 00000
Iteration 3:
- Last Bit = 0, Skip
- Second Last Bit = 0, Skip
- Shift Right
- Multiplier = 11110
- Product = 00000
Iteration 4:
- Last Bit = 0, Skip
- Second Last Bit = 0, Skip
- Shift Right
- Multiplier = 11111
- Product = 00000
Step 4: Interpret the Result:
The result of multiplying -9 and 2 using Booth's algorithm is 00000 in binary, which is 0 in decimal.
So, according to the provided information, the result is not equal to -18. Therefore, there might be a mistake in the provided problem statement or the calculation.
Q3. A zero address(stack) machine has the following instruction set for coding PUSH M, POP M, ADD,MUL,SUB,DIV
Q4. When comparing two computer C1 and C2, C1 has the machine instructions for the FP operations, while C2 has not . The clock frequency on both computers is 200 MHz. In both cases, we run the same programme, which includes the following commands.
Type the command Dynamic Share of Instruction duration (CPLi)
Instructions in program(pi) C1 C2
FP addition 18% 8 18
FP Multiplication 12% 10 34
FP Division 6% 6 62
Non- FP instruction 64% 3 3
a) Calculate the MIPS for C1 and C2.
b) Calculate the CPU program execution time on the computers C1 and C2, if there are 14000 instructions in the program?
c) Find the ratio of average CPI if two independent improvements are made in C2, if in 1st case FP multiplication is improved so that it takes only 10 cycles and others all remaining the same or in the 2nd case FP division instruction is improved and it takes only 12 cycles.
Answer:
a)
a) Calculate the MIPS for C1 and C2:
MIPS (Million Instructions Per Second) is calculated using the formula:
Where CPI is the Average Cycle Per Instruction.
For C1:
For C2:
b) Calculate the CPU program execution time on the computers C1 and C2:
The CPU program execution time (in seconds) is calculated using the formula:
For C1:
For C2:
To solve this problem, let's break it down into steps:
a) Calculate the MIPS for C1 and C2:
MIPS (Million Instructions Per Second) is calculated using the formula:
Where CPI is the Average Cycle Per Instruction.
For C1:
For C2:
b) Calculate the CPU program execution time on the computers C1 and C2:
The CPU program execution time (in seconds) is calculated using the formula:
For C1:
For C2:
c) Find the ratio of average CPI if two independent improvements are made in C2:
Improvement 1: FP multiplication improved to 10 cycles
- New
Improvement 2: FP division improved to 12 cycles
- New
Ratio of average CPI:
- For improvement 1:
- For improvement 2:
Let's calculate these values.
Q5. (A) a. Consider a 32-bit microprocessor, with a 16-bit external data bus, driven by an 8-MHz input clock. Assume that this microprocessor has a bus cycle whose minimum duration equals four input clock cycles. What is the maximum data transfer rate across the bus that this microprocessor can sustain, in bytes/s? To increase its performance, would it be better to make its external data bus 32 bits or to double the external clock 3124-2022 frequency supplied to the microprocessor? Explain to substantiate the approach.
Given:
- Bus cycle duration = 4 input clock cycles.
- External data bus width = 16 bits.
- Input clock frequency = 8 MHz.
Maximum Data Transfer Rate (Mbps):
First, let's calculate the maximum data transfer rate (in bits per second) that the microprocessor can sustain across the bus:
Substituting the given values:
Convert to bytes per second:
To convert from bits per cycle to bytes per second, we need to consider the clock frequency. Since each cycle transfers 16 bits, and there are cycles per second (8 MHz), we can calculate the transfer rate in bytes per second as follows:
Substituting the given values:
Increasing Performance:
To increase the performance, we have two options: increase the external data bus width or double the external clock frequency.
Increase external data bus width to 32 bits:
- If we increase the external data bus width to 32 bits, the maximum data transfer rate will double, as each cycle will transfer 32 bits instead of 16 bits. Therefore, the new maximum data transfer rate would be .
Double the external clock frequency:
- If we double the external clock frequency to 16 MHz, the maximum data transfer rate will also double. Therefore, the new maximum data transfer rate would be .
Both increasing the external data bus width to 32 bits and doubling the external clock frequency would result in the same maximum data transfer rate of . However, doubling the external clock frequency might have additional implications such as increased power consumption and heat generation, while increasing the data bus width could potentially require changes in the microprocessor's architecture and external hardware. Therefore, the choice between the two options would depend on various factors including power constraints, design complexity, and compatibility with existing systems.
Q5 (B). Consider a 32-bit microprocessor whose bus cycle is the same duration as that of a 16- bit microprocessor. Assume that, on average, 30% of the operands and instructions are 32 bits long, 40% are 16 bits long, and 30% are only 8 bits long. Calculate the improvement achieved in the number of bus cycles when fetching instructions and 12 operands with the 32-bit microprocessor to a 16 bit microprocessor. When the number of instructions is 100.
To calculate the improvement achieved in the number of bus cycles when fetching instructions and operands with the 32-bit microprocessor compared to a 16-bit microprocessor, we need to consider the average operand and instruction lengths and the number of instructions.
Given:
- Average operand and instruction lengths:
- 30% are 32 bits long.
- 40% are 16 bits long.
- 30% are 8 bits long.
- Number of instructions = 100.
Let's first calculate the number of cycles required for both microprocessors to fetch instructions and operands.
For the 16-bit microprocessor:
- 30% of the time, it will need 2 bus cycles to fetch a 32-bit operand or instruction (16 bits at a time).
- 40% of the time, it will need 1 bus cycle to fetch a 16-bit operand or instruction.
- 30% of the time, it will need 1 bus cycle to fetch an 8-bit operand or instruction.
For the 32-bit microprocessor:
- 30% of the time, it will need 1 bus cycle to fetch a 32-bit operand or instruction.
- 40% of the time, it will need 1 bus cycle to fetch a 16-bit operand or instruction.
- 30% of the time, it will need 1 bus cycle to fetch an 8-bit operand or instruction.
Let's calculate the total number of bus cycles for both microprocessors.
For the 16-bit microprocessor:
For the 32-bit microprocessor:
Now, let's calculate the improvement achieved in the number of bus cycles by using the 32-bit microprocessor compared to the 16-bit microprocessor.
Therefore, the improvement achieved in the number of bus cycles when fetching instructions and operands with the 32-bit microprocessor compared to the 16-bit microprocessor is approximately .