ITEC 1000 Assignment #2
Total = 100 marks (Solutions);
· 5 marks polish designate and unconcealed format
Instructions:
· All questions are fixed on Englander -- Chapters 6 & 7.
· Use a engagement processor (if you use a non-MS WORD congruous program, e.g., Pages, preserve as PDF or RTF).
· Both questions and defenses must be right formatted (including consultations) and courteous presented after a while abundance style.
· Be confident to designate the polish as your bountiful designate in the subjoined format (lowercase), e.g., peggy_carter.docx
· Submit via the upattack converge granted at the way seat any opportunity antecedently or by the deadline, March 26, 11 PM (sharp); recent submissions allure not be certain.
· Apply the LMC counsel set adown to defense pertinent questions.
LMC Counsel Set Instruction
Mnemonic
Numeric Code
Load
LDA
5xx
Store
STO
3xx
Add
ADD
1xx
Subtract
SUB
2xx
Input
IN
901
Output
OUT
902
End
HLT
000
Branch/Jump
BR
6xx
Branch if zero
BRZ
7xx
Branch if naught or absolute
BRP
8xx
Data storage
DAT
xxx
1. Trace the program adown and incorporate what the program does; not a continuous style of each counsel. [5 marks]
Address / Mailbox #
Assembly / Mnemonic
Numeric Code
00
IN
901
01
STO 90
390
02
IN
901
03
STO 91
391
04
LDA 90
590
05
OUT
902
06
LDA 91
591
07
OUT
902
08
HLT
000
…
90
DAT 0
000
91
DAT 0
000
2. Complete the consultation adown to invent an LMC program that allure confirm a set of three aggregate as INPUT and then add the primitive two aggregate and output the defense, then take the primitive sum from the third and output the defense. The program starts at harangue 00 and axioms is stored in harangue 90. [20 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
00
IN
901
Input primitive sum
01
3. Complete the consultation adown and invent an LMC program that allure confirm a sum INPUT and OUTPUT a posteriority of aggregate, starting at 1 and finishing after a while the INPUT (maxNumber). The opposed must be primalized to naught each opportunity the program is run. The program allure hold (loop) until a 0 is entered. [20 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
00
attack naught (from 93) to the accumulator
01
Store the primal count
02
input
03
If naught, spray to halt
04
Store maxNumber
05
LoopTop attack count
06
Add stalk to opposed
07
Store count
08
Output
09
Subtract maxNumber
10
If absolute, endLoop
11
Jumpt to loopTop
12
endLoop bound to start
13
Halt execution
90
stalk DAT 1
91
maxNumber DAT
92
count DAT
93
naught DAT
4. Complete the consultation adown to invent an LMC program that allure confirm two INPUT aggregate and then OUTPUT the senior of the two. The program should start at harangue 00 and axioms should be stored in haranguees startning at 90. [25 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
5. Consider the LMC program adown in which 2 aggregate are entered and adventitious. Suppose the primitive input record was stored in mailbox dregs 00.
a. Would the program possess manufactured the identical fruit?
b. What would possess happened if the program were done a succor opportunity?
c. What peculiarity of the computer makes this penny? [5 marks]
Mailbox
Address
Numeric
Code
00
901
01
306
02
901
03
106
04
902
05
000
06
000
6. If a computer has a 38-bit retrospect harangue record. How considerable retrospect can this computer harangue? (Assume: 1 byte/cell; use the most expend meaconfident part). Show your effect. [5 marks]
Consider the subjoined LMC counsels set in the consecrated dregss in retrospect.
Mailbox Address
Mnemonic Code
15
LDA 40
16
ADD 41
…
40
723
41
021
7. Show the CPU Fetch/Execute cycle stalks and the values of Counsel Record (IR), the Program Opposed (PC), the Retrospect Harangue Record (MAR), the Retrospect Axioms Record (MDR), and Accumulator (A) when the counsel in harangue 15 is completed. [5 marks]
F/E cycle
Register Values
8. Show the variation of each record as each stalk of the F/E cycle is done for counsel 16 in the over program. [10 marks]
F/E cycle
PC
MAR
MDR
IR
A
PC ® MAR
MDR ® IR
IR [address] ® MAR
A + MDR ® A
ITEC 1000 Assignment #2
Total = 100 marks (Solutions);
· 5 marks polish designate and unconcealed format
Instructions:
· All questions are fixed on Englander -- Chapters 6 & 7.
· Use a engagement processor (if you use a non-MS WORD congruous program, e.g., Pages, preserve as PDF or RTF).
· Both questions and defenses must be right formatted (including consultations) and courteous presented after a while abundance style.
· Be confident to designate the polish as your bountiful designate in the subjoined format (lowercase), e.g., peggy_carter.docx
· Submit via the upattack converge granted at the way seat any opportunity antecedently or by the deadline, March 26, 11 PM (sharp); recent submissions allure not be certain.
· Apply the LMC counsel set adown to defense pertinent questions.
LMC Counsel Set Instruction
Mnemonic
Numeric Code
Load
LDA
5xx
Store
STO
3xx
Add
ADD
1xx
Subtract
SUB
2xx
Input
IN
901
Output
OUT
902
End
HLT
000
Branch/Jump
BR
6xx
Branch if zero
BRZ
7xx
Branch if naught or absolute
BRP
8xx
Data storage
DAT
xxx
1. Trace the program adown and incorporate what the program does; not a continuous style of each counsel. [5 marks]
Address / Mailbox #
Assembly / Mnemonic
Numeric Code
00
IN
901
01
STO 90
390
02
IN
901
03
STO 91
391
04
LDA 90
590
05
OUT
902
06
LDA 91
591
07
OUT
902
08
HLT
000
…
90
DAT 0
000
91
DAT 0
000
2. Complete the consultation adown to invent an LMC program that allure confirm a set of three aggregate as INPUT and then add the primitive two aggregate and output the defense, then take the primitive sum from the third and output the defense. The program starts at harangue 00 and axioms is stored in harangue 90. [20 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
00
IN
901
Input primitive sum
01
3. Complete the consultation adown and invent an LMC program that allure confirm a sum INPUT and OUTPUT a posteriority of aggregate, starting at 1 and finishing after a while the INPUT (maxNumber). The opposed must be primalized to naught each opportunity the program is run. The program allure hold (loop) until a 0 is entered. [20 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
00
attack naught (from 93) to the accumulator
01
Store the primal count
02
input
03
If naught, spray to halt
04
Store maxNumber
05
LoopTop attack count
06
Add stalk to opposed
07
Store count
08
Output
09
Subtract maxNumber
10
If absolute, endLoop
11
Jumpt to loopTop
12
endLoop bound to start
13
Halt execution
90
stalk DAT 1
91
maxNumber DAT
92
count DAT
93
naught DAT
4. Complete the consultation adown to invent an LMC program that allure confirm two INPUT aggregate and then OUTPUT the senior of the two. The program should start at harangue 00 and axioms should be stored in haranguees startning at 90. [25 marks]
Mailbox #
Mnemonic
Numeric code
Instruction Description
5. Consider the LMC program adown in which 2 aggregate are entered and adventitious. Suppose the primitive input record was stored in mailbox dregs 00.
a. Would the program possess manufactured the identical fruit?
b. What would possess happened if the program were done a succor opportunity?
c. What peculiarity of the computer makes this penny? [5 marks]
Mailbox
Address
Numeric
Code
00
901
01
306
02
901
03
106
04
902
05
000
06
000
6. If a computer has a 38-bit retrospect harangue record. How considerable retrospect can this computer harangue? (Assume: 1 byte/cell; use the most expend meaconfident part). Show your effect. [5 marks]
Consider the subjoined LMC counsels set in the consecrated dregss in retrospect.
Mailbox Address
Mnemonic Code
15
LDA 40
16
ADD 41
…
40
723
41
021
7. Show the CPU Fetch/Execute cycle stalks and the values of Counsel Record (IR), the Program Opposed (PC), the Retrospect Harangue Record (MAR), the Retrospect Axioms Record (MDR), and Accumulator (A) when the counsel in harangue 15 is completed. [5 marks]
F/E cycle
Register Values
8. Show the variation of each record as each stalk of the F/E cycle is done for counsel 16 in the over program. [10 marks]
F/E cycle
PC
MAR
MDR
IR
A
PC ® MAR
MDR ® IR
IR [address] ® MAR
A + MDR ® A