Here is a website about computer programming. Hope this helps.
http://www.wikihow.com/Start-Learning-Computer-Programming
Answer:
31 bits.
Explanation:
Given, total number of registers = 55
Total instructions = 60
Size of memory = 16 KB
Now, no of registers are 55. We find the next greater or equal power of 2 which is 64 = 26. Hence, 6 bits are required to represent a register operand.
Number of instructions = 60. We find the next greater or equal power of 2 which is 64 = 26. Hence, 6 bits are required to represent a instruction.
Size of memory = 64 KB = 26 * 210 * 23 bits = 219 bits. Hence, 19 bits are required to represent a memory location.
Now, an instruction has 2 parts, opcode and operand. As given there are only two address instructions which are memory operand and register operand.
Hence, total bits would be: 6 bits (opcode) + 6 bits (register operand) + 19 (memory operand) = 31 bits.
Answer:
(a) What is the best case time complexity of the algorithm (assuming n > 1)?
Answer: O(1)
(b) What is the worst case time complexity of the algorithm?
Answer: O(n^4)
Explanation:
(a) In the best case, the if condition will be true, the program will only run once and return so complexity of the algorithm is O(1)
.
(b) In the worst case, the program will run n^4 times so complexity of the algorithm is O(n^4).
I’m having a hard time understanding your question