MGMT 1030 Lecture Notes - Lecture 7: Opcode

11 views2 pages
MGMT 1030 Tutorial 7 Notes Negative Values
Introduction
The Little Man walks over to the calculator and reads the number there.
He writes that number on a slip of paper and puts it in the mailbox whose address was
specified as the address part of the instruction.
The number in the calculator is unchanged
The original number in the mailbox is replaced with the new value.
ADD instructionop code 1
This instruction is very similar to the LOAD instruction.
The Little Man walks over to the mailbox address specified in the instruction.
He reads the three-digit number located in the mailbox
Then walks over to the calculator and adds it to the number already in the calculator.
The number in the mailbox is unchanged.
SUBTRACT instructionop code 2
This instruction is the same as the ADD instruction
Except that the Little Man subtracts the mailbox value from the value in the calculator.
The result of a subtraction can leave a negative value in the calculator.
The use of complements to implement negative values, but for simplicity, the LMC
model ignores this solution.
For the purposes of our LMC model, we will simply assume that the calculator holds
Handles negative values correctly, and provides a minus sign as a flag to indicate that
the value is negative.
The Little Man cannot handle negative numbers outside of the calculator
However, because there is no provision in the model for storing the negative sign within
the constraint of the three-digit number system used.
INPUT instruction (or read, if you prefer)—op code 9, address 
The Little Man walks over to the in basket and picks up the slip of paper in the basket.
He then walks over to the calculator and punches it into the calculator.
find more resources at oneclass.com
find more resources at oneclass.com
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents