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
Name the primitive data types that are found in most programming paradigms.
. Integer . Floating-point . Real . String . Array . Character . Boolean
Convert the following binary values to their equivalent decimal values:
i) 01000100
ii) 10110011
iii) 00101111
i) 68
ii) 179
iii) 47
Convert the following binary values to their equivalent hexadecimal values:
i) 10000101
ii) 01001010
iii) 11000111
i) 85
ii) 4A
iii) C7
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.
i) 00000010
ii) A binary stack overflow error occurs here, as the carry bit following the 8th bit accumulates to the 9th bit.
Convert the following decimal values to their equivalent hexadecimal values:
i) 124
ii) 76
iii) 203
i) 7C
ii) 4C
iii) CB
Subtract the following decimal values in their respective binary format in 8-bits:
98 - 22
22 (base 10) = 00010110 –> Two’s complement = 11101010
98 (base 10) = 01100010
11101010
01100010 +
= 1 | 01001100