Data Representation Flashcards
How many inputs and outputs do NOT gates have?
1) one input
2) one output
Put these units in order of size (smallest to largest):
Terabyte, Byte, Kilobyte, Gigabyte, Megabyte
Byte, Kilobyte, Megabyte, Gigabyte, Terabyte
Convert 17 (decimal) to binary.
10001
Convert 17 (decimal) to hexadecimal.
11
Convert 0011 1000 (binary) to decimal.
56
What effect do left and right shifts have on binary numbers?
1) left shifts multiply a binary number. For every place shifted left, the number is doubled
2) right shifts divide a binary number. For every place shifted right, the number is halved
Convert 1001 1111 (binary) to decimal.
159
Convert 1001 1111 (binary) to hexadecimal.
9F
Convert 10 1011 (binary) to decimal.
43
Convert 10 1011 (binary) to hexadecimal.
2B
Convert 4A (hexadecimal) to decimal.
74
Convert 4A (hexadecimal) to binary.
1001010
Convert 75 (hexadecimal) to decimal.
117
Convert 75 (hexadecimal) to binary
1110101
Convert 148 (decimal) to binary.
10010100
Convert 148 (decimal) to hexadecimal.
94
Convert 240 (decimal) to binary.
11110000
Convert 240 (decimal) to hexadecimal.
F0
Convert BD9 (hexadecimal) to decimal.
3033
Convert BD9 (hexadecimal) to binary.
101111011001
Encode this string using run-length encoding:
PPPPQQRRRSSSSSSPPPPPQQQ
(4,P), (2,Q), (3.R), (6,S), (5, P), (3, Q)
Calculate the number of bits needed to store this string if it was encoded with ASCII:
PPPPQQRRRSSSSSSPPPPPQQQ
23 X 8 = 184 bits
Calculate the number of bits needed to store this string if it was encoded with huffman coding:
PPPPQQRRRSSSSSSPPPPPQQQ
9 + 15 +9 +12 = 45 bits
Calculate the number of bits needed to store this string if it was encoded with run-length encoding (if each data pair used 2 bytes):
PPPPQQRRRSSSSSSPPPPPQQQ
8 x 2 x 6 = 96 bits