You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: number-systems/README.md
+4-19Lines changed: 4 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,75 +6,60 @@ The goal of these exercises is for you to gain an intuition for binary numbers.
6
6
7
7
Convert the decimal number 14 to binary.
8
8
Answer:
9
-
1110
10
9
11
10
Convert the binary number 101101 to decimal:
12
11
Answer:
13
-
45
14
12
15
13
Which is larger: 1000 or 0111?
16
14
Answer:
17
-
1000 > 0111 as 1000 represents 8 and 0111 is 7.
18
15
19
16
Which is larger: 00100 or 01011?
20
17
Answer:
21
-
01011 > 00100
22
18
23
19
What is 10101 + 01010?
24
20
Answer:
25
-
11111
26
21
27
22
What is 10001 + 10001?
28
23
Answer:
29
-
1 00010 (carrying out 1)
30
24
31
25
What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
32
26
Answer:
33
-
1111 in Binary and 15 in Decimal
34
27
35
28
How many bits would you need in order to store the numbers between 0 and 255 inclusive?
36
29
Answer:
37
-
8 bits
30
+
31
+
How many bits would you need in order to store the numbers between 0 and 3 inclusive?
32
+
Answer:
38
33
39
34
How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
40
35
Answer:
41
-
2 bits
42
36
43
37
How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
44
38
Answer:
45
-
Every binary number is made from sums of powers of 2, but a number is a power of 2 itself if its binary representation has exactly one "1" and all the other bits are 0.
46
39
47
40
Convert the decimal number 14 to hex.
48
-
Answer: 0xE
41
+
Answer:
49
42
50
43
Convert the decimal number 386 to hex.
51
44
Answer:
52
-
182
53
45
54
46
Convert the hex number 386 to decimal.
55
47
Answer:
56
-
902
57
48
58
49
Convert the hex number B to decimal.
59
50
Answer:
60
-
11
61
51
62
52
If reading the byte 0x21 as a number, what decimal number would it mean?
63
53
Answer:
64
-
33
65
54
66
55
If reading the byte 0x21 as an ASCII character, what character would it mean?
67
56
Answer:
68
-
! - exclamation mark
69
57
70
58
If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
71
59
Answer:
72
-
A very Dark shade of Grey.
73
60
74
61
If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
75
62
Answer:
76
-
A bright purple ( Red=170 Strong Red, Green is 0 and Blue =255 is maximum value for Blue so Blue and Red make purple)
77
63
78
64
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
0 commit comments