0% found this document useful (0 votes)
76 views4 pages

Assignment No 1 cs101

The document provides a snapshot of memory addresses and CPU registers from a program stored in memory for execution. It includes the following information: - The program counter has an initial value of E2. - The contents of register 1 is 15 when the machine halts. - The bit pattern at memory address F3 is 0705 when the halt instruction is executed. - The machine instruction at address EE is executed 6 times before halting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views4 pages

Assignment No 1 cs101

The document provides a snapshot of memory addresses and CPU registers from a program stored in memory for execution. It includes the following information: - The program counter has an initial value of E2. - The contents of register 1 is 15 when the machine halts. - The bit pattern at memory address F3 is 0705 when the halt instruction is executed. - The machine instruction at address EE is executed 6 times before halting.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as ODT, PDF, TXT or read online on Scribd
You are on page 1/ 4

Questions No 01 Marks

(10)

Given is a snapshot of memory addresses E2 to F4 and CPU registers 0 to F. All bit patterns
in the memory cells are represented in hexadecimal notation.

Figure 1: Snapshot of a program stored in main memory for execution

Assume that the Program Counter has E2 as its initial value. Using the information provided
in the above Figure 1, answer the following questions.

SOLUTION:
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

3. How many times the machine instruction at address EE is executed before the machine halts.
Answer: 6

4. Determine the contents of register 0 after the instruction at address EC is executed.


Answer:
1
5. Determine the contents of register 2 when the instruction at address F0 is executed.
Answer: 07

Note: Use the table provided in Appendix C at page 581 of book.

Questions No 02 Marks (10)

a. Perform binary addition on given numbers:


20 and 7 .

SOLUTION:

Binary addition on 20 :

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

16 8 4 2 1 12 14 18 116

1 0 1 0 0 0 0 0 1

Answer of 20 =10100.0001

Binary addition on 7 :
22 21 20 Radix 2-1 2-2

4 2 1 12 14

1 1 1 0 1

Answer of 7 =111.01

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 =\
So
01001001010000010100110101011100 = IAM\s

You might also like