Unit 6.1.1: Primitive Data Types, Binary, Hex and Decimal Conversions, ASCII and Unicode, Floating-point Arithmetic and Normalisation, and Bitwise Operations and Masks Flashcards

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

Name the primitive data types that are found in most programming paradigms.

A
. Integer
. Floating-point
. Real
. String
. Array
. Character
. Boolean
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Convert the following binary values to their equivalent decimal values:

i) 01000100
ii) 10110011
iii) 00101111

A

i) 68
ii) 179
iii) 47

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

Convert the following binary values to their equivalent hexadecimal values:

i) 10000101
ii) 01001010
iii) 11000111

A

i) 85
ii) 4A
iii) C7

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

i) Add the following decimal values in their respective binary format in 8-bits:

153 + 105

ii) Describe the phenomenon when the result of part (i) produces a 9-bit binary value.

A

i) 00000010

ii) A binary stack overflow error occurs here, as the carry bit following the 8th bit accumulates to the 9th bit.

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

Convert the following decimal values to their equivalent hexadecimal values:

i) 124
ii) 76
iii) 203

A

i) 7C
ii) 4C
iii) CB

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

Subtract the following decimal values in their respective binary format in 8-bits:

98 - 22

A

22 (base 10) = 00010110 –> Two’s complement = 11101010

98 (base 10) = 01100010

11101010
01100010 +

= 1 | 01001100

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