Answer:
(a) the number of times the value is performs is up to four cycles. and as such the integer i is executed up to 5 times. (b)The point version of the floating point can have CPE of 3.00, even when the multiplication operation required is either 4 or 5 clock.
Explanation:
Solution
The two floating point versions can have CPEs of 3.00, even though the multiplication operation demands either 4 or 5 clock cycles by the latency suggests the total number of clock cycles needed to work the actual operation, while issues time to specify the minimum number of cycles between operations.
Now,
sum = sum + udata[i] * vdata[i]
in this case, the value of i performs from 0 to 3.
Thus,
The value of sum is denoted as,
sum = ((((sum + udata[0] * vdata[0])+(udata[1] * vdata[1]))+( udata[2] * vdata[2]))+(udata[3] * vdata[3]))
Thus,
(A)The number of times the value is executed is up to 4 cycle. And the integer i performed up to 5 times.
Thus,
(B) The floating point version can have CPE of 3.00, even though the multiplication operation required either 4 or 5 clock.
Answer:
Explanation:
mostTickets=0;
for (k=0; k< ndays; k++){
if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];
}
Answer:
def cal(n):
s=0
while n>0:
r=n%10
if(r==0 or r==4 or r==6 or r==9):
s=s+1
elif r==8:
s=s+2
n=n//10
print(s)
n=int(input("enter number:"))
print(n)
cal(n)
Explanation:
- Create a function to calculate count of closed path
.
- Create a variable to store count of closed path
.
- While number is positive
, extract last digit of n
.
- Reduce number by truncating last digit
.
- Make a function call to compute count of path.
Answer:
B. The cost of tour t is at most twice the cost of the optimal tour.
Explanation:
You are using a polynomial time 2-approximation algorithm to find a tour t for the traveling salesman problem.
The cost of tour t is at most twice the cost of the optimal tour
The equation represented as Cost(t) <= 2 Cost(T)
Where
Cost (t) represents cost of tour t
Cost(T) represents cost of the optimal tour
Answer:
The External Data Bus is used to transport binary data and Address bus is used to transport memory addresses.
Explanation:
- External Data Bus is a combination of data bus and external bus. Data bus is used to carry data and instructions between two or more components in the system e.g. CPU and all other computer components.
- External bus is also called expansion bus. It is used to connect external components to the computer. Its a communication medium between CPU and other components. These components can be peripheral device like USB or flash memory.
- So External Data Bus is used to transport data between CPU and external components. It is a primary communication pathway for data in a computer. The external data components are connected to this bus and the instruction or data on this bus is available to all external components. But the data communication is slower as compared to that of internal bus.
- Address Bus carries physical location or address of data and transports memory addresses. Processor uses address bus when it wants to read data from memory or write data to the memory by sending a read/write signal by placing the read/write address of the specific memory location on the address bus.