0% found this document useful (0 votes)
27 views3 pages

ID: bc190413749: Cs101 Assignment 1

The document contains 4 questions regarding a machine code assignment. Question 1 has 4 parts asking about register contents and memory addresses after execution. Question 2 has 2 parts, the first asking to perform binary addition and the second asking to convert a binary number to ASCII code and decimal.

Uploaded by

Soban Majeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

ID: bc190413749: Cs101 Assignment 1

The document contains 4 questions regarding a machine code assignment. Question 1 has 4 parts asking about register contents and memory addresses after execution. Question 2 has 2 parts, the first asking to perform binary addition and the second asking to convert a binary number to ASCII code and decimal.

Uploaded by

Soban Majeed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Cs101 Assignment 1

ID: bc190413749
Question 1
1. Determine the contents of register 1 when the machine halts.
Answer 15
2. Write down the bit pattern (in hexadecimal) at memory address F3 when the Halt
instruction is executed.
Answer 0705
2. How many times the machine instruction at address EE is executed before the
machine halts.
Answer 6
3. Determine the contents of register 0 after the instruction at address EC is
executed.
Answer 00
4. Determine the contents of register 2 when the instruction at address F0 is
executed.
Answer 07

Question No 2 (Part A)

Perform binary addition on given numbers


a. Perform binary addition on given numbers:
20 1/ 16 and 7 1/ 4

22 21 20 2-1 2-2

4 2 1

1 1 1 0 1

24 23 22 21 20 2-1 2-2 2-3 2-4


16 8 4 2 1 1/2 1/4 1/8 1/16

1 0 1 0 0 0 0 0 1

00111.0100

10100.0001

11011.0101

Question No 2 (Part B)

Convert the following binary number into ASCII code and then
into its equivalent decimal representation.
01001001010000010100110101011100

Solution
Divide from left in 8 Characters

01001001

01000001

01001101

01011100
27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1

0 1 0 0 1 0 0 1 =73

0 1 0 0 0 0 0 1 =65

0 1 0 0 1 1 0 1 =77

0 1 0 1 1 1 0 0 =92

=73 =I

=65 =A

=77 =M

=92 =\

01001001010000010100110101011100 = IAM/s

You might also like