ASSEMBLY LANGUAGE Can you please review these answers Thank You! 1. Convert 6605
ID: 3936111 • Letter: A
Question
ASSEMBLY LANGUAGE
Can you please review these answers
Thank You!
1. Convert 66057 => n 8 = 4465
2. Convert 2403115 => n16 = 227F
3. Convert 23615119 => n16 = 138A1B
4. By matching convert the below binary number to the base 8:
1 1 0 1 1 0 1 1 0 1 1 1 0 1 1 1 0 11 0 1 11 0 0 11 0 1 0 1 0 1 12 => n8 = 155567334653
5. Simplify : (1347 + 21317)*1017 => n16 = A24E
6. 532910 => n3 = 21022101
7. (104)5 - 1 = n4 = 33333 => n16 = 3FF
8. Convert 45AF16 => N3.
220110201
9. Complete this table. Make sure all cells that contain numbers are filled.
PSEUDO-CODE INSTRUCTIONS
X
Y Z
X: =7 7
Y := -12
7
-12
Z := 13
7
-12
13
IF (X + Y + Z) <> X*Y THEN
7
-12
13
BEGIN
7
-12
13
X : = (X – Y) ÷ X
2
-12
13
Y := X – 3 * Y
2
38
13
Z : = X + 5
2
38
7
END
2
38
7
IF (X - Y + Z) <> X +Y THEN
2
38
7
BEGIN
2
38
7
X : = 2 * (X – Y) ÷ X
-36
38
7
Y := X – 3 * Z
-36
-57
7
Z : = X + 2
-36
-57
-34
END
-36
-57
-34
10. (2123 + 22223)*1013 => n10= 1030
11. The instructions
X := 3
X :=X*X
X :=X+X
X :=X*X
will cause the final value of X to be = 324
12.
X := 12
Y := 15
Z := 5
Z := X
X := Y
Y := Z
The above sequence of commands will exchange the values in the variables, resulting finally in
Answer: X= 15; Y = 12; Z = 12
13.
W:=7
U:= 2
W:= 5 + (W*(W + U÷W) + 2)÷2
T := W
The above sequence of instructions will store 30 in T
14.
X := 3
X := 2*X - X
X := 2*X + X
X := 2*X - X
X := 2*X + X
X := 2*X - X
X := 2*X + X
Y := 2*X
The above sequence of instructions will store 162 in Y.
15.
IF X < 0 THEN
BEGIN
X : = -1*X
END
IF 2*(X÷2) <> X THEN
BEGIN
X := X - 1
END
ELSE
BEGIN
X : = X + 1
END
The purpose of writing the above algorithm is
If X is negative, make it positive. If X is odd, subtract one from X;
If X is negative, make it positive. If X is even, add one to X.
(a.) TRUE (b.) FALSE (A)True
16.
Complete the table below. Make sure you fill in all cells that contain numbers.
PSEUDO-CODE INSTRUCTIONS
X1
X2
X3
COUNT
X1 := 5
5
X2 := 12
5
12
X3 := -2
5
12
-2
COUNT := 0
5
12
-2
0
IF X1 < 0 THEN
BEGIN
COUNT := COUNT + 1
END
5
12
-2
0
IF X2 < 0 THEN
BEGIN
COUNT := COUNT + 1
END
5
12
-2
0
IF X3 < 0 THEN
BEGIN
COUNT := COUNT + 1
END
5
12
-2
1
17.
Complete the following table. Make sure all cells that contain numbers are filled.
(Note: The symbol ^ is to raise a number to a given power. Ex. 2 ^3 = 8).
PSEUDO-CODE INSTRUCTIONS
N10
Q
N8
R
K
BASE
N10 := 2304
2304
BASE := 8
2304
N8 := 0
2304
0
8
K : = 0
2304
0
0
8
R := N10 MOD BASE
2304
0
0
0
8
Q:= (N10 - R)÷BASE
2304
288
0
0
0
8
N8:= N8 + R*10^K
2304
288
0
0
0
8
N10 := Q
288
288
0
0
0
8
K := K + 1
288
288
0
0
1
8
R := N10 MOD BASE
288
288
0
0
1
8
Q:= (N10 - R)÷BASE
288
36
0
0
1
8
N8 := N8 + R*10^K
288
36
0
0
1
8
N10 := Q
36
36
0
0
1
8
K := K + 1
36
36
0
0
2
8
R := N10 MOD BASE
36
36
0
4
2
8
Q:= (N10 - R)÷BASE
36
4
0
4
2
8
N8 := N8 + R*10^K
36
4
400
4
2
8
N10 := Q
4
4
400
4
2
8
K := K + 1
4
4
400
4
3
8
R := N10 MOD BASE
4
4
400
4
3
8
Q:= (N10 - R)÷BASE
4
0
400
4
3
8
N8:= N8 + R*10^K
4
0
4400
4
3
8
N10 := Q
0
0
4400
4
3
8
K := K + 1
0
0
4400
4
4
8
18. What is the purpose of writing the following algorithm:
T := N1
IF N2 < T THEN
BEGIN
T := N2
END
IF N3 <T THEN
BEGIN
T := N3
END
Z := T
(a.). To assign the lowest value to Z (b.) To assign the highest value to Z
Answer A.
19. What does the programmer what to find out from the following algorithm:
IF 2*(X÷2) = X THEN
BEGIN
EVEN := 1
END
IF 2*(X÷2) <> X THEN
BEGIN
ODD:= 1
END
To find is it number even or odd
20.
Complete the following table. Make sure all cells with numbers are filled.
INSTRUCTIONS
X1
X2
X3
TEMP
X1:= 7
7
X2:= 2
7
2
X:3= 10
7
2
10
IF X1 < X2 THEN
7
2
10
BEGIN
7
2
10
TEMP := X1
7
2
10
X1 := X2
7
2
10
X2 := TEMP
7
2
10
END
7
2
10
IF X2 < X3 THEN
7
2
10
BEGIN
7
2
10
TEMP := X2
7
2
10
2
X2 := X3
7
10
10
2
X3 := TEMP
7
10
2
2
END
7
10
2
2
PSEUDO-CODE INSTRUCTIONS
X
Y Z
X: =7 7
Y := -12
7
-12
Z := 13
7
-12
13
IF (X + Y + Z) <> X*Y THEN
7
-12
13
BEGIN
7
-12
13
X : = (X – Y) ÷ X
2
-12
13
Y := X – 3 * Y
2
38
13
Z : = X + 5
2
38
7
Explanation / Answer
The solution provided for question no 1 to 15 are correct.
i am giving you the stepwise results of two of the questions:
14) X := 3
X := 2*X - X =3
X := 2*X + X =9
X := 2*X - X =9
X := 2*X + X =27
X := 2*X - X =27
X := 2*X + X =81
Y := 2*X =162
12)
X := 12
Y := 15
Z := 5
Z := X (Z=12)
X := Y (X=15)
Y := Z (Y=12)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.