Q1: Write a program to find the average of 10 bytes started at memory location [100H]. If the average is greater than 07H then store the average at memory location [20OH] otherwise, store it at memory location [300H].
Q: What is the output of the following code: int a = 5, b = 10, c = 15; a = 3 * 7+9; b=b+71 * 7; c = a…
A: Answer: Option d Compilation error Here, &b is used. So There is invalid conversion from int* to…
Q: A string of readings is stored in memory locations starting at XX70 H, and the end of the string is…
A: Required:- Handwritten only with flow chart in assembly language
Q: Task 01 Write a program which takes in two 16 bit numbers and finds the total sum of all the numbers…
A: Summary: In this question, we have been given two numbers of 16 bits and we have to add those…
Q: Task: Given the following statement: short int X, Y, Z;…
A: In given problem, we have to check what will be the output when we exceed the range of a data type.…
Q: printf (the avg of x and y is din", avgl) give sqrt (avgl). return 0 float avg (float m, float n) /…
A: The problem is based on the basics of functions in C programming language.
Q: Write a program that will take n floating point numbers as input and print the sum, average and…
A: Since no programming language is mentioned, I am using c language. Algorithm: Start Read n value…
Q: Question 2 Write a program to perform the operation: Multiply by 2. Assume the input data is stored…
A: Program to perform the operation :multiply by 2 is given below:-
Q: Consider the following program and calculate the software matrix n, N, V, D, E var a, b, c, d, m:…
A: Solution a:= a+a c:= c*d b:= b+b m:= a+b-c Python program to calculate the matrix. We need a…
Q: 7. Write a program to add 32-bit number in memory locations staring at [0000] to 32-bit number in…
A: Add the 32-bit number in memory locations 0000H and 0002H to the 32-bit number in memory locations…
Q: Q3/(A) Write an ALP that subtracts B2E H exists in DX from the word beginning at memory location…
A:
Q: ! 14:4 %VT This code segment read f, k. Using a define sub procedure (SU) to determine the value of…
A: Solution:: f = Val(Text1.Text) k = Val(Text2.Text) 1.Call SU(f,S1) //Call function SU() to find…
Q: Homework Write a program to compare two numbers which stored in memory locations ( 203A H) and (2040…
A: The Answer is in Below Steps
Q: 4. If x is declared as integer variable x= 313. How long would be the length of x in memory? (A) 2…
A: - The question wants to know that if x is a variable declared with x = 313 what will be the size of…
Q: Character Frequency Character Bits Frequency Total Bits F Space 3 4 12 1 A 4. 12 H 1 M 1 3 4. 12 R…
A: // This is C++ program for Huffman Coding #include <iostream>#include <cstdlib>using…
Q: Q4/ write a program to find out the multiplication table for any given number (the range of number:…
A: program: #include<stdio.h>int main(){int i,num;printf("Enter the number to generate the table:…
Q: Q4) B: Write a program to find the largest of 30 (8-bit) numbers stored at memory locations starting…
A: Find the largest of 30 8-bit numbers : Total values 30 , numbers are 8-bit . Their memory locations…
Q: (Use Dev C++) Write a program that prints the numbers 1 to 4 on the same line with each pair of…
A: Output statement in C++ program is 'cout' which is a object of the ostream class which produce the…
Q: Q2) Write a program to compare two numbers stored at AX and BX. If AX is greater than BX store FFH…
A: #include<stdio.h> int main() { char AX[3],BX[3],value; char CX;…
Q: The following segment of program is store - in to number ----- memory locations. MOV AL, OF MOV CX…
A: Stosb move byte from AX to given destination address So it move content from 05h and store to
Q: 6. Answer the following questions a) Write a R program to create a Dataframe using the data given in…
A: Step 1: Create a vector storing the list of states and assign it to name. Step 2: Create a vector…
Q: 3. Indicate the output int i, j, sum; sum = 0; for (i = 1; i < 5; i++) sum += ar1 [i, 4 - i];…
A: Note: “Since you have asked multiple questions, we will solve the first question for you. If you…
Q: Q1/ Write a program to select and move even numbers from a block of numbers consisted of 1 to 100.…
A: The code is in C++: #include <stdio.h>int main(){int i;for(i=1;i<=100;i++) //for loop that…
Q: 1.Run show_bytes for this two values: 90 and -90 print the result (for int float and pointer).
A: In cases with multiple questions, we are needed to answer only the first one.
Q: When adding two packed decimal integers of length n bytes, how many storage bytes mustbe reserved…
A: Packed decimal representation: - It stores the decimal digits in the form of nibble. Two nibbles…
Q: Read the following code carefully to answer what it does: START: CLC MOV CX, 0002 MOV SI, 0300 MOV…
A: ADC is a mnemonic that stands for Add with carry MOV CX , 0002 ;cx=0002 ; counter=2 MOV SI,…
Q: Write a program that total 5 bytes of data. Each byte represents the daily wages of a worker. This…
A: The following things need to be understood: Each byte represents the daily wages of worker. total…
Q: program takes any two numbers does the add, subtraction or multiplication operations. The block…
A: Condition Given:- 2 numbers will be received as inputs and among the many operations 1 operation…
Q: XCHG AH, BL what is the value of AH and BL after execution ? 1A 00 АН AL 00 05 BH BL
A: XCHG is the instruction used to exchange the contents between two registers
Q: Q2 void show_byte(byte_pointer start, int len) int i; for(i=0; i<len;i++) printf(" %.2x",start[i);…
A: Explanation : Little endian saves starting with last byte in the first address, whereas big endian…
Q: Q Write a program to initialize a block of memory starting at BA00OH with English alphabet (A to Z)…
A: Given:
Q: Q1) Write a program to subtract 2 numbers ( 2 bytes each), The 1" one is stored in memory locations…
A: LHLD 2033 XCHG LHLD 2044 DAD D XCHG LHLD 2066 DAD D SHLD 2055 HLT
Q: A. Write a program that scan the byte 05H in a block of memory of size 200 byte starting at 67000H,…
A: Solution:-- 1)As the given question has required for the program and it is needed to provided…
Q: Rewrite the following code to decrease the number of memory accesses. for (int i=0; i<le6; i++) {…
A: - We need to rewrite the code provided to decrease memory accessing snippet. - In the code, we…
Q: write an ALP to calculate the sum of an array of 8 bit hexadecimal numbers?
A: I have provided solution in step2
Q: 1.(a) float y=1.50, *py: px=&x; printf("%d", *px); * O 1 O 1.5 O 2 O None of the above 1.(b) int…
A: The code segment declares a float variable named y with value 1.50 and a pointer variable named py.…
Q: Answer the following questions regarding execution of loops. Assume that the code below is executed…
A: 0x0001 = 1 in decimal 0x1000 = 255 in decimal kk=1 mm=255
Q: Read the following code carefully to answer what it does: START: CLC MOV CX, 0002 MOV SI, 0300 MOV…
A: Code: START: CLC MOV CX 0002 MOV SI, 0300 MOV DI, 0302 LOOP: MOV AL (DI)…
Q: ored in memory locations starting at XX70H, and the
A: Algorithm step 1.Load the BYTE1 in accumulator to register B step 2.Substract the 50H from the…
Q: b- For the four numbers, the first number and the second number are added to the third and fourth…
A: Op-code: One command is called an op-code that can be generated by the CPU. Here the 'MOV' command…
Q: If the input data is as shown, what will be the value of the "I" variable by the following program?…
A: Given code: INTEGER :: i,j,k LOGICAL :: l READ(*,*) i,j READ(*,*) k l=i+j==k…
Q: Trace the following code. Assume that a and b are stored at 20300 and 20308. double a = 1000;…
A: Explanation: The address of a and b are 20300 and 20308 respectively. The value of a and b are 1000…
Q: 6.a) Write a program to load the R5 with 16-bit hex number 79AC. Assume the 16- bit number comes…
A: Note: As per guidelines we are supposed to answer only one question at a time please repost the…
Q: Write a program loads the block of memory locations from OA1000H through OA10FFH with number DDH…
A: Given: write a program loads the blockof memory locations from OA100OH through OA1OFFH with number…
Q: The following binary sequences are stored in two distinct 16-bit memory locations: Q1 A = 10010001…
A: Note: since your question contain multiple parts but we can answer only first 3-sub parts at time…
Q: What is the output of the following code fragment? int main() { int x = 20, *y, *z;…
A: The Output is given below.
Q: Question 2 Write a program to perform the operation: Multiply by 2. Assume the input data is stored…
A: the solution of problem is given below:
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
- 2. Printing binary Write a function void printBin(int value) that will print an integer as a binary number. Hint: You want to print a 1 or a O based on the high order bit, then you need to move the next to high order bit into the high order bit. You will need to explicitly count the number of bits you have printed. Write a main method that calls printBin multiple times with a few different values to test it. You should try at least a positive number, a negative number and O. Your submission should answer the following questions about this program: • There are at least two approaches to testing the high order bit. Describe one that you did NOT use in your code. • How could you suppress leading zeros in you display? If you did this already, you may just answer that you did.Language: JAVA Problem 1: Decimal to Binary Conversion Write a program that takes an integer value as an input and converts that value to its binary representation; for instance, if the user inputs 17, then the output will be 10001. Do not forget to check for valid input, which means if the user inputs a type of data other than an integer re-prompt the user to enter a valid value. The output binary number can be a string. Sample input and output: Enter an integer > a You entered an invalid type. Try again. Enter an integer > 17 100012. Test Scores File: test_scores.py Write pseudocode for the main() part of a program that asks the user to enter 4 test scores between 0 and 100, then displays a JCU grade for each score and also the average test score. When you have written the pseudocode for main, implement your solution in Python code and test it with a range of meaningful data. Remember that we've done the JCU grades question before, so copy your function from that practical code file. Sample Output Score: 3 Score: 50.5 Score: 66 Score: 100 Score 3.0, which is N Score 50.5, which is P Score 66.0, which is C Score 100.0, which is HD The average score was 54.875 Enhancements When you have that working... We asked for 4 scores. Have a look at your code... did you use 4 as a numeric literal or a constant?Change 4 to 3... Did you have to change the program in more than one place?If so, then you've missed one of the things we've taught...As a strong guideline: if you need to use the same literal more than once, you…
- Power (xY): Complete the code below to compute for p = x' (where x and y are byte-size variables). Assume x and y >=1 and the max value of p is 255. Examples: (x=2, y=3, p=8), (x=4, y=2, p=16) mov al, 1 9. power: mul byte[x] 10. 11. cmp cl, 0 jne power exit:6. Find the errors from the following code. a. T=[a,b,c] printlh (T) b. for i in 1 to 100 : print (1) c. i=10 while [ib) print (a): else if (aISP- Java Write a program that will output a right triangle based on user specified input height (int) and specified input symbol (char). The first line will have one user-specified character, such as % or *. Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches specified input height. Output a space after each user-specified character, including after the line's last user-specified character. Hint: Use a nested for loop. Ex: If the input is: Enter a character: * Enter triangle height: 8 the output is: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *Assignment for Computer Architecture: N Factual by Recusion *please have comments in the code* You are to write a program in MIPS that computes N! using recursion. Remember N! is the product of all the numbers from 1 to N inclusive, that is 1 x 2 x 3 x (N – 1) x N. It is defined as 1 for N = 0 and is undefined for values less than 0. The programs first requests the user to input the value of N (display a prompt first so the user knows what to do). If the input value is less than 0, the program is to display “N! undefined for values less than 0” and then requests the user to input the value of N again. If the value input is non-negative, it is to compute N! using a recursive function, that is one that calls itself. You are to have your name, the assignment number, and a brief description of the program in comments at the top of your program. Since this is an assembly language program, I expect to see comments on almost every line of code in the program. Also make the…C Programming: Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain less than 20 words. Each word will always contain less than 10 characters and no spaces. Ex: If the input is: 5 hey hi Mark hi mark Then, the output is: hey 1 hi 2 Mark 1 hi 2 mark 1 Hint: Use two arrays, one array for the strings and one array for the frequencies.Marwa Awaid Masoud Awaid A Use the upload link after Question 26 to upload the anwer. (image, word, pdf, or any practical files) l pdr .s) 26 J l s p Write Input-Process-Output for the given problem: Read the bill amount from customer. If the bill amount is above 60 OMR, the discount will be calculated as 15% of the bill amount, otherwise, the discount is 10% of the bill. Display the final bill amount after discount. Use the upload link after Question 26 to upload the answer. (image, word, pdf, or any practical files) استخدم رابط التحميل بعد السوال 26 لتحميل الإجابة. )صورة، كلمة، pdf، او الملفات العملية( What is network protonoQ2: The sizeof operator can be used to determine the number of bytes in memory by a variable of a certain type. For example, size of (short) is equivalent to 2. Write a program that displays the memory space required by each fundamental type on screen./*code Kth Largest Factor A positive integer d is said to be a factor of another positive integer N if when N is divided by d, the remainder obtained is zero. For example, for number 12, there are 6 factors 1, 2, 3, 4, 6, 12. Every positive integer k has at least two factors, 1 and the number k itself.Given two positive integers N and k, write a program to print the kth largest factor of N. Input Format: The input is a comma-separated list of positive integer pairs (N, k). Output Format: The kth highest factor of N. If N does not have k factors, the output should be 1. Constraints: 1<N<10000000000 1<k<600. You can assume that N will have no prime factors which are larger than 13..Programming language: JAVA Write a piece of code to generate 100 random characters (10 rows of 10 characters) and display them on the screen. -In a loop, generate a random number between 1 to 255 by using Math.random(). Use this number as an ASCII code for a character char c and then print c.SEE MORE QUESTIONS