You are on page 1of 3

Assignment No.

1
Introduction to Computing (CS-101)

Name: Mohammed Mustafa Mirza

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.

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

Answer: Register 1 will have “01” in it.

2. Write down the bit pattern (in hexadecimal) at memory address F3 when the Halt instruction is
executed.

Answer: “07 05”

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

Answer: 6 times

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

Answer: 00

5. Determine the contents of register 2 when the instruction at address F0 is executed.

Answer: C0 00 means Halt Execution

So, the Contents of register 2 will be “06”


Questions No 02 Marks (10)

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

Answer:

Converting 20 (1/16) to Binary

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


1 0 1 0 0 . 0 0 0 1

Converting 7 (1/4) to Binary

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


0 0 1 1 1 . 0 1 0 0

Performing Binary Addition

1 0 1 0 0 . 0 0 0 1
0 0 1 1 1 . 0 1 0 0
1 1 0 1 1 . 0 1 0 1

The Answer in Binary is:

1 1 0 1 1 . 0 1 0 1

A: 27 (5/16)

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

01001001-01000001-01001101-01011100

Answer:

ASCII Code Symbol Decimal


01001001 I 73
01000001 A 65
01001101 M 77
01011100 \ 92

You might also like