Section 6 - Data types Flashcards

Conversions between denary, binary, and hexadecimal

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

Primitive Data Types, Binary and Hexadecimal

How do you convert from binary to hexadecimal?

A

To convert a binary number to hexadecimal, split the binary number into groups of 4 binary digits

Binary | 0011 | 1010 |1111 |1010
Hex | 3 | A | F | 9

0011 1010 1111 1010 = 3AF9

The opposite may also be done to translate from hexadecimal to binary

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

Primitive Data Types, Binary and Hexadecimal

How do you convert from denary to hexadecimal?

A

To convert a denary number to hexadecimal, the easiest way is to first convert the denary number to binary and then translate from binary to hexadecimal

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

Binary Arithmetic

1100 + 1110 = ?

A

1010 carry 1

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

Binary Arithmetic

What is the difference between sign and magnitude and two’s compliment?

A

Sign and magnitude:
* 00000011 = 3
* 10000011 = -3

Two’s compliment:
* 00000011 = 3
* 11111101 = -3

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

Binary Arithmetic

How do you convert a negative denary number to binary?

A

Convert the positive version of the number to binary, then flip each bit and add 1

-9 -> binary
Positive binary (9) : 0000 1001
Flip the bits : 1111 0110
Add one : +0000 0001
-9 = 1111 0111

flip the bits and add 1

Same can be done to convert binary -> denary: flip the bits and add 1

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

Binary Arithmetic

0000 1110 - 0000 1110 = ?

17 - 14

A

Do 17 + -14!
0000 0011 carry 1

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

WRITE ABOUT: mantissa AND exponent

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