Solve problems by programming the simple computer

Assignment Help Basic Computer Science
Reference no: EM132165369

Basic Computer Science Assignment -

The goal of this assignment is to solve problems by programming the Simple Computer (version 3) in its machine language.

You are to write a machine-language program to solve each of the problems given below. As a reminder, the instruction set of our machine language is as follows:

Instruction

Operation

Mnemonic

0 0 0 a b c d e

M[abcde] ← R0

STORE

0 0 1 a b c d e

M[abcde] ← R1

STORE

0 1 0 a b c d e

R0 ← M[abcde]

LOAD

0 1 1 a b c d e

R1 ← M[abcde]

LOAD

1 0 0 a b c d e

Ra ← Rb opde Rc

ALU

To solve each problem, you must come up with a sequence of machine instructions that carries out the specified computation. To do this, carefully follow the steps given below.

1. Break up the problem into individual instructions that are each small enough be executed by the computer.

2. Write out the instructions of the program symbolically, as in the "Operation" column of the instruction set above.

3. Translate each symbolic instruction into binary using the templates in the "Instruction" column of the instruction set.

4. Translate each binary instruction into hexadecimal.

5. Test your program on Simple Computer 3 by entering the instructions, along with test data, into the RAM and then running the program.

Here are some notes about running machine-language programs on Simple Computer 3:

  • Download the Logisim file containing the circuits for Simple Computer 3 (simple computer3.circ).
  • Keep in mind that the first instruction should always be at location 0 of the RAM because the program counter will start at 0.
  • To run your program, clock through the fetch-decode-execute cycle for each instruction as we have done in class.

1. To fetch the first instruction, set the "Fetch/Execute" bit to 0 and the "Clock" bit to 1. (Watch the instruction be loaded into the instruction register.)

2. To execute the first instruction, set the "Fetch/Execute" bit to 1 and the "Clock" bit to 0. (Watch the register or RAM contents be updated appropriately.)

Monitor the program counter to ensure that the instructions are being fetched/executed one-at-a-time and in order.

  • To reset every RAM location and register to zero, go to Logisim's "Simulate" menu and select "Reset Simulation:' You will want to do this every time you restart a program or start a new program.
  • Every time you reset the simulation, the RAM is cleared. So, if you need to restart a program, you must re-enter the instructions and the test data into RAM. You can avoid a lot of typing if you save and restore the RAM contents to and from file. Right-click on the RAM to reveal these options ("Save Image..." and "Load Image..").

To ensure that your solutions are clear and neat, either fill in or use as a template the table in this MS Word file 'v (also available as a Pages file and an OpenOffice file). To receive full credit, your solutions must include the machine-language instructions (expressed both in binary and in hex) and a symbolic summary of each instruction.

As a guide, consider this example file that gives a machine-language program that solves the problem: "Put (M[12] + M[13]) - (M[14] + M[15]) and store the result in M[11]".

To complete this assignment, solve the six problems below. In all of these problems, the numbers of the memory locations are given in decimal. However, when you work with the RAM in the simulator, you must use hexadecimal. Test your solutions extensively using the Simple Computer 3 in Logisim. DO NOT FORGET: At the start of each problem, you may not assume anything about the contents of RAM, R0, or R1.

1. Store M[3] into M[4]. (In other words, store the contents of memory location 3 into memory location 4.)

2. Store M[11] + M[12] into M[17].

3. Swap the contents of M[7] with the contents of M[6]. Do not modify any other memory locations.

4. Replace M[9] with its complement. (Recall: To complement a number, flip every bit.)

5. Store the number 1 into M[5]. Assume all arithmetic is two's complement.

6. Store the number M[16] - 1 into M[12], the number M[16] - 2 into M[13], the number M[16] - 3 into M[14], and the number M[16] - 4 into M[15]. Assume all arithmetic is two's complement.

Note - Save your solutions to a file and include your name at the top. Export to PDF format and submit.

Attachment:- Assignment Files.rar

Reference no: EM132165369

Questions Cloud

Develop the current technological appliances in daily life : Democritus, Dalton, Thomson, Rutherford, and Bohr all had major accomplishments in uncovering the fundamental building blocks of matter.
Create a fictitious scenario in which a client is referred : Create a fictitious scenario in which a client is referred to you by her or his family physician for an applied psychology treatment to help manage pain.
What effects climate change : What effects climate change? Provide examples. What causes global warming? Provide examples.
Explore how economic development could result : Environmental health risks are ever-present in developed countries and are principally attributed to municipal air pollution and water pollution.
Solve problems by programming the simple computer : The goal of this assignment is to solve problems by programming the Simple Computer (version 3) in its machine language
What do you manage to live without : When the power goes out, explain your biggest inconvenience. What do you manage to live without?
How the hotel guests can be classified : How the hotel guests can be classified by predicating their additional spendings - Research on identifying the best performing hotels in a group of hotels
Describe and analyze the philosophies of three african : Describe and analyze the philosophies of three major African American race leaders or artists in the period between the Civil War and World War II.
Examine the depiction of king philips war : Examine the depiction of King Philip's War (Metacom's War). Describe what advantages Native Americans might have had that are not depicted here?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd