1.4.3 (Bitwise manipulation) Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is bitwise manipulation?

A
  • Moving binary numbers left or right to multiply or divide
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a bitwise shift?

A
  • Multiplies or divides a binary number by moving digits right or left
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a logical shift?

A
  • Moves all bits to the right or left
  • Fills the gaps with 0s
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is an arithmetic shift?

A
  • Shifts bits while maintaining the sign bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the rules for an arithmetic shift?

A
  • If dividing: if the MSB is 1, feed 1’s into the gap after the MSB. if the MSB is 0, feed 0’s into the gap
  • If multiplying: feed in 0’s
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a circular shift?

A
  • A shift that moves a bit into the carry bit at one end and takes a bit out at the other end
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the rules for a circular shift?

A
  • If dividing: the LSB goes into the MSB
  • If multiplying: the MSB goes into the LSB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does an AND mask do to the bits?

A
  • 0’s set to 0
  • 1’s keep the original bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does an OR mask do to the bits?

A
  • 1’s set to 1
  • 0’s keep the original bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does a XOR mask do to the bits?

A
  • 0’s keep the original bit
  • 1’s NOT the original bit (Flip the bit)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly