Computer Arhitecture Mid Exams
Computer Arhitecture Mid Exams
Computer Arhitecture Mid Exams
SCIENCES
Mid-Term Assessment Spring 2021 Semester
Class Id 106920 Course Title Computer Architecture
Program BSCS Campus / Shift City Campus/Evening
th
Date 11 March 2021 Total Points 100
Duration 02 hours Faculty Name Samrina Zamir
Student Id Student Name
Instructions:
• Filling out Student-ID and Student-Name on exam header is mandatory.
• Do not remove or change any part of exam header or question paper.
• Write down your answers in given space or at the end of exam paper with proper title
“Answer for Question# _ _”.
• Answers should be formatted correctly (font size, alignment and etc.)
• Handwritten text or image should be on A4 size page with clear visibility of contents.
• Only PDF format is accepted (Student are advise to install necessary software)
• In case of CHEATING, COPIED material or any unfair means would result in negative marking
or ZERO.
• A mandatory recorded viva session will be conducted to ascertain the quality of
answer scripts where deemed necessary.
• Caution: Duration to perform Mid-Term Assessment is 02 hours only. Extra 01 hours are
given to cater all kinds of odds in submission of Answer-sheet. Therefore, if you failed to
upload answer sheet on LMS (in PDF format) within 03 hours limit, you would be
considered as ABSENT/FAILED.
• Attempt ALL questions.
• Each question is of 20 marks.
• Reference material given at the end of question paper.
• Answer all the questions in this question paper.
• Check carefully PDF document before uploading that it has all the answers
provided by you with snapshots if you have in your paper.
T2:R2← R2
T3:R2← 0
S0 S1 Cin = 0 Cin =1
0 0 B+A (add) B+A+1
0 1 AB(transfer) B+1(increment)
1 1 B+A' B+A'+1(subtract)
3. Given a figure of ALU which perform Arithmetic and Logical operations complete
the truth table by giving the details of operations performed.
S1 S0 Cin = 0 Cin = 1
0 0
0 1
1 0
1 1
a. You need to design the control gates logic of Data Register. For this general-purpose
register, list-down all functions & Boolean expressions that are controlling the LD,
INR, and CLR inputs of DR. Also draw the control gates logic circuit for it.
0111 Add DR to AC
The content of PC is 456 (all numbers are in hexadecimal). The content of AC is A145.
The content of memory at address 456 is 72BE. The content of memory at address
2BE is BCF1. The content of memory at address CF1 is 812A.
a. What is the instruction that will be fetched and executed next?
b. Show the binary operation that will be performed in the AC when the instruction
is executed.
c. Give the contents of registers PC, AR, DR, AC, and IR in hexadecimal and the values
of E, I, and the sequence counter SC in binary at each step of program (or instruction)
before execution and after execution.
d. Give RTL Of the instruction what you concluded from basic computer for applying
on this machine.
1. List the assembly language program with instruction in hexadecimal for computing
GCD(Greatest Common divisor) generated by a compiler from the following pseudo
code:
while a!=b
if a < b Nearer Assembly Language:
X=(A+B×C)/(D–E×F)
• Using a general register computer with three address instructions.
• Using a general register computer with two address instructions
• Using an accumulator type computer with one address instructions
• Using a stack organized computer with zero=address operation instructions.
2. What stack elements remain after the following instructions are executed? [5]
PUSH 1
PUSH 3
PUSH 6
ADD
PUSH 20
SUB
MUL
-11
Find Effective address and operand for the following Addressing modes.
• Immediate
• Direct
• Indirect
• Register Direct
• Register Indirect
• Pre-Indexing
• Post-Indexing
2. A machine uses 16-bit instructions including 3-bits for an address field. The
Expanding op-code technique is to be used so that the machine instruction set
contains 15- 3 Address instructions, 40- 2 Address instructions 60-1 Address
instructions .Is the Instruction set design possible and if so, Find out the maximum
number of zero Address Instructions that machine can have. Also show encoding of
all instructions.