Why Choose Us?
0% AI Guarantee
Human-written only.
24/7 Support
Anytime, anywhere.
Plagiarism Free
100% Original.
Expert Tutors
Masters & PhDs.
100% Confidential
Your privacy matters.
On-Time Delivery
Never miss a deadline.
Stevens Institute Of Technology CS 550 Chapter 6 The Little Man Computer Consider this model of the LMC and answer the questions below
Stevens Institute Of Technology
CS 550
Chapter 6 The Little Man Computer
Consider this model of the LMC and answer the questions below.
|
1)The LOAD instruction copies data from the
|
- calculator to a mailbox.
- in basket to the calculator.
- The ADD instruction adds data from
-
- the in basket to a mailbox.
-
- a mailbox to the calculator.
-
- a mailbox to the in basket.
-
- one mailbox to another mailbox.
- The SUBTRACT instruction subtracts data in
-
- the calculator from a mailbox.
-
- the in basket from a mailbox.
-
- a mailbox from the calculator.
-
- one mailbox from another mailbox.
- The INPUT instruction takes data from the
-
- in basket and places it in a mailbox.
-
- mailbox and places it in the in basket.
-
- mailbox and places it in the calculator.
-
- in basket and places it in the calculator.
- The OUTPUT instruction takes data from the
-
- out basket and places it in a mailbox.
-
- mailbox and places it in the out basket.
-
- out basket and places it in the calculator.
-
- calculator and places it in the out basket.
- The COFFEE BREAK (HALT) instruction
-
- pauses the program.
-
- clears all mailboxes.
-
- empties the out basket.
-
- ignores the address portion of the instruction.
- A LOAD command will leave the original data in the mailbox
-
- deleted.
-
- corrupted.
-
- unchanged.
-
- overwritten.
- A LOAD command will leave the original data in the calculator
-
- deleted.
-
- corrupted.
-
- unchanged.
-
- overwritten.
- A STORE command will leave the original data in the mailbox
- deleted.
- corrupted.
- unchanged.
- overwritten.
- A STORE command will leave the original data in the calculator
- deleted.
- corrupted.
- unchanged.
- overwritten.
- An ADD command will leave the original data in the mailbox
- deleted.
- corrupted.
- unchanged.
- overwritten.
- An INPUT command will leave the original data in the calculator
- deleted.
- corrupted.
- unchanged.
- overwritten.
- An OUTPUT command will leave the original data in the calculator
- deleted.
- corrupted.
- unchanged.
- overwritten.
- Which sequence of commands is needed to enter two numbers into the LMC (using the INPUT command)?
- INPUT, ADD, INPUT
- INPUT, LOAD, INPUT
- INPUT, STORE, INPUT
- INPUT, ENTER, INPUT
- The BRANCH UNCONDITIONALLY instruction changes the value in the
- mailbox.
- calculator.
- out basket.
- program counter (also called instruction location counter).
- The BRANCH ON ZERO instruction "jumps" if the value in the
- mailbox is zero.
- in basket is zero.
- calculator is zero.
a) instruction location counter is zero.
- The BRANCH ON POSITIVE instruction "jumps" if the value in the
- mailbox is positive.
- in basket is positive.
- calculator is positive.
- instruction location counter is positive.
- The instruction cycle can be broken into these two parts
- fetch and decode.
- fetch and execute.
- decode and execute.
- execute and increment.
- The LMC knows which mailbox contains the next task by looking at the
- calculator.
- in basket.
- current mailbox.
- program counter (instruction location counter).
- What is the value in the calculator after the first instruction (505) is completed?
- 1
- 2
- 3
- 6
- What is the value in the program counter (instruction location counter) after the first instruction (505) is completed?
- 01
- 02
- 03
- 04
- What is the value in the calculator after the fetch but before the execute portion of second instruction (106)?
- 1
- 2
- 3
- 6
- What is the value in the calculator after the second (106) instruction is completed?
- 1
- 2
- 3
- 4
- What is the value in the calculator after the third instruction (507) is completed?
- 1
- 2
- 3
- 6
- What is the value in the calculator when the program is finished, i.e., when the halt instruction has been executed?
- 1
- 2
- 3
- 6
- What is the value in the calculator after the first instruction (602) is completed?
- 1
- 2
- 3
- unknown
- What is the value in the program counter (instruction location counter) after the first instruction (602) is completed?
- 01
- 02
- 03
- 06
- What is the value in the calculator after the instruction 507 is completed?
- 1
- 2
- 3
- 6
- What instruction is never executed? a) 602
b) 106
c) 507
d) 902
- What data (DAT) value is never used?
- 1
- 2
- 3
- 6
- What is the value in the program counter (instruction location counter) when the program is finished?
- 03
- 04
- 05
- 06
- What is the value in the calculator when the program is finished?
- 1
- 2
- 3
- 6
- In the von Neumann architecture, memory holds
- data only.
- instructions only.
- data and instructions.
- neither data and instructions.
- In the von Neumann architecture, memory is addressed
- by location number.
- by the value stored.
- by contents of the memory location.
- None of the above.
Discussion Questions
-
- Using the LMC program below, add comments to explain what the result (value in the calculator) is after the completion of each instruction. The first one is completed as an example.
Mailbox Contents Result after completion
|
00 |
901 |
Read contents from in basket and store in calculator |
|
01 |
319 |
|
|
02 |
901 |
|
|
03 |
320 |
|
|
04 |
219 |
|
|
05 |
709 |
|
|
06 |
518 |
|
|
07 |
902 |
|
|
08 |
000 |
|
|
09 |
517 |
|
|
10 |
902 |
|
|
11 |
000 |
|
|
17 |
DAT |
|
|
18 |
DAT |
|
|
19 |
DAT |
|
|
20 |
DAT |
|
-
- Refer to the LMC program in question (1). Suppose the contents of mailbox 17 = 5; contents of mailbox 18 = 1.
-
-
- What is the final value in out basket if the first in basket is 56 and second in basket is 89?
-
-
-
- What is the final value in out basket if the first in basket is 75 and second in basket is 75?
-
-
-
- What is the final value in out basket if the first in basket is 89 and second in basket is 56?
-
-
- Describe what the LMC program in question (1) does. Suppose the contents of mailbox 17 = 5; contents of mailbox 18 = 1.
-
- Refer to the LMC program below and the table of op codes given above.
-
-
- What is the first number placed in the out basket?
-
-
-
- What is the last number placed in the out basket?
-
Mailbox Contents
00 517
01 218
02 902
03 705
04 601
05 000
……………..
- 100 DAT
- 2 DAT
-
- Refer to the LMC program in question (4). Change DAT in mailbox 18 to 4.
-
-
- What is the first number placed in the out basket?
-
-
-
- What is the last number placed in the out basket?
-
-
- Describe what the LMC program in question (4) does.
-
- Refer to the LMC program below. Write down what the calculator will hold after the instruction is complete in each loop. The first one is completed as an example.
00 517 1 2 3 4
01 118
02 317
03 219
04 710
05 600
……………..
|
|
17 |
1 |
DAT |
|
18 |
1 |
DAT |
|
|
|
19 |
5 |
DAT |
-
- Refer to the LMC program in question (7). How did the contents of mailboxes 17-19 change for each loop?
-
- What instruction should be placed in mailbox 02 so the program loops 4 times? Refer to the table of op codes above.
Mailbox Contents
00 517
01 218
02 ???
03 317
04 902
05 600
06 000
…………….. 17 10
18 2
Sol: The contents of address 02 should be 706 to loop 4 times.
-
- Describe what the following LMC program does. Refer to the table of op codes above.
Mailbox Contents
00 901
01 309
02 207
03 902
04 708
05 602
06 000
07 1
08 000
09 DAT
-
- The contents in memory occasionally have to be moved to another area of memory. When that happens, the mailbox references must be adjusted so that the program continues to function properly. Rewrite the LMC code in problem (10) so that it occupies mailboxes 05 through 14 only; mailboxes 01 through 04 will be used by another program, so they can't be used. Assume that instruction 605 remains in mailbox 00.
Mailbox Contents
|
|
00 |
605 |
|
01 |
used by other program |
|
|
02 |
used by other program |
|
|
03 |
used by other program |
|
|
04 |
used by other program |
|
|
05 |
??? |
|
|
06 |
??? |
|
|
07 |
??? |
|
|
08 |
??? |
|
|
09 |
??? |
|
|
10 |
??? |
|
|
11 |
??? |
|
|
12 |
??? |
|
|
13 |
??? |
|
|
14 |
??? |
|
|
|
|
|
-
- Describe the LMC three-digit instruction format. How does the LMC know what part of the value is an instruction, and what part is an address?
-
- How does the LMC "know" if a particular mailbox contains data or instructions?
-
- What happens if the LMC is executing a program and never encounters a "HALT" command?
-
- Describe how the LMC is von Neumann architecture.
Expert Solution
PFA
Archived Solution
You have full access to this solution. To save a copy with all formatting and attachments, use the button below.
For ready-to-submit work, please order a fresh solution below.





