Write lmc program that can convert an n-bit binary number

Assignment Help Other Subject
Reference no: EM133507506

Computer Systems Fundamentals

TASK 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 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 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: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:

Describe your approach to solving the problem.

• Use natural language, structured like a conventional programming language to communicate your design.
• When necessary, use looping and conditional constructs.
• Name symbols sensibly to make their use clear.

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 2:

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

• Tabularise test input value(s) and the expected output(s)
• Consider uncommon cases. For example, when the calculator reaches its maximum 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.

Question 3:

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

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

• Only symbolic addressing is to be used; numerical addressing will be disabled.
• LMC program must request the correct number of input(s).
• LMC program must produce the correct number of output(s).
• LMC program must produce the correct output value(s) for all given test cases.
• Code must be tidy (spacing, indentation) and comments are to be used to describe the algorithm. Do not describe the function of each LMC instruction.
• Your LMC file should show the full history of how your solution was implemented.
• Use LMC IDE v1.5.0.0 (or greater)
• Enter your student ID in the LMC IDE when completing this question
• Errors will not be fixed by the marker.

Reference no: EM133507506

Questions Cloud

Discuss the impact of learning on human behavior : Given the impact of learning on human behavior, what is the first step that a person could take to unlearn discriminatory behavior and adopt a more accepting.
Share opinions with four sentences on each reading and video : Share opinions with at least four sentences on each reading and video. Share at least one critical-thinking question you had from each reading and video.
How would a psychoanalyst and humanist might view this case : How would a psychoanalyst and humanist might view this case making reference to the psychology 2e opentax book , state the pages used.
Part of managed care system : You are the director of a home health agency that has recently become part of a managed care system.
Write lmc program that can convert an n-bit binary number : IFN551 Computer Systems Fundamentals, Queensland University of Technology - Implement an LMC program according to the algorithm
How could have facebooks libra used systems thinking : How could have Facebooks Libra used systems thinking to save their business? Hoe could it identify capability dangers and stakeholders.
Jack understands lucinda explanation : Considering the need for informed consent, why is it important that Jack understands Lucinda's explanation?
Discuss how your focus on job satisfaction or organizational : Clearly specify your answer and describe your choice from your perspective. Explain why you made that choice (rationale).
Write paper describing your response based on theory select : Crisis Management has become a norm or an expectation within organizations. Write a 2 to 3 pages paper describing your response based on the theory selected.

Reviews

Write a Review

Other Subject Questions & Answers

  Development of social and political attitudes on terrorism

Discuss the role of religion in the development of social and political attitudes on terrorism.

  How your worldview will impact your decision-making

Discuss how your worldview will impact your decision-making about one of the following: Taking a daily medication to manage a health condition you wish you.

  How are they best used in a leadership role

In your opinion, what are the three most important power sources for a nurse leader? Why? How are they best used in a leadership role? Describe.

  Describe the path to economic growth

As World War II ended, the people of African and Asian nations found themselves struggling to find social justice and economic growth as they began their quest for independence.

  Discuss the applicability of developmental theories

Discuss the applicability of developmental theories in shaping the attitudes, characteristics, behavior and habits of children and adolescents of all genders.

  What are the ethical issues involved in a duty to protect

Suppose a defendant you are evaluating tells you about a plan to kill someone. Explain your ethical obligations in this scenario, if any.

  Celebrate different cultures in the classroom

List 5 different ways teachers can recognize and celebrate different cultures in the classroom. Students are encouraged to be part of the process.

  Post a brief explanation of the behavioral perspective

Post a brief explanation of the behavioral perspective reflected in the article you selected. Then explain the strengths and limitations of this perspective.

  Laocoon group and marcus agrippa

What is the comparison and contrast between The Laocoon Group and Marcus Agrippa and the Imperial Family?

  Practice presenting your speech

Plan your speech, considering what your introduction, main points, and conclusion will include Practice presenting your speech. Aim for a speech that is 3 to 5

  Deficiencies in occupational noise control

A recent OSHA inspection in your machine shop identified several serious deficiencies in occupational noise control.

  Issues of timely information with business discussed in cast

Consider the issues of timely information with respect to the business discussed in the cast. Which of the business must have the most up-to-date information in its data warehouse?

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