CSC429-Computer Organization Tutorial: Y ( (M N) + (P/M) ) (P+N)

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

CSC429- Computer Organization

20
Tutorial

Name: Muhammad Luqman Hasif Bin Sufian Student ID: 2019423306


Group: CS2301B

Answer all the questions below.


1. Describe the instruction in computer system organization (2 Marks)

The complete collection of instructions that are understood by the CPU where the instructions
serves as an interfere between software and hardware.

2. Provide THREE (3) elements of instruction set in computer system (3 Marks)

-Type and size of operands


-Number of bits per instruction
-Stack-based

3. Write an assembly language notation and comments using the format instruction set of zero-
address, 1-address and 3-address as in Table 1 for the given expression below. Assume the
register M, N, P cannot be modified while register x, y and z can be used as temporary register.
The final answer must be stored in Register Y.

Y = [ (M*N) + (P/M)] * (P+N)2

Table 1

SAM/2016/Quiz3
(15 marks)

-------------------------------------END OF QUESTION-----------------------------------------

3 Zero-Address One-Address Three-Address


.
PUSH M LOAD M AC  M MUL (Z,M,N) Z  M*N

PUSH N MUL N AC  M*N DIV (X,P,M) X  P/M


MUL STOR Y Y  AC ADD (Z,Z,X) Z  Z+X
PUSH P
LOAD P AC  P ADD (X,P,N) X  P+N
PUSH M
DIV M AC  P/M MUL (X,X,X) X  X*X
DIV
ADD Y AC  AC + Y MUL (Y,Z,X) Y  Z*X
ADD
STOR Y Y  AC
PUSH P
LOAD P AC  P
PUSH N
ADD N AC  P+N
ADD
MUL AC AC  AC*AC
PUSH P

PUSH N MUL Y AC  AC*Y

MUL STOR Y Y  AC

MUL

POP Y

SAM/2016/Quiz3
SAM/2016/Quiz3

You might also like