Question: please follow the submission and provide the binary or hex portion for the text file and 3 screenshots for each X and Y . Programming
please follow the submission and provide the binary or hex portion for the text file and screenshots for each X and Y
Programming Assignment
Objective:
The objective of this lab assignment is to demonstrate your ability in
Moving data from memory locations to a register and vice versa;
Negating a positive integer;
Adding two numbers with both numbers stored in registers or one stored in a register
and one being a literal;
Performing logical ADD, NOT, and OR operations;
Checking the parity of a number.
Lab Statement:
Two numbers, and are stored in memory locations and respectively. Write
an LC machine language program that does the following:
Compute the sum of and and place it at location
Compute and store the result at location
Compute X AND Y and store the result at location x
Compute NOTX and store the result at location x
Compute OR and store the result at location
Compute and store the result at location
Computer and store the result at location
If is even, place at location ; otherwise, meaning if is odd, place at
LC Syntax:
Move data tofrom memory locations.
LC has three set of instructions to move data tofrom memory locations: LDST
LDRSTR and LDISTI They differ in how they calculate the address of the memory
location. LDST use a PCoffset meaning the address is calculated by adding the
incremented PC to a bit offset supplied by the user in the instruction. Since the offset
is limited to a bit s complement integer, the range of the offset is to in
decimal, or xFFxOFF. You can use LDST if the target location is within this range. In
this lab assignment, if the program begins at the target locations,
are within the offset range. We can use LDST to move the data around.
For example, if the first statement, which is stored in is to move stored in
to RO the instruction will be formed as followed:
Opcode:
Operand : DR
Operand : The PC will be incremented to when this instruction is being
executed and the location for is Therefore the offset is x
So the bit offset is or
Instruction: xF
Subtraction
LC does not have an instruction for subtraction. However, We need to
form through s complement by finding NOT Y first then add one to the result
OR operation
LC does not have an OR instruction. However, de Morgan rule says,
OR Therefore A or B can be evaluated as NOTNOT A AND NOT B
Checking parity
In binary format, the parity can be decided by the least significant bit, or bit An
integer is even if bit is and is odd if bit if One way to determine the parity is to
AND the number with which is a bit mask for this purpose
Testing:
Use the following pairs of X Y for testing:
Submission:
Your machine code, either in binary or hex, in a text file.
For each pair of the screen shot of contents of locations x through x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
