4.1 (DATA TYP) Flashcards

1
Q

What are 2 ways we can represent negative numbers in binary?

A

Sign and magnitude
Twos compliment

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

How does sign and magnitude work?

A

The first bit is used as a sign
if it is a 0 the number is positive, if it is 1 it is negative
Halves the maximum value

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

How does twos complement work?

A

Invert the binary bits
Add one
e.g.
12 => 01100
01100 => 10011
+1
10100
The most significant bit now represents the negative starting point (-16) then the rest represent how many more it is than that (+4) giving the number (-16+4=-12)

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

How to normalise a floating point number

A

remove leading 1s (negatives) or 0s(positives)
000011001.01
01100101 5steps therefore 0101

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