ITEC 1000-B Introduction to Information Technologies

AP/ITEC 1000-B: Introduction to Information Technologies

What You Need to Do

In this assignment you will create a simple LMC program to input a series of numbers and count them.

The numbers will be placed sequentially in the In Basket of the LMC. The number 000 will be used to mark the end of the series of numbers. 000 is not considered as part of the series, and should not be counted.

Your program will read each number in order and will store it somewhere in memory.

Because the memory of the LMC is limited to 100 mailboxes, some of which are going to be used for your program, you must set up a limit to how many numbers you can read and store (your choice, but obviously somewhat less than 100). Your program must work for ANY number of input values.

Your program will stop reading numbers from the In Basket when one of the following two conditions is met:
a) The special “marker” number 000 was read from the In Basket, or
b) The storage limit you set up was reached

When the program stops reading numbers from the In Basket, it should output the count (how many numbers, marker not included, were read) and stop.

The program should be presented in a table format like the sample below (you may recognize this program as Figure 4.4 from the textbook):

Mailbox #

Op Code

Address

Comment

00

IN

Read in first data item

01

STO

10

Store first number in mailbox 10

02

IN

Read in second data item

03

STO

11

Store second number in mailbox 11

04

SUB

10

Subtract first number from second number

05

BRP

08

Positive result, branch to printing it

06

LDA

10

Negative or 0 result, reverse order

07

SUB

11

Subtract second number from first number

08

OUT

Send the positive difference to the Out Basket

09

COB

End of program

10

DAT

Storage for the first number

11

DAT

Storage for the second number

….

99

Use Microsoft Excel to create this table. Make sure to:
- Show all memory mailboxes in use (you can use the ellipsis symbol … to represent unused mailboxes, or mailboxes with the same use as its neighbours, to avoid repetitive information)
- Include helpful comments (not restatements of the meaning of the op code)
- Identify the actual address part, where addresses are relevant

To test this program, you need to consider all the possible scenarios:
a) No numbers (first input is the marker 000)
b) Some numbers below the capacity limit are entered
c) More numbers than the capacity limit are entered.

Make sure your program works correctly in all three scenarios.
Pick either scenario b) with 3 numbers entered, or scenario c) using 3 as the capacity limit, and show the complete content of the LMC after each instruction is executed. Put the results in a table like this (the table below is the actual testing data for the program sample in the first table, using 069 and 047 as input numbers):

Content after instruction

Initial

1

2

3

4

5

6

7

8

9

Accumulator

000

069

047

-022

069

022

Loc. Counter

00

01

02

03

04

05

06

07

08

09

Mailbox #

00

901

01

310

02

901

03

311

04

210

05

808

06

510

07

211

08

902

09

000

10

000

069

11

000

047

In columns labelled 1, 2, 3, etc. do not enter values that have not changed from the previous column (otherwise it is very hard to mark). Breaking this requirement will result in a one mark penalty.

Marking scheme:
- 3.5 marks for the correct program
- 3.5 marks for the correct test table
- A subtractive marking scheme will be use (i.e., 0.25 marks will be subtracted for each error)
- An error is wrong content in any one of the cells of your two spreadsheets.

Answer Detail

Get This Answer

Invite Tutor