Introduction to Computing
(CS101) Assignment # 01 Spring 2021 Name: Abdul Rehman |
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.
Introduction to Computing (CS101) |
1. Determine the contents of register 1 when the
machine halts.
2. Write down the bit pattern (in hexadecimal) at
memory address F3 when the Halt instruction is executed.
3. How many times the machine instruction at address
EE is executed before the machine halts.
4. Determine the contents of register 0 after the
instruction at address EC is executed.
5.
Determine the contents of register 2 when the instruction at address F0 is
executed.
Ans:
1. 15
2. 0705
3. 6
4. 91
5. 07
Part: 2
A. Perform binary addition on given numbers:
201/16
and 71/4.
28 |
24 |
22 |
21 |
20 |
radix |
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 |
|
|
|
|
|
|
|
20 1/16 = 10100.0001
7 1/4
22 |
21 |
20 |
radix |
2-1 |
2-2 |
|
|
|
|
|
|
|
4 |
2 |
1 |
. |
1/2 |
1/4 |
|
|
|
|
|
|
|
1 |
1 |
1 |
. |
0 |
1 |
|
|
|
|
|
|
|
7 ¼ = 111.01
Binary Addition
10100.0001
+
111.01
0101011110
B. Convert the following binary number into
ASCII code and then into its equivalent decimal representation.
01001001010000010100110101011100
·
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
0 Comments