
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
For example, instruction like this.
0011 0000 0000 0000 ; start at x3000
0001 001 001 1 00000 ;x3000 set N CC if R1 < 0
0000 100 0 0000 0001 ;x3001 if N goto x3003 R2+=5
0000 111 0 0000 0001 ;x3002 Not N goto x3004
0001 010 010 1 00101 ;x3003 R2 += 5
;x3004 done
![Problem #1: VWrite an LC-3 ML program to perform the following operations in sequence. Assume that memory address
x3010 contains some non-zero integer value.
1. Add +10 to the contents of address x3010 it is odd, and subtract 10 if it is even.
2. If the result is negative, store a -1 in address x3011.
Load your program starting at address x3000.
Problem #2: Write an LC-3 ML program to perform the following logic:
if (M[x3200] > M[x3201]{
Мx3202] - M/x3200] - М/x3201]
%3D
M[x3201] = M[x3202] * 2
}
else {
М/x3202] - МIx3201] - М/x3200]
M[x3201] = M[x3202] + 10
}
Load your program starting at address x3100.
You will need to demonstrate the correct execution of your instructions by using the LC-3 Simulator. Make sure you
upload your program into Canvas by the deadline.](https://content.bartleby.com/qna-images/question/c83e4aba-58d3-48b9-b363-094fccb906d2/960d6f49-a89c-4691-a32f-b17e8c4e105a/2dm8oh_thumbnail.png)
Transcribed Image Text:Problem #1: VWrite an LC-3 ML program to perform the following operations in sequence. Assume that memory address
x3010 contains some non-zero integer value.
1. Add +10 to the contents of address x3010 it is odd, and subtract 10 if it is even.
2. If the result is negative, store a -1 in address x3011.
Load your program starting at address x3000.
Problem #2: Write an LC-3 ML program to perform the following logic:
if (M[x3200] > M[x3201]{
Мx3202] - M/x3200] - М/x3201]
%3D
M[x3201] = M[x3202] * 2
}
else {
М/x3202] - МIx3201] - М/x3200]
M[x3201] = M[x3202] + 10
}
Load your program starting at address x3100.
You will need to demonstrate the correct execution of your instructions by using the LC-3 Simulator. Make sure you
upload your program into Canvas by the deadline.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 2 images

Knowledge Booster
Similar questions
- the class im taking is assembly programming please help!arrow_forwardHere is an LC-3 assembly language program: .ORIG X3005 A LD R7, D B LD R7, C LD R7, A D LD R7, B HALT .END The following bit pattern is loaded into R7 by one of these instructions: 0010111111111101 What is the label (argument column) of the instruction which loads this value into R7 ?arrow_forwardGiven three floating-point numbers x, y, and z, output x to the power of z, x to the power of (y to the power of z), the absolute value of y, and the square root of (xy to the power of z). Ex: If the input is: 5.0 6.5 3.2 the output is: 172.466 1.29951e+279 6.5 262.43 main.cpp #include <iostream>#include <cmath>using namespace std; int main() {double x;double y;double z; /* Type your code here. Note: Include the math library above first. */ return 0;}arrow_forward
- Task #2 - Write a MIPS program where you prompt the user for an integer a. Then, set bit 9 and 20. Finally, display the value of that integer after modification. Sample Run of the task Sample Run of the task Enter a: 96 Result = 1049184 Enter a: 4112 Result = 1053200arrow_forwardThis is Computer Architecture! Instructions: Create a MIPS program that demonstrates that the associative law fails in addition for floating point numbers (single or double precision). You only need to demonstrate it for single precision. Remember the associative law is a + (b + c) = (a + b) + c. The program’s output should look something like the following where the xxx’s are the numbers you chose. The resulting numbers may be different than mine depending on your choice of a, b, and c. Using a = xxx, b = xxx, and c = xxx a + (b + c) = 0 (a + b) + c = 1 The key is to have two of the number large (one positively and one negatively but equal in magnitude) floating point numbers and the third floating point number very small in comparison. Please don't forget to include comments in this codearrow_forwardUSING EMULATOR 8086 GIVE ME THE WORKING CODE KINDLY SCREENSHOT THE OUTPUTarrow_forward
- This is Computer Machine Architecture! this is Hamming code in MIPS assembly language 1. when I input a 154 (the example in the book). It should have given an output of 0x72A. the assignment: This assignment is to create a MIPS programs that the determines what the ECC code should given number (an 8-bit byte). The codes you create are to work for 8-bit positive numbers as these are simpler to work with than larger numbers. The program is to request the user to enter a byte of data (a positive integer in the range of 0 to 255 in decimal) and then create the 12-bit Hamming code as described in your text (see above). The program is to then output this (with an appropriate label) in hex. Make sure that you have lots of comments in your code as this is in MIPS. Also make the code neat: line up the instruction columns, the register columns, and the comment fields like the format belowarrow_forwardWrite a Little Man Computer program that accepts five random numbers from the user and displays them in ascending order. Attached is the Little Man Mnemonic Instruction Codes:arrow_forwardReview the following snippet from an assembly code listing file (source assembly statements and listing file line numbers are removed purposely) and answer the questions. 00000000 B8 00000000 00000005 03 05 0000000A R 0000000B 66| 2B 15 00000008 R 00000012 41 00000013 69 15 0000000A R FFFFFED9 0000001D 8A C3 0000001F FF OD 0000000A R 00000025 661 B9 0019 1) Locate the instruction that has the smallest size object code (i.e. minimum byte-length), what is the corresponding address of the instruction? type your answer... 2) Locate the instruction that has the largest size object code (i.e. maximum byte-length). What is the byte-length of the instruction? type your answer... 3) How many of the above instructions have direct memory reference? choose your answer... 4) What is the total length (number of bytes) of the above object code snippet? type your answer... 5) How many instructions contain an opcode prefix? choose your answer...arrow_forward
- The binary value of AL after the following instructions have executed is 11111101. mov al,11000101b sar al,4 True Falsearrow_forwardWrite a MIPS assembly program to find the maximum number among three integers. Ask the user to enter the numbers, save the numbers, and perform the operations. Output the max and min numbers. Your solution should work for all input orders (3, 12, 9) or (3, 9, 12), or (12, 3, 9), etc. Example Enter the first number: 3 Enter the second number: 12 Enter the third number: 9 Output (should be exact) The maximum number is 12 and the minimum number is 3.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY