programming assignment
ITSIAC ASSIGNMENT
CSC 40600PRIVATE February 8, 2016
Your individual assignment in CSC 40600 is 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. The program is due on March 24, 2016 (The Thursday before Spring Break – note Friday is Easter Break).
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.
INPUT: The data will consist of two parts. The first part will be the Machine Language code that is to be executed. The second part will contain the numeric data . The input data file is located on PC Common under the name of Data_its.txt. A sentinel character string of 16 Xs will be used to separate the two parts of the input file. Each Machine Language instruction will be a sixteen digit binary number consisting of two parts. The first part is eight characters long and will represent the Op Code. The second part will also be eight characters long and will represent the Operand. The Machine Language code is to be stored at the first location in your simulated Primary Storage.
The numeric data is stored using the two's compliment representation of integers and will also be in the form of a sixteen bit binary number. It will consist of a series of fifty numbers and will be of type INTEGER. Numeric data is to be stored in Primary Storage beginning at location number 50. The integer values will range from -999 up to and including +999 . Each record in the data file will contain one Machine Language instruction or one integer number.
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.
OUTPUT: Output for this program is to consist of four parts. They are:
1. ECHO print the input file. (Make sure it has a label)
2. Print the following AFTER all of the initialization is complete but BEFORE any micro code instructions are
executed: A. the contents of Primary Memory.
B. the contents of the seven ITSIAC registers.
3. After the program has completed its run, print primary storage and the contents of all the registers OUTPUT
MUST BE IN THE FORM OF HEXADECIMAL NUMBERS.
4. Then print the value of both counters using decimal format.
Remember all output (except the counters) is to be in hexadecimal notation. In addition, all output of
primary storage is to be in a table format of either a 16 x 16 array or an 8 x 32 array.
----------------------------------------------------------------------------------------------------------------
General Algorithm for the ITSIAC Simulation project.
1. Load the micro code instructions into Control Storage.
A. These instructions can to be read in from a file (created by you) that contains the micro code
instructions.
OR
B. Consist of a "hard coded" function in your program.
2. Create a look-up table of machine language operation codes and control storage locations where the micro
code for that operation begins. This may be done as in Step 1.
3. Initialize all the various registers and counters needed.
4. Create the table of micro‑operation op codes and the actual instructions to be performed.
(This is needed to simulate the actual instruction being performed at the gate level. It need
not be an actual table. The op code may be used in conditional statements to determine what
action needs to be executed. )
5. Load the machine language (ML) program code and the data into Primary Storage. This is the data file
created by the instructor. It simulates a user program being processed.
(This is where you read the data into the array that simulates Primary Memory.)
6. Print the first required DUMP information.
7. Run the program. Remember that your program is to include two 'Cycle Counters' that count the number of
machine language instructions and the number of microcode instructions which have been executed.
Executing the microcode instructions should result in the following cycle:
A. Fetch the instruction from Primary Storage.
B. Decode the instruction
C. Execute the instruction
D. Repeat Steps A thru C until done. (Remember to increment the CSIAR to execute the correct
microinstruction.)
8. Print the second required DUMP information. As well as the values of the counters and the contents of
the registers .
DATA for ITSIAC Simulation
NOTE: 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
Output Display Format
PROGRAM 0364 0264 0464 0332 0164 0464 0303 0214
060D 0303 0113 0403 0503 07FF 08FF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFDE 016A 005B FFDF 0007 0016
003D 01EC FF1D 039B 001D FFC3 0043 0228
0051 FD23 FD95 0004 001A 0046 0098 00B9
0273 FCEE FFEE 00DA 0010 0020 033D 0002
0052 0024 004A FFCB 0076 0123 FEF9 0017
0016 000E 01C0 FDF2 0394 00AC 0149 00C7
001D FEFB 034A 0052 FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FINAL
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF ANSWER IS
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 1262
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF