Question

Microprocessor: HCS12 - What is the difference between LSLA and ASLA? Explain with example. - Write...

Microprocessor: HCS12

- What is the difference between LSLA and ASLA? Explain with example.

- Write a program which prompts user to enter a character, if the user presses "Z‟, the program asks user to enter a number. In this case the program implements 5-input majority voting logic which is explained as follows.The value of the number represented by the five leftmost bits of Register-B is tested. If the number of logic '1' bits (in the 5 leftmost bits) is greater than the number of logic '0' bits, the program should output: “The number of 1’s in the 5 left most bits is greater than the number of 0’s”. If the number of logic '0' bits (in the 5 leftmost bits) is greater than the number of logic '1' bits, the program should output: “The number of 0’s in the 5 left most bits is greater than the number of 1’s”.

Homework Answers

Answer #1

Answer 1:

* LSL Stands for Logical Shift Left and LSLA stands for Logical Shift Left Accumulator.

LSLA instruction shifts the accumulator A left by one bit.

* ASL stands for Arithmetic Shift Left and ASLA stands for Arithmetic Shift Left Accumulator.

ASLA instruction shifts the accumulator A left by one place. Note that Left Shifts is an efficient way to multiply by powers of two.

For example, %0000 0010 = 2. After one arithmetic shift left: %0000 0100 = 4

The instructions "LSL" and "ASL" are identical in operation and use the same Opcode. The instruction "ASL" shifts all the bits in the accumulator one place to the left.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Question: Squares. Write a program class named SquareDisplay that asks the user for a positive integer...
Question: Squares. Write a program class named SquareDisplay that asks the user for a positive integer no greater than 15. The program should then display a square on the screen using the character ‘X’. The number entered by the user will be the length of each side of the square. For example, if the user enters 5, the program should display the following:       XXXXX       XXXXX       XXXXX       XXXXX       XXXXX INPUT and PROMPTS. The program prompts for an integer as follows: "Enter...
Write a program that prompts the user to enter an integer number between 1 and 999....
Write a program that prompts the user to enter an integer number between 1 and 999. The program displays the sum of all digits in the integer if the input is valid; otherwise, it displays a message indicating that the integer is not between 1 and 999 and hence, is invalid. Name the program file Q1.cpp Example: if the user enters 12, sum of digits is 3. If the user enters 122, sum of digits is 5.
Use C++ Write a program that first reads in how many whole numbers the user wants...
Use C++ Write a program that first reads in how many whole numbers the user wants to sum, then reads in that many whole numbers, and finally outputs the sum of all the numbers greater than zero, the sum of all the numbers less than zero (which will be a negative number or zero), and the sum of all the numbers, whether positive, negative, or zero. The user enters the numbers just once each and the user can enter them...
Write a C program that prompts the user to input as many unsigned(n) as the user...
Write a C program that prompts the user to input as many unsigned(n) as the user wants to type, terminated by non negative number You may assume without checking that when the user is supposed to type an unsigned, he nevertypes a double You may assume without checking that when the user is supposed to type an unsigned, he nevertypes a negative number. For each number the user types, output whether that number is prime or not. You won't need...
This program will store roster and rating information for a soccer team. Coaches rate players during...
This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int vector and the ratings in another int vector. Output these vectors (i.e., output the roster). (3 pts) Ex: Enter player 1's jersey number: 84 Enter player 1's...
5.27 LAB*: Program: Soccer team roster (Vectors) This program will store roster and rating information for...
5.27 LAB*: Program: Soccer team roster (Vectors) This program will store roster and rating information for a soccer team. Coaches rate players during tryouts to ensure a balanced team. (1) Prompt the user to input five pairs of numbers: A player's jersey number (0 - 99) and the player's rating (1 - 9). Store the jersey numbers in one int vector and the ratings in another int vector. Output these vectors (i.e., output the roster). (3 pts) Ex: Enter player...
Write a program that prompts the user for the number of values for which it will...
Write a program that prompts the user for the number of values for which it will calculate the base 2 log of each value. Use a for loop to iterate the set of values and print the log for each. Here is the formula to change the base of a log: loga b = log10 b / log10 a Sample output appears below. This program will calculate the Base 2 log of a set of numbers<LINERETURN> ===============================================================<LINERETURN> Enter the upper...
Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is...
Write a VSC (macro) program that computes and displays a Fibonacci sequence. A Fbonacci sequence is generated by adding the two most recent sequence numbers together, i.e., 1, 1, 1+1-2, 1+2=3, 2+3=5, 3+5=8, … The user will enter the number of terms in the sequence to be displayed. Assemble this program using the VSC assembler (ASM), and simulate this program using the VSC simulator (SIM). Include a copy of the source listing (SOURCE.DAT), the assembled listing (SLIST.DAT) and the simulation...
(Use Java ) please write comment on every line I need to understand the code Problem...
(Use Java ) please write comment on every line I need to understand the code Problem Description: Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle, as shown in the Figure. (Hint: A point is in the rectangle if its horizontal distance...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF...
WRITE C++ PROGRAM FOR 1,2,3,4 PARTS of question, DO ADD COOMENTS AND DISPLAY THE OUTPUT OF A RUNNING COMPILER QUESTION: 1) Fibonacci sequence is a sequence in which every number after the first two is the sum of the two preceding ones. Write a C++ program that takes a number n from user and populate an array with first n Fibonacci numbers. For example: For n=10 Fibonacci Numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 2): Write...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT
Active Questions
  • What is the most important factor to consider when developing the promotional mix for a product?...
    asked 6 minutes ago
  • Assume the random variable X has a binomial distribution with the given probability of obtaining a...
    asked 7 minutes ago
  • I have a few questions that I'm not sure how to go about doing? This is...
    asked 7 minutes ago
  • The Bernoulli effect can have important consequences for the design of buildings. For example, wind can...
    asked 8 minutes ago
  • (i) Define the 3 Bolting Categories (ii) Discuss the methods of Achieving snug tight and fully...
    asked 13 minutes ago
  • HYPOTHESIS TEST: Difference in Cardiopulmonary exercise testing time Pre- and Post- PCI procedure (in seconds): PCI:...
    asked 13 minutes ago
  • A consumer advocacy group is doing a large study on car rental practices. Among other things,...
    asked 15 minutes ago
  • A productivity index of 110% means that a company’s labor costs would have been 10% higher...
    asked 25 minutes ago
  • explain the difference between intentional interference with contractual relationship and interference with prospective advantage ?? Give...
    asked 33 minutes ago
  • How does James Madison advocate for protections and safeguards for the rights and liberties of the...
    asked 35 minutes ago
  • The concentration of a drug in body fluids depends on the time (t) elapsed after its...
    asked 46 minutes ago
  • Between: Galton and General Intelligence, Thurstone’s The Theory of Multiple Factors, Guilford’s ‘Structure of Intellect’, Cattell’s...
    asked 49 minutes ago