Question

Sample 1: Logícal Operations. Check the examples done in class during the lecture. How you isolate a specific field How you s
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Isolate a specific field:

Lets say we have a two byte word a=x14B8. By performing an AND operation with x00F0, we get x00B0. In the result, B has been isolated from the initial word.

By Shift operations we can not achieve that , A shift left followed by shift right cannot do that.

Set Fields to 0:

  • Using AND operation on DATA with 0FE3Fh  we can Set destination field to zero.

Masking:

A bit mask is used to mask out unwanted bits in a byte, and just leave the ones you need. For example, suppose you have a byte value, and you want to find the value of the lowest hexadecimal digit. To do this you need to take the value of the lower 4 bits, ignoring the higher 4 bits.

For the AND function, we know that:

  • ANDing anything with 0 is always 0, ie A & 0 = 0.
  • ANDing anything with 1 leaves the value unchanged, ie A & 1 = A.

We can think of bitwise AND as a masking function. Here, we are using input B as a mask:

Bit 7 6 5 4 3 2 1 0 01111100 Byte A 00001111 Mask 00001100 Result

In this case:

  • For the low 4 bits, where the mask bits are 1, the bit values in A are passed through to the result.
  • For the high 4 bits, where the mask bits are 0, the bits in the result are forced to 0

Complement Field:

The bitwise complement is also called as one's complement operator since it always takes only one value or an operand. It is a unary operator.

Bitwise complement operator is denoted by symbol tilde (~).

When we perform complement on any bits, all the 1's become 0's and vice versa.

If we have an integer expression that contains 0000 1111 then after performing bitwise complement operation the value will become 1111 0000.

Add a comment
Know the answer?
Add Answer to:
Sample 1: Logícal Operations. Check the examples done in class during the lecture. How you isolate...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Vibrio bacteria are abundant in ocean and aquatic environments. Suppose you wish to isolate Vibrio-...

    1. Vibrio bacteria are abundant in ocean and aquatic environments. Suppose you wish to isolate Vibrio- specific bacteriophages from seawater. You enrich your sample by spiking the seawater with growth medium and Vibrio fischer. You then isolate your phage and plate it on lawns of bacterial growth to enumerate how many PFUs/mL are in your sample. a. You set up a series of 10-fold phage dilutions out to a TDF of 10', and you plate each of those dilutions mixed...

  • 1-List the three types of Java methods discussed during lecture. Explain how each method type is...

    1-List the three types of Java methods discussed during lecture. Explain how each method type is used. 2- Describe the two contexts of a Java-class as discussed during lecture. 3- What is the purpose of the Java "new" keyword?

  • 1. Employees and overriding a class method The Java program (check below) utilizes a superclass named...

    1. Employees and overriding a class method The Java program (check below) utilizes a superclass named EmployeePerson (check below) and two derived classes, EmployeeManager (check below) and EmployeeStaff (check below), each of which extends the EmployeePerson class. The main program creates objects of type EmployeeManager and EmployeeStaff and prints those objects. Run the program, which prints manager data only using the EmployeePerson class' printInfo method. Modify the EmployeeStaff class to override the EmployeePerson class' printInfo method and print all the...

  • During zoom class lecture fill in the information and answer the questions below: units MUS MUper...

    During zoom class lecture fill in the information and answer the questions below: units MUS MUper $ TU MUD MUper$ TU Price of A=$1; Price of B= $2;budget=$10 1 10 24 8 N 20 3 7 18 4 6 16 5 5 12 6 4 6 How many units of A and B should you buy? What is your maximum TU from your budget of $10? If your budget goes up to $14, how many units of A and B...

  • Create a class named Horse that contains data fields for the name, color, and birth year....

    Create a class named Horse that contains data fields for the name, color, and birth year. Include get and set methods for these fields. Next, create a subclass named RaceHorse, which contains an additional field that holds the number of races in which the horse has competed and additional methods to get and set the new field. Write an application that demonstrates using objects of each class. Save the files as Horse.java, RaceHorse.java, and DemoHorses.java. Program 1 Submission Template Fields:...

  • To be written in JAVA We want you to write a Java class named Character WithStatus...

    To be written in JAVA We want you to write a Java class named Character WithStatus that can be used to keep track of random game effects status on a role playing game character. The following requirements specify what fields you are expected to implement in your class: - A String data field named name to store the character's name - An int data field named health to store the character's health point; at zero they are dead. - An...

  • Application Problem: Answer the following questions at the bottom of the worksheet: You are configuring a...

    Application Problem: Answer the following questions at the bottom of the worksheet: You are configuring a microcontroller (uC) to sample a signal connected to an input pin. Part of the initial setup requires that you clear (turn off) bits #17 and #2 in a 32-bit register, while leaving all other bits unchanged. To work with specific bits, we typically use a second number, called a mask, which has the bit positions we need to alter set to 1, and all...

  • Add the following methods to the ArrayList class that we wrote during lecture. You may call...

    Add the following methods to the ArrayList class that we wrote during lecture. You may call the existing methods in ArrayList if you want, but do not use anything from the built-in java.util.ArrayList class. 1. (3 pts) Write a new method named addAll(ArrayList anotherList) that adds all the elements in anotherList to the back of the calling list. Be sure to reallocate the data array if necessary. anotherList should not be modified. 2. (4 pts) Write a new method named...

  • During its first year of operations, World Class Sport Shoes earned net credit sales of $322,000....

    During its first year of operations, World Class Sport Shoes earned net credit sales of $322,000. Industry experience suggests that bad debts will amount to 1% of net credit sales. At December 31, 2018, accounts receivable total $36,000. The company uses the allowance method to account for uncollectibles. Read the requirements. Requirement 1. Journalize World Class' Bad Debts Expense using the percent-of-sales method. (Record debits first, then credits. Select the explanation on the last line of the journal entry table.)...

  • NEED ASAP!! HELP PLEASE!!! mental approach (total 25 p) u have a mix protein sample. You...

    NEED ASAP!! HELP PLEASE!!! mental approach (total 25 p) u have a mix protein sample. You need to isolate and purify an specific protein of your interest. What you have available is only a small pure sample of the protein of interest, and animal facility. Design an experimental project to be able to use a column chromatography to purify the protein. Hint, The general technical steps of Colum chromatograph are similar to what you have done in class> List the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT