Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

to write a program to “simulate” the operations of a theoretical machine called

ID: 3724849 • Letter: T

Question

to write a program to “simulate” the operations of a

theoretical machine called

ITSIAC

. You are to simulate the machine in accordance with the handouts provided by

your instructor. NO EXTERNAL DOCUMENTATION IS REQUIRED FOR THIS PROGRAM.

However, your programs must be very

readable, well structured, and include a very healthy dose of internal documentation (program comments).

A

generalized algorithmic approach to the program is given below.

PROGRAM SPECIFICATIONS:

All printed output must be in

hexadecimal

format and be appropriately labeled. Input

data will be in simulated

binary

format. You may use any number system to process the data.

PROCESSING:

This program is to simulate executing a program that computes a total for a group of numbers.

While the program is running, keep a record of

BOTH

the number of machine level instructions executed and the

number of microinstructions executed. Use two counters - One to keep track of the number of ML instructions

(LOAD,STORE,ADD,SUBTRACT, etc.) executed and the other is to keep track of the number of microinstructions

executed. THESE COUNTERS MAY BE GLOBAL VARIABLES.

Explanation / Answer

Spaces are included in the data shown below to aid readability. Spaces WILL NOT appear in the actual

       data file.

           Decimal numbers           Binary equivalent (actual data) with spaces shown for readability only

PROGRAM     03 100                   0000 0011 0110 0100

            02 100                   0000 0010 0110 0100

            04 100                   0000 0100 0110 0100

            03 50                   0000 0011 0011 0010

            01 100                   0000 0001 0110 0100

            04 100                   0000 0100 0110 0100

            03   3                   0000 0011 0000 0011

            02 20                   0000 0010 0001 0100

            06 13                   0000 0110 0000 1101

            03   3                   0000 0011 0000 0011

            01 19                   0000 0001 0001 0011

            04   3                   0000 0100 0000 0011

            05 03                   0000 0101 0000 0011

            07                  0000 0111 1111 1111

            08                    0000 1000 1111 1111

                               1111 1111 1111 1111

                               1111 1111 1111 1111

                               1111 1111 1111 1111

                               1111 1111 1111 1111

            00 01                   0000 0000 0000 0001

            03 99                   0000 0011 0110 0011

            XXXXX

DATA     Decimal   Binary equivalent     Decimal    Binary equivalent       

            -34    1111 1111 1101 1110       218    0000 0000 1101 1010

            362    0000 0001 0110 1010        16    0000 0000 0001 0000

             91    0000 0000 0101 1011        32    0000 0000 0010 0000

            -33   1111 1111 1101 1111       829    0000 0011 0011 1101

              7    0000 0000 0000 0111         2    0000 0000 0000 0010

             22    0000 0000 0001 0110        82    0000 0000 0101 0010

             61    0000 0000 0011 1101        36    0000 0000 0010 0100

            492    0000 0001 1110 1100        74    0000 0000 0100 1010

           -227    1111 1111 0001 1101       -53    1111 1111 1100 1011

            923    0000 0011 1001 1011       118    0000 0000 0111 0110

             29    0000 0000 0001 1101       291    0000 0001 0010 0011

            -61    1111 1111 1100 0011      -263    1111 1110 1111 1001

             67    0000 0000 0100 0011        23    0000 0000 0001 0111

            552    0000 0010 0010 1000        22    0000 0000 0001 0110

             81    0000 0000 0101 0001        14    0000 0000 0000 1110

           -733    1111 1101 0010 0011       448    0000 0001 1100 0000

           -619    1111 1101 1001 0101      -526    1111 1101 1111 0010

              4    0000 0000 0000 0100       916    0000 0011 1001 0100

             26    0000 0000 0001 1010       172    0000 0000 1010 1100

             70    0000 0000 0100 0110       329    0000 0001 0100 1001

            152    0000 0000 1001 1000       199    0000 0000 1100 0111

          185    0000 0000 1011 1001        29    0000 0000 0001 1101

            627    0000 0010 0111 0011      -261    1111 1110 1111 1011

           -991    1111 1100 0010 0001       842    0000 0011 0100 1010

            -18    1111 1111 1110 1110        82    0000 0000 0101 0010