Calculate the number of cars you have

Assignment Help Computer Engineering
Reference no: EM133694400

Question: The CPU control unit determines the address in the memory to drive the value. Therefore, both variables num1 and num2 are stored in the Memory. To calculate the sum of num1 and num2 (line 3 in the program) would require four instructions:

Read num1 from Memory and put it in the register Input-1
Read num2 from Memory and put it in the register Input-2
Use the ALU to add the two values in Input-1 and Input-2 and write the sum to the register Output
Write the data from the register Output to the variable sum in Memory
We can express these operations using the following syntax:

READ [Source] [Destination]: Read the data from the source to the destination
WRITE [Source] [Destination]: Write the data from the source to the destination
ADD [Operand 1] [Operand 2]: Add the values in two operands and put the sum in the register Output
SUB [Operand 1] [Operand 2]: Subtract the value of Operand 2 from the value of Operand 1 and put the difference in the register Output
MUL [Operand 1] [Operand 2]: Multiply the values in two operands and put the product in the register Output
Using the notation above, sum the two numbers in num1 and num2 and put the total in the variable sum can be written as:

READ num1 Input-1
READ num2 Input-2
ADD Input-1 Input-2
Write Output sum
This notation is a type of programming language known as assembly language, in which the programmer specifies the sequence of instructions using only the fundamental operations of the computer. This is how early programmers had to write their programs.

Problem 1 (0.5 point)

Suppose you have a program that calculates the inventory for a dealership. The current number of cars you have by yesterday is stored in variable X, the number of cars you sold is stored in variable Y, and the number of new cars you get today is stored in variable Z. To calculate the number of cars you have by the end of today, you can subtract Y from X, then add Z, and store the result in variable R. Please Fill in the blanks with the necessary instructions for this calculation.

Reference no: EM133694400

Questions Cloud

Define application attacks, explain how threat actors : Define application attacks, Explain how threat actors use application attacks. Identify the different types of attacks
Find the ids of all students who were taught : Find the IDs of all students who were taught by an instructor named Einstein; make sure there are no duplicates in the result.
Write a java main method that does : Write a Java main method that does the following: 1) Ask the user for the name of a folder to be searched. 2) Validate the input. If the folder name
Explain the role of system and network architecture : Explain the role of system and network architecture in cybersecurity and their impact on an organization's security strategy. Discuss the process and importance
Calculate the number of cars you have : Calculate the number of cars you have by the end of today, you can subtract Y from X, then add Z, and store the result in variable R
Key truths god intends to communicate from these passages : What are the key truths God intends to communicate from these passages? Ask God to help you understand what this passage means to you.
Discuss the consequences of the breach : Analysis of Each Case Study: For each case study, students will: Describe the Incident: Provide a summary of what happened, including the type of application
Write an algorithm using pseudocode to convert the input : Write an algorithm using pseudocode to convert the input items into output items.4. Test the program by using 40 for hours_worked and $20 for the hourly_rate
What you would have done to mitigate or prevent the attack : Why are politicians, VIPs, and/or executives targeted. Research and write about three (3) attacks, and what you would have done to mitigate or prevent

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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