Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Learning objectives

Upon successful completion of this coursework, the student is expected to:

Be aware of the diversity in Instruction Set Architectures and the issues architects consider when designing new ISAs.

Become familiar with assembly language programming and its relationship to high-level languages, both in theory and practice.
Understand the details of CPU and memory organization.

Understand the operation of the CPU Fetch-Decode-Execute cycle.

Appreciate the technique of software simulation to test designs, such as Instruction Set Architectures.
Be familiar with information units (bits, bytes, words) and number systems (binary, decimal, hexadecimal).

Description / Scenario

As a computer architect, you are given the task to design a simplified computer with its own RISC Instruction Set Architecture. Having this task completed, your next step is to test the new ISA by writing an interpreter that simulates programs in this language.

The designed computer has a 2 -byte word size (hence, the term "word" is redefined in this project to mean 2 rather than 4 bytes), is equipped with a total of 16 general purpose registers of size one word, numbered 0 to 15, and a small main memory (RAM) of 256 words. The computer CPU also contains one program counter (PC) register and one instruction register (IR) where the current instruction is temporarily stored. Given these characteristics, the new ISA is a simplified version of MIPS, which consists of fixed-size 16-bit instructions, i.e. they occupy one word of the memory. More details in attached file.

Task 1

Manually write machine language programs in the newly-designed ISA for the following:

a) Read a positive number n from the keyboard and compute and display its partial sum, calculated by n(n+1)/2

b) Read a positive number from the keyboard and compute and display the smallest power of two, which is larger than the read number. E.g. for 1000, the program should produce 1024.

c) Read a series of integer numbers, and determine and display the largest number. The first number read indicates how many numbers should be processed.

Associate each line of the program with a short comment or explanation.

Task 2

In this task you are going to develop your own interpreter of the new ISA, in your programming language of choice. This will turn the machine into a simulator of the newly- designed computer system and test its operation, before having to invest huge sums of money in the manufacture of its hardware chips!

Although students have the choice of command-line versus graphical interface for the ISA simulator, they are recommended to keep it simple with a Command Line Interface (CLI). The simulator begins its execution by prompting the user to enter the program one hexadecimal line (word) at a time for each memory address, starting from 00. User signals the end of the program by a special value, e.g. -11111. As the program is entered, the simulator loads it into the memory.

The memory can be represented with a one- dimensional array of 256 integer elements (since instructions as well as data are numbers). In this design the memory is word-addressed rather than byte-addressed. If the second were the case, the simulator would be slightly more complex by accessing memory at even-number locations, and PC would have to be incremented by 2 each time.

Next, the simulator executes the program. Execution begins with the instruction in location 00 and continues sequentially, unless a transfer of control instruction is encountered.

CPU registers (16 general, 1 PC and 1 IR) will have to be stored in separate variables. Also use a variable to hold the op-code of the instruction currently being executed. Do not execute instructions directly from memory. Rather, "fetch" the next instruction to be performed (incrementing PC as appropriate) from the memory array to the IR. Then "pick off" the leftmost hexadecimal digit and place it in op-code variable. Decode the instruction based on the op-code (e.g. through a "switch" structure) and based on the instruction type read the rest of the fields in separate variables. Keep in mind that when the simulated computer begins execution, the registers are all initialized to zero.

When the assembly program completes execution, the name and contents of each register, as well as the contents of memory should be displayed ("computer dump"). In order to keep the output size manageable, do not display all 256 words, but say the first 100 words in memory.

At this point, you should be able to implement the new ISA simulator and run each of the assembly programs in Task 1.

You are encouraged to extend the simulator to check for various types of errors. For example, during the program-loading phase, each hexadecimal number that is entered must be in the range -ffff to +ffff.

During the execution phase, the simulator should check for various types of errors, such as detecting an instruction with invalid op-code, or outside the range (e.g. negative), register overflows and underflows during arithmetic instructions, etc. Other types of execution errors could be attempts to divide by zero. Whenever errors are encountered, the simulator should terminate with the display of the appropriate message, as well as a full computer dump. This treatment will help the user debug the assembly programs.

The student should be careful to make the necessary conversions between hexadecimal and decimal number systems and not confuse the two. In Java, the library class Integer provides methods that parse a hexadecimal string to an integer, and vice versa, output an integer as a hexadecimal string.

Attachment:- Handout.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92682627
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question discuss the principle of least privilege in at

Question: Discuss the principle of least privilege in at least 250 words. Explain how this principle impacts data security. The response must be typed, single spaced, must be in times new roman font (size 12) and must fo ...

Structureswrite the program in c onlytask create a seating

Structures Write the Program in C++ only. Task: Create a seating reservation program for Podunk Airlines. The air fleet consists of a single plane with a seating capacity of 12. The plane makes one flight daily. Your pro ...

How to solve this question by using r languageyou can

How to solve this question by using R Language? You can attach the Boston data set in the MASS package. library(MASS) For the Boston data set, we are interested in predicting whether a given suburb has a crime rate above ...

This is sports data analysis class please help me out with

This is sports data analysis class. please help me out with this assignment. Background Bill James created a career projection system he called his "favorite toy," presumably because he liked projecting the career totals ...

Question what is a ipsec ssl vpn dtls dmarc pki pem ssh

Question : What is a( IPSEC, SSL , VPN, DTLS , DMARC, PKI, PEM, SSH, Kerberos, DKIM) ?. Brifley and answer the following brief. Identify the security problems How the security protocol was used to solve the problems OR e ...

Analyse two of the three technologies provided focus

Analyse two of the three technologies provided (focus virtualisation, cloud computing and green computing). Summarise what each of your two selected technologies is, and what the technology does. Explain what improvement ...

Question reversing the elements of an array involves

Question : Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the second with the next to the last, and so on, all the way to the middle of the array. G ...

What happens when volatility increases what does volatility

What happens when volatility increases? What does volatility percentage mean?

Request this to be done in jgrasp1 add a method to the

Request this to be done in JGrasp 1. Add a method to the program that calculates the cube of every number between a lower bound and an upper bound that a user inputs (for instance, lower bound 1 and upper bound 9, for be ...

A company is considering producing a new product based on

A company is considering producing a new product. Based on past records, management believes that there is a 70 percent chance that the new product will be successful, and a 30 percent chance it will not be successful. M ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As