1.1.4 Data Types Flashcards

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

What is the result of performing a left and right shift on a byte?

A

Left shift- multiplies by 2
Right shift- divides by 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do we multiply 2 numbers using arithmetic shifts?

A

Split the multiplier into factors of 2:
12 x 6 => (12 x 4) + (12 x 2)

Shift each binary value accordingly:
12 x 4 = 0011 0000
12 x 2 = 0001 1000

Add the values together:
0011 0000 + 0001 1000 = 0100 1000 = 72

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do we convert a negative denary number into binary (two’s compliment)?

A

Work our positive equivalent of number:
9 => 0000 1001

Flip all the bits:
1111 0110

Add 1 to the result:
1111 0111

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do we convert a floating point binary number into a denary number?

A

Write out our 12-bit (1 bit for the sign, 7 for the mantissa, 4 for the exponent) number:
0 101101 0011

Translate the exponent into denary:
0011 = 3 => 2^3

Write out our binary number with the exponent:
0.101101 x 2^3

Move the decimal point the number of times as the exponent (right if exponent in +ve, left if -ve) :
2^3 is our exponent so we move the decimal point 3 times to the right:
0101.101

Translate the binary into denary:
4 + 1 + 0.5 + 0.125 = 5.625

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

A +ve number in the normalised form follows what rule?

A

The mantissa of a positive number in normalised from always lies between 1 and 0.5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A -ve number in the normalised form follows what rule?

A

The mantissa of a positive number in normalised from always lies between -0.5 and -1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly