CS501 Assignment 01 Fall 2020 Solution / Discussion Due Date: 30-11-2020
Tags:
Share the Assignment Questions & Discuss Here....
Download attachment for CS501 assignment 1 solution file in MS Word.
CS501 Complete Solution Assignment#01
Click on the below link to download the file
Assignment Questions are following;
Solution is required please!
Questions No 01
Write the instructions for both 1-address and 2-address machines to evaluate the following expression.
z = 3x3 - 2y2 + 6xy
Note: x, y and z represent memory locations.
Questions No 02
Reverse assemble the following SRC machine language instructions. You are required to show the complete steps.
CS501 assignment 1 Solution:
Question No 1
Solution
1-Address |
2-Address |
lda 6 load 6 to accumulator mula x multiply x with accumulator mula y multiply y with accumulator sta s store in s lda 2 load 2 to accumulator mula y multiply y with accumulator mula y multiply y with accumulator adda s add s to accumulator lda 3 load 3 to accumulator mula x multiply x with accumulator mula x multiply x with accumulator mula x multiply x with accumulator suba s subtract accumulator from s sta z |
load s, 3 mul s, x mul s, x mul s, x load t, 2 mul t, y mul t, y sub s, t load u, 6 mul u, x mul u, y add s, u store z, s |
Question No.2
Solution
Hexa |
E |
8 |
C |
8 |
6 |
0 |
0 |
0 |
Binary |
1110 |
1000 |
1100 |
1000 |
0110 |
0000 |
0000 |
0000 |
|
11101 |
00011 |
00100 |
0010 0000 0000 0000 |
|
|||
|
Op-code |
ra field |
rb field |
17 bit c1 field |
|
|||
instruction |
shc |
R3 |
R4 |
13Ah=18d |
|
Therefore, the assembly language instruction is
Shc R3,R4,19
Hexa |
1 |
A |
0 |
C |
0 |
0 |
1 |
2 |
Binary |
0001 |
1010 |
0000 |
1100 |
0000 |
0000 |
0001 |
0010 |
|
00011 |
01000 |
00110 |
00000 0000 0001 0002 |
|
|||
|
Op-code |
ra field |
rb field |
17bit c1 field |
|
|||
Instruction |
st |
R8 |
R6 |
12h=18d |
|
Therefore, the assembly language instruction is
st R8,R6,18
Download attachment for CS501 assignment 1 solution file in MS Word.
CS501 Complete Solution Assignment#01
Click on the below link to download the file
CS501 Complete Solution Assignment#01
Click on the below link to download the file
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post