Student name___________________ Student Number ______________________________
Keyu Ni 0644908
COIS 2300H Mid Term exam
WI 2021 (This is the online form).
This exam is worth 20% of your final grade.
Computer Internal Components and Structure
1. What are four major differences in design considerations for embedded vs mobile processors? There are many more than four possible answers. 2 marks total (half mark per point)
1. Embedded is a Reduced instruction set system, but mobile processors have many instructions
2. Embedded has higher performance, of course its price is correspondingly higher
3. Embedded shows up two places, mobile devices and their derivatives in the CPU business,mobile processors is specifically for mobile terminal to mobile terminal.
4. Embedded power and heat determine that it needs high-frequency power supply and high-power and large volume cooling fan, which are not available for tablet computers, mobile phones and other micro devices
2. What is the role of a bus in computer architecture, an example might be the front side bus on your motherboard, or a universal serial bus (USB). 1 mark
Bus is the interconnection mechanism of computer system, and it is the common channel for data transmission among multiple system functional components. With the help of bus connection, the computer can exchange address, data and control information among various system functional components, and work on the basis of competing for resources
3.
3. technology
1.
2.
List 3 reasons why have we seen a shift to multi core processors rather than faster and faster single monolithic core designs? (0.5 marks per point) 1.5 marks.
Increasing the number of cores is the most efficient way to improve performance
Multiple transactions can be synchronized
The improvement of single core performance is limited by the development of semiconductor
4. Given the memory latency of the 3 components below, match A, B and C as well as possible to the following components: CPU cache, RAM, and ‘non volatile storage’ (i.e. a hard drive) . 1.5 marks
Memory latency
Component which corresponds to that latency: (Students fill in this column)
A
1ns
Cpu cache
B
150ms
Non volatile storage
C
10ns
RAM
Performance metrics
5. Given examples of when response time or throughput are more appropriate measures used to compare two processors? 1 mark
Different processors respond differently to multiple processes, such as those using FCFS and those using the highest response ratio algorithm, and processors with the shortest average response time are better when all processes run
6. For a given benchmarking program (that executes a fixed number of instructions) explain how an Intel CPU with a clock speed of 2.3 GHz could outperform an AMD CPU with a clock speed of 4GHz (single thread, single CPU, and yes, a real Pentium G630T @2.3GHz is faster than an A10- 7870k at 3GHz, barely). 2 marks
Processing performance of the CPU should not look at the primary frequency. Processing power of the CPU can be seen as: actual processing power = clock time*CPI.Although clock’s speed of inter CPU is lower than AMD, it is much more stable and efficient than AMD.
7. Because the numbers aren’t nice and even, just derive or show the equation (from chapter 1) that would allow you to calculate what frequency the AMD CPU in question 6 would need to be to match the Intel CPU IPS, but you don’t need to try and resolve the calculation. 1 mark
CPU performanceB/CPU performanceA = CPU timeA/CPU timeB 6 = 3/CPU timeB
User CPU Time = 0.5 seconds
2
still need to take 1 second to do I/O + User CPU Time 0.5 seconds = 1.5 seconds
Wallclock Time = 1.5 seconds
System Performance in MFLOPS = Number of Floating Point Operations * 106/Wallclock Time Old System Performance (10) = #FLOP * 106/4
New System Performance = 40 * 106/1.5
MFLOP/sec = 26.667
#FLOP = 40 * 106
3
8. Typical air-cooling solutions range in heat dissipation performance from about 4.5 watts to 140 watts. A typical mid range processor dissipates about 90 watts, and a high-end version from the same processor family dissipates around 140w. These processors have the same capacitive load but operate at different voltages and frequencies (typically 1.2 volts for mid range, 1.4 for high end). Derive an equation to show what the difference in frequencies might be between these processors (hint, this is the same equation as the power wall, except now we know Pnew and Pold, and don’t know Fnew or Fold). 1 mark
CPU time problem
9. For a given CPU integer operations a+b, and a*b take almost identical amounts of time, for floating point (32 bit) multiplication takes approximately 3x as long. Floating point additions and integer additions take nearly identical times. (Yes, those are nearly real numbers for Intel Haswell CPU’s). For a program that is 20% logic operations (which take the same no matter what), 40% additions and 40% multiplications, derive a formula to calculate the estimated performance of changing the maths from Integer to Floating point operations on the same CPU 1 mark
4
MIPS and General Assembly Programming
10. For any given (nested) procedure in MIPS we should be able to push and pop any variables it might want onto the stack and then restore them. Write a MIPS macro for Push and a second macro for Pop that would push 3 registers ($s0, $s1, $s2) onto the stack and then pop them off in the correct order. Your program doesn’t need to actually do anything with those variables though. The stack pointer should be correctly restored at the end 3marks
5
11. Write a program that creates an array in MIPS to hold floating point values 1.1, 2.2. 3.3, 4.4 and 5.5, and then uses a loop to print off the elements of the array the elements of the array. (MIPS prints floats from $f12) 3 marks
(You can paste your code here, but also submit your .asm file)
6
Addressing modes
12. Using the 8-element array below, give examples (words are fine, it doesn’t need to be code) to show the differences between base addressing, absolute addressing (which you should never actually use), and indirect addressing. (it’s up to you to label the addresses however you want). 3 marks
E.g. “j 4” is an example of absolute addressing that leads to no instruction
Address
Data @ Address
0
add A + B
1
“Cats”
2
7
3
4
4
5
6
7
Jawa
If i want to find “Cats”,i use absolute address is “j 1”,if i want to use base addressing,I need a register BX to store the address value 1,and then use instruction is that jr BX.if i want to visit “Jawa”,the instruction that i use the indirect addressing is “j [2]”
7
13. Write a MIPS program that keeps asking a user for a number, if that number is 9999 (integer) the program should print “Break” and the program should exit. (If the number is not 9999 the program can just ask for another number and does nothing else). 3 marks.
(You can paste your code here, but also submit your .asm file)
8
14. Describe the process by which an assembly language compiler handles pseudo instructions, and why there are pseudo instructions at all. 2 marks
Pseudo instruction statement is a command given to assembler, which is processed by assembler in the process of assembly, such as defining data, distributing storage area, defining segment and procedure, etc.
If ORG 0000H indicates that the first address of the program is 0000H, the program will be stored from the 0000H address according to the information provided above.
Macro substitution is the main way for assembler to deal with pseudo instructions of assembler
15. The textbook repeatedly and strongly argues for reduced instruction sets, on the basis that essentially ‘it’s easier to make fewer instructions fast, and that produces better results’, but desktop processors such as from Intel and AMD are complex instruction sets. Discuss what CISC does better than RISC and why. 2 marks
The main advantages of CISC are as follows
1. Rich instructions and powerful functions
2. Flexible addressing mode.
3. With microprogram controller as the core, instruction memory and data memory share the same physical storage space, which has strong performance.
The main disadvantages of RISC are as follows
1. The number of instructions is small and the function is not as powerful as CISC. 2. Addressing mode is not flexible enough.
9
Arithmetic
For all questions you must show your steps to receive any marks. The point here is not if you know the answer, but if you know the process a computer uses to systematically arrive at an answer.
Integers
16. For these questions simply work in binary integers, and ignore overflow, NAN, etc. total (Sri note: Yes I’m giving you some easy marks).
4 marks
Add
Subtract
Multiply
1001 + 1100
1100 − 1001
1010 ∗ 0101
10
Divide
10110110/1110
8-bit Floating Point.
17. Assume an 8-bit floating point format where the result must be properly represented (where possible). Our 8-bit format uses the first bit for a sign, the next 4 for an exponent (bias=7) and then 3 for the fraction. 10 marks total
Convert the following into base 10 (or if you can’t, try, and explain what went wrong.) A. 0 1001 101
11
B. 1 0101 100
Perform the following calculations in our binary floating-point format, your answer should be in our 8- bit minifloat format, and your steps should be in minifloat.
Addition (Floating point)
0 0111 101 + 0 1001 010
Subtract (Floating Point)
0 1010 010 – 0 1001 110
12
Multiply (Floating Point)
0 1101 011 ∗ 0 0100 101
Divide (floating point)
0 1011 011 / 0 0111 011
Bonuses:
Bonus marks are awarded based on the creativity of your answers, but they will not let you exceed a grade of 100% on the exam.
Bonus1: There are 175 students in this course, and one instructor. Estimate the bandwidth required if we held a virtual class where all 175 students were streaming themselves at 240p (426×240 pixels with 24 bits of colour data/pixel) 30 frames per second) along with the instructor streaming at UHD (3840×2160, 24 bits of colour data per pixel, 30 frames per second), assume no video compression used
426 x 240 x 24 x 30 x 175 + 3840 x 2160 x 24 x 30 x 1
13
= (1.288224 x 10^10 + 0.5971968 x 10^10) bps = 10^10 x (1.8854208) bps
= 1.25 x 10^9 x 1.8854208 bps
= 1192.0929 x 1.8854208 mbps
= 1.097 gbps
Bonus2: Assuming you have a copy (electronic or physical) of the textbook and didn’t *NEED* the Internet to do this exam, estimate how many transistors you needed just to do this exam. Explain your answer.
14
SAS note: A PDF of this image is available if needed but I couldn’t upload two files.
15