Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

r

t
!

•• ,a9- ••
••~-PW••
••••••
SLIIT
••••••
~~~~-~

Sri Lanka Institute of Information Technology

BSc. Eng. (Hons.) Degree in


Electrical and Electronic Engineering
Mid Semester Examination
Year 4 - Semester II (20 17)

EC 4461 -Computer Structures

Duration: 1 Hour (Plus 5 Minutes Reading Time)

September 2017

Instructions to Candidates:

• This paper contains TWO questions in THREE pages including the cover page.
• Answer ALL questions.
• Clearly state all the assumptions you make.
• This paper contributes to 20% of the final grade.
• Mobile phones are not allowed in the examination hall. Only electronic device
allowed is a faculty approved calculator.
• This is a CLOSED BOOK examination.
Question 01 (7 x 10 Marks)

1. Critically discuss the difference between 'Process', 'Threads' and 'Program' and how they
are differentiated by an operating system.
11. By using appropriate block diagram clearly evaluate the difference between Harvard and
Von-Numen architecture, and critically evaluate the most suitable architecture for modern
computation.
111. Define the operation of instruction execution process, by using single process Harvard
architecture; your explanation should include all the relevant registers and buses in the
process.
1v. Explain the concept of 'Pipeline' and 'Superscalar' by using traditional four stage pipeline
timing diagram, and critically evaluate the concept of'Super-Pipeline' at modern computer
architecture.
v. Identify and describe three different types of pipeline hazards.
VI. Describe the Flynns' taxonomy in parallel processing.
VII. Explain the concept of 'Distributed Memory' and 'Shared Memory' systems and give one
example of a real time application of each type
Question 2 (3 x 10 Marks)

Consider the following MPI program. The code is compiled and executed with 4 processes. The
target machine has an x64 CPU with 64GB RAM and is running a 64 bit Ubuntu OS with
OpenMPI.

1. #include <stdio.h>
2. #include <string.h>
3. #include <mpi.h>
4. /* For strlen
5. */
6. /* For MPI functions, etc */
7. const int MAX STRING= 100;
8. int main(void) {
9. char greeting[MAX STRING];
10. int comm_sz; /* Number of processes */
11. */
12. lnt my_rank; /*My process rank
13. MPI_Init(NULL, NULL);
14. MPI_Comm_size(MPI_COMM_WORLD, &comm_sz);
15. MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
16. if (my rank!= 0) {
17. sprintf(greeting, "Greetings from process %d of %d!",
18. my_rank, comm_sz);
19. MPI_Send(greeting, strlen(greeting)+1, MPI_CHAR, 0, 0,
20. MPI_COMM WORLD);
21. } else {
22. printf("Greetings from process %d of %d!\n", my_rank, comm_sz);
23. for (int q = 1; q < comm sz; q++) {
24. MPI Recv(greeting, MAX STRING, MPI _CHAR, q, 0, MPI_COMM_WORLD);
25. printf("%s\n", greeting);
26. }}}
27. MPI_Finalize ();
28. return 0;
29. /* main */

1. What is the purpose of the calls to MPI_Init and MPI_Finalize in the code? and Describe
the use ofMPI_COMM in OpenMPI programs?
11. What is the purpose of the calls to MPI _ Comm _size and MPI _ Comm _rank in the code?
111. What is the value ofcomm_sz in process 2 and what is the value ofmy_rank in process 4?

End of Exam Paper-

You might also like