2013年5月15日 星期三

Purpose Of The Following Little Man Computer Program


Purpose Of The Following Little Man Computer Program
This program is simulating how is a CPU works with ALU and RAM.
Let me introduce how this program works.

00 IN; <-- Load the first input. (Let say it is 2.)
01 STA 89; <-- Store the value 2 into RAM with the address 89.
02 IN; <-- Load the second input. (Let say it is 3.)
03 STA 90; <-- Store the value 3 into RAM with the address 90.
04 SUB 89; Deduct the current value by the value contained in 89. (The result will be 3-2 = 1.)
05 SKP; <-- Skip the next line if the current value is >=0.
06 JMP 09; <-- This will be skipped as the current value is one which is >=0.
07 LDA 89; Load value in the address 89 into current value.
08 JMP 10; <-- Jump to line 10;
09 LDA 90; <-- This will be skipped.
10 STA 92; <-- Store the current value into 92. (2 will be stored into.)
11 IN; <-- Load the third input. (Let say it is 9.)
12 STA 91; Store 9 into the RAM with the address 91.
13 SUB 92; Deduct the current value by the value in address 92. (9-2 = 7.)
14 SKP; <-- Skip the next line if the current value is >=0.
15 JMP 19; <-- This will be skipped.
16 LDA 92; <-- Load the value in address 92 to be the current value. (2 will be executed.)
17 JMP 19; <-- Jump to line 19.
18 LDA 91; <-- This will be skipped.
19 OUT; <-- Output the current value 2.

So, we can know how  CPU works with ALU and RAM by using Little Man Computer.

And the purpose of this program is actually finding the minimum value among three inputs.
If we modify this program a little bit, we can change the purpose of this program into finding the maximum value.
Steps:
1. Change 05 into SKN;
2. Change 14 into SKN;

Learning Through ICT Test

Learning Through ICT Test

I should say being careful and paying all your attention on test paper are really important. I suffer from my carelessness. 

Let me show my mistakes made in the paper.
The occurrence of them are all because of my carelessness and it contributes 50% of marks deducted and 10% of the full mark.

In fact, my answer is valid. But it is wrong. Why? As I didn't see the question carefully. I should state the advantage specified for training camp organizer.



Three photos above show that I got the same mistake three times. I miss the quotation marks. And I have reminded myself do remember the quotation marks. But still, I miss them.

The expected answer should be the explanation if why Mr Wong disagrees with Judy's suggestion. But, look what I have answered. I stated out my own opinion which is irrelevant to the question.


I got reflection after keeping thinking why I made such silly mistakes. And I should be confident on myself in order not to being nervous. I was afraid that the question will be difficult and I will be stuck. Then, I worked fast as long as I can finish the paper in time. However, I put my emphasis on speed too much but not the quality of my answers. Furthermore, I may say I am not familiar with the content like SQL enough and I lack of practicing with SQL. Then, I made the mistakes.
I know that they are not blunders but they are flaws on my paper. Also, being perfect is not easy as everyone gets mistakes. The separation point is the number of mistakes made, the fewer the better. And the more hard-working you are, the better you are. Remember, the way to perfect is cosmic and infinite.