This document provides instructions for creating a simple CPU simulator in CPU Sim. It discusses allocating memory, defining registers and RAM, writing text and machine code files. The instruction cycle is explained as fetching, decoding, checking addresses, and executing instructions. Steps are given for adding two integers as an example, including defining fields and formats, providing micro-instructions and fetch sequences, and writing machine instructions to match the text file commands. Indexing direction and file saving are also covered.
Original Description:
POWER POINT PRESENTATION ON HOW TO USE CPU SIMULATOR
This document provides instructions for creating a simple CPU simulator in CPU Sim. It discusses allocating memory, defining registers and RAM, writing text and machine code files. The instruction cycle is explained as fetching, decoding, checking addresses, and executing instructions. Steps are given for adding two integers as an example, including defining fields and formats, providing micro-instructions and fetch sequences, and writing machine instructions to match the text file commands. Indexing direction and file saving are also covered.
This document provides instructions for creating a simple CPU simulator in CPU Sim. It discusses allocating memory, defining registers and RAM, writing text and machine code files. The instruction cycle is explained as fetching, decoding, checking addresses, and executing instructions. Steps are given for adding two integers as an example, including defining fields and formats, providing micro-instructions and fetch sequences, and writing machine instructions to match the text file commands. Indexing direction and file saving are also covered.
INTRODUCTION CPU SIM is a software development environment for the simulation of simple computers.. With this application the user is able to simulate new or existing simple CPUs. Users can create new virtual CPUs with custom machine language instructions, which are implemented by a sequence of micro instructions. CPU Sim allows the user to edit and run assembly language programs for the CPU being simulated. Allocating memory Computer instruction are normally stored in consecutive memory locations and are executed sequentially one at a time. The memory unit has capacity of 4096 words and each word contains 16 bits if memory is defined as 4096×16 12 bits of an instruction word are needed to specify the address of an operand. This leaves 4 bits for operation part (op code ) of the instruction in unsinged bit format and 3 for operation part of instruction in singed bit format one bit is to specify a direct and indirect address. INSTRUCTION CYCLE
CPU Simulator executes the series of instructions through the
repeated execution of fetch sequence and instruction cycle INSTRUCTION CYCLE CONSISTS OF : * FETCH * DECODE * CHECK FOR THE DIRECT AND INDIRECT ADDRESS * EXECUTE THE INSTRUCTION FLOWCHART OF INSTRUCTION CYCLE STEPS FOR ADDING TWO INTEGERS IN CPU SIM Before starting REGISTERS ARE DEFINED RAM and CONDITION BIT are defined Write the text file MICRO-INSTRUCTIONS are provided FETCH SEQUENCE is provided MACHINE INSTRUCTION FOR EACH COMMAND IN TEXT FILE DEFINING FIELDS FORMAT FOR FIELD ALLOCATION HOW TO SAVE THE FILE Text file shoul be saved with the extension .a Machine shoul be saved with the extension .cpu in the compute. INDEXING:
In this program indexing is done from left to
right. One should be careful while mentioning indexes in the instructions as it should match the direction Set up in the machine. POST EXECUTION THANK YOU