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

Assignement CS101

Student name Husnain Ai


Student ID (BC210211381)

Solution
Answers of Following Questions No.1

• Determine the contents of register 1 when the machine halts.

Answer = 15

• Write down the bit pattern (in hexadecimal) at memory address


F3 when the Halt instruction is executed.

Answer= 0705
• How many times the machine instruction at address EE is
executed before the machine halts.
Answer = 6
ANS = 6
• Determine the contents of register 0 after the instruction at
address EC is executed.

Answer= 00
• Determine the contents of register 2 when the instruction at
address F0 is

Answer= 07

Question No.2

• Perform binary addition on given numbers:


20 161 and 7 14.

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

01001001010000010100110101011100

Answer of Question.2

Part (a)

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


16 8 4 2 1 ½ ¼ 1/8 1/18
1 0 1 0 1 1 0 1 0

Ans = 10101.1010

22 21 20 Radix 2-1 2-2


4 2 1 ½ ¼
1 0 1 1 0

Ans== 101.10
Binary addition
10101.1010
101.10
100101.0010

Part (b)
27 26 25 24 23 22 21 20 Answer

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 = /
So : 01001001010000010100110101011100 = IAM/ ANS

------------------------------------------------------------------------------------------------

You might also like