You are on page 1of 14

COAL Fall, 2022 NUCES, Islamabad

NATIONAL UNIVERSITY OF COMPUTER AND EMERGING


SCIENCES ISLAMABAD
COMPUTER ORGANIZATION AND ASSEMBLY LANGUAGE, Fall 2022

ASSIGNMENT 03
Due Date: 11:59 AM 7 th November 2022 Hard Copy submission : 8 th November 2022

1. Consider last four digits of your ID and ADD 5555H to all digits and create your new COAL ID
in HEX as shown in example below

Example ID
1 2 8 9
+ Added Value
5 5 5 5
Example COAL ID
6 7 D E
0110 0111 1101 1110

CREATE NEW COAL ID

Your ID

Added Value
5 5 5 5
COAL NEW ID

Binary

MS-BCD LS-BCD
COAL Fall, 2022 NUCES, Islamabad
2. Consider the following code and fill given registers and memory accordingly?
NOTE: Multiplicand is last digit of your NEW COAL ID to it whereas Multiplier is second last digital
of your New COAL ID?

al bl
CF multiplicand Multiplier CF result

Page 2 of 14
COAL Fall, 2022 NUCES, Islamabad
3. Consider the following code and fill given registers and memory accordingly?
NOTE: Where Multiplicand is your NEW ID whereas Multiplier is given in declaration.

Page 3 of 14
COAL Fall, 2022 NUCES, Islamabad

Page 4 of 14
COAL Fall, 2022 NUCES, Islamabad

Page 5 of 14
COAL Fall, 2022 NUCES, Islamabad
4. Change above given code for following data declaration?

Page 6 of 14
COAL Fall, 2022 NUCES, Islamabad
5. Perform unsigned binary multiplication using following given flow chart?
NOTE: Your computer width is 8-bit, Multiplicand is last 2 digits of your NEW ID, Multiplier is
0A5H

Page 7 of 14
COAL Fall, 2022 NUCES, Islamabad

Page 8 of 14
COAL Fall, 2022 NUCES, Islamabad
6. Perform Multiplication using Booth’s algorithm?
NOTE: Your computer width is 10-bit, Multiplicand is 2’s complement of last 2 digits of your
NEW ID (Means it’s a signed and negative number), Multiplier is 0A5H

Page 9 of 14
COAL Fall, 2022 NUCES, Islamabad

Page 10 of 14
COAL Fall, 2022 NUCES, Islamabad
7. Perform Unsigned binary division?
NOTE: Your computer width is 8-bit, where dividend is last 2 digits of your NEW ID, Divisor is
003H

Page 11 of 14
COAL Fall, 2022 NUCES, Islamabad
8. Apply following peace of code and update register accordingly?

Page 12 of 14
COAL Fall, 2022 NUCES, Islamabad
9. Save your NEW ID in BX register and calculate number of one’s in your ID

10. Find number of odd numbers in following array?

NOTE: Using shifting to find whether number is odd/ or even

Page 13 of 14
COAL Fall, 2022 NUCES, Islamabad
11. Write a program that take 4 digits of your NEW ID and save them in separate memory
location of size byte?
NOTE: Supposed to use rotate and shift instructions

Page 14 of 14

You might also like