Assignment No 1 cs101
Assignment No 1 cs101
(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.
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
SOLUTION:
Binary addition on 20 :
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