Reg.
No:                                Final Examination Spring 2022                          Date: -      -      - 2022
 _______________
 Program: BSCS                                                                              Class & Section: 3(A,B,C)
 Course Code &Name:(CSC 2201)Computer Organization&Assembly Language Duration: 2.5 hrs
 Instructor’s Name: Dr. Shahzad Latif, Mr. M. Aqeel Anwar                                    Total: 30 Marks
Important Instructions:
Read all questions carefully first and then ask for the questions. Question paper related queries will not be
entertained after 1 hour for Final after the start of paper. Do not write anything on question paper unless
until specifically asked for. Question Paper to be returned along - with Answer Sheet.
Possession of Mobile Phone, Smart Watch or any Unauthorized Written Material will Result
in Cancellation of the Exam, and “F” Grade will be awarded for the entire Course.
-----------------------------------------------------------------------------------------------------------------------------------
Attempt all questions:
Q1:                                                                         (Marks= 06)
A three-stage delay leads to the branch penalties for the three simplest prediction schemes listed in Table 2.
Find the effective addition to the CPI arising from branches for this pipeline, assuming the branch
frequencies in Table 1:
                                                   Table1
                                      Frequencies
                                      Unconditional branch                            4%
                                      Conditional branch, untaken                     6%
                                  Conditional branch, taken               12%
                                                     Table 2
            Branch penalties for the three simplest prediction schemes for a deeper pipeline.
            Branch scheme           Penalty unconditional        Penalty untaken     Penalty taken
            Flush pipeline                      2                        1                  3
            Predicted taken                     4                        2                  4
            Predicted untaken                   3                        1                  2
Q2:                                                                                       (Marks=06=3+3)
Execute the following program
                                                  F= (A+8*B) – 4*(C + D)
    (a) Stack Architecture Instructions Set
    (b) Accumulator Architecture Instructions Set
Q3:                                                                                       (Marks= 05)
                                                                                                                     Page 1 of 2
Suppose DH = (6B)16, AH=(CB)16 , CF=0, and CL contains 5, Following instructions are
executed:
XOR DH,AH
SHR DH, 2
RCL DH, CL.
Show the status of DH register after each step in the following table format..
CL        CF                                             DH
Q4:                                                                (Marks= 05)
Write an assembly program to input week number (1-3) and print day of week name using
case structure:
            1 = Friday
            2 = Saturday
            3 = Sunday
Q5:                                                                (Marks= 04)
Suppose that the processor has access to two levels of memory. Level 1
contains 1000 words and has an access time of 0.01 s; level 2 contains 100,000 words and
has an access time of 0.1 s. Assume that if a word to be accessed is in level 1, then the
processor accesses it directly. If it is in level 2, then the word is first transferred to level 1
and then accessed by the processor. Calculate the average access time of a word from
memory?
Q6:                                                                (Marks= 04)
Write a program to read a letter in lower case and print it into upper case letter.
                                              ***END***
                                                                                       Page 2 of 2