diff_months: 15

IFN551 Computer Systems Fundamentals Assignment

Download Solution Now
Added on: 2023-04-06 10:05:14
Order Code: 488452
Question Task Id: 0

PREAMBLE

LMC is a cartoonised assembly language that mimics the instruction set of many real-world architectures, including x86, ARM and others. These are modelled on the von Neumann computer system architecture, as proposed by John von Neumann in 1945. In learning LMC, you will gain an understanding of how the software system of a computer operates at a fundamental level. See the lectures and tutorials for more information about the architecture and instructions of LMC.

In this assignment, there are two questions; both are separated into sub-questions. Be sure to answer all questions. For each, a marking scheme is provided.

First, you are required to demonstrate your ability to interpret and solve a novel problem. You will design a solution to the problem by using natural language to explain your approach, and plan how you will test the implementation of this design. After designing your solution and test plan, you are required to implement the design using the LMC integrated development environment (IDE).

Second, with some provided code, you will describe its function and tidy it, to improve readability.

Academic integrity is taken very seriously at QUT. Ensure that the work you submit is your own and that you provide sufficient evidence of how you came to your final solution. If we have queries about your solution, you must be prepared to answer these when requested otherwise a grade of zero will be awarded.

You must make appropriate reference to the author(s) of works or ideas that you submit and are not your own. Do not directly copy, summarise, or claim to own any material that is not rightfully yours. This includes any works or ideas generated by artificial intelligence (AI). The use of AI in this assignment is discouraged and may hinder your ability to complete this assignment to our specifications. Any material submitted in this assignment will be the subject to intelligent algorithms that detect plagiarism and provide a measure of authenticity of your work.

You must adhere to the QUT Manual of Policies and Procedures, and agree to the terms below. You can access the QUT MOPP by searching MOPP in the HiQ website.

 QUESTION 1 (35 MARKS)

 Select the task according to the last digit of your student ID: 

9, 8, 7 Task 1-A

6, 5, 4 Task 1-B

3, 2, 1, 0 Task 1-C

For example: if your student ID is n98765435 then you will do Task B. Selecting the incorrect task will result in a grade of zero for this question. See the following pages for the Tasks.

  • UseLMC IDE 5.0.0 (or greater)
  • Enteryour student ID in the LMC IDE when completing this question
  • Failingto include the .lmc file in your submission will result in a grade of zero for 3
  • SufficientLMC file history must be available to demonstrate 

 Task 1-A

 Write a LMC program that converts an Unreal number into a decimal number. The Unreal number system is like the Roman number system; however, it has some exceptions and limitations. You must display the result as output before halting the program.

For example, the Unreal number CXI is 111, and XXXVI is 36.

Unreal digit

Natural number

I

1

V

5

X

10

L

50

C

100

D

500

Your program only needs to support the Unreal digits listed in the table above.

Your program will only be able to calculate a natural number up to and including 999. If the user enters an Unreal numeral which exceeds this, the output is to be 999.

Six (6) input values are provided by the user, the order of input is important: The first input is the number of D’s that the Unreal number contains.

The second input is the number of C’s that the Unreal number contains. The last input is the number of I’s that the Unreal number contains.

For example, if the user provides the inputs 0, 0, 0, 1, 2, 2 then this will be the equivalent of XVVII

Task 1-B

 Write a LMC program that can convert an n-bit binary number into a decimal number. Display the natural number as output before halting the program.

The first input determines the value for n. It is assumed this value will be equal to four, or greater. For example, if the first input is eight (8) then eight subsequent inputs are requested.

If the subsequent inputs number were 1, 0, 0, 1, 0, 0, 0, 0 then the output would be 9.

 n input values are provided by the user, one for each bit: The first of these is the least-significant bit.

The n’th input is the most-significant bit.

 Task 1-C:

 

Write a LMC program that calculates the sum of numbers provided by the user. Display the summation as output before halting the program.

If the user has provided less than or equal to ten input values, then only sum even numbers. Odd numbers are ignored.

 If the user has provided more than ten values, then only sum any odd numbers subsequent to the tenth input. The existing summation of even numbers shall remain.

If the user enters zero, at any point, then the summation is displayed. For example:

Input values: 3, 3, 4, 0 Result: 4

Input values: 2, 3, 7, 0 Result: 2

 Input values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 0 Result: 43

Question 1.1 (10 marks)

Describe your approach to solving the problem.

  • Use natural language, structured like a conventional programming language tocommunicate your 
  • Whennecessary, use looping and conditional 
  • Namesymbols sensibly to make their use 

 Cormen (2009) wrote an excellent introduction to the conventions of pseudocode (see Part I, chapter 2, section 1.2). You can read this by searching for the text via QUT Library.

 Cormen, Thomas H. Leiserson, Charles E. Rivest, Ronald L. Stein Clifford. (2009). Introduction to Algorithms (3rd Edition) - 2.1.2 Pseudocode Conventions. MIT Press.

 Question 1.2 (10 marks)

Draft a test plan to be used as a verification method to ensure that your LMC program is correct.

  • Tabularisetest input value(s) and the expected output(s)
  • Consider uncommon cases. For example, when the calculator reaches itsmaximum value, when negative values are calculated, or when an input is unexpectedly large.

 Draft your test plan using the following template (two examples are provided):

Comma-separate the input and output values. Delete the examples.

Input Value(s)

Expected output value(s)

Notes

2,4,6

10

All even numbers

1,3,5

9

All odd numbers

 Question 1.3 (15 marks)

Implement an LMC program according to the algorithm you designed in Q1.1.

Use the test suite you designed in Q1.2 to verify the implementation of your algorithm is correct.

  • Onlysymbolic addressing is to be used; numerical addressing will be 
  • LMCprogram must request the correct number of input(s).
  • LMCprogram must produce the correct number of output(s).
  • LMCprogram must produce the correct output value(s) for all given test 
  • Code must be tidy (spacing, indentation) and comments are to be used to describethe algorithm. Do not describe the function of each LMC 
  • YourLMC file should show the full history of how your solution was 

Note: A mark of zero will be given for those test cases where the HLT command is not executed. This may be due to it being missing or, syntax or run-time errors. Errors will not be fixed by the marker.

 QUESTION 2 (15 MARKS)

Below is a LMC program, however, its intended use has been forgotten. Unfortunately, the developer has not indented or commented their code, so readability is low.

  • UseLMC IDE 5.0.0 (or greater)
  • Enteryour student ID in the LMC IDE when completing this question
  • Failingto include the .lmc file in your submission will result in a grade of zero for 2
  • SufficientLMC file history must be available to demonstrate 

IN STO a IN STO b LDA a ADD b STO c

loop: LDA b SUB c

BRP done LDA c SUB b STO c OUT

LDA t ADD c STO t

BR loop

done: LDA t OUT

HLT

c: DAT 000

a: DAT 000

b: DAT 000

h: DAT 100

t: DAT 000

 Question 2.1 (5 marks)

Describe the function of the code.

 Question 2.2 (10 marks)

Tidy the code to improve its readability. Be mindful to not break it. Implement a test suite.

  • Uploaded By : Katthy Wills
  • Posted on : April 06th, 2023
  • Downloads : 1
  • Views : 169

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more