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
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,10 +17,10 @@ Which is larger: 00100 or 01011?
17
17
Answer: 01011 because 01011 = 11 whereas 00100 = 4
18
18
19
19
What is 10101 + 01010?
20
-
Answer: 32 because 10101 = 21 and 01010 = 10
20
+
Answer: ~~32 because 10101 = 21 and 01010 = 10~~ 11111 (31 in decimal)
21
21
22
22
What is 10001 + 10001?
23
-
Answer: 34 because 10001 = 17
23
+
Answer: ~~34 because 10001 = 17~~ 100010 (34 in decimal)
24
24
25
25
What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
26
26
Answer: 15; 0b0000
@@ -32,10 +32,10 @@ How many bits would you need in order to store the numbers between 0 and 3 inclu
32
32
Answer: 2
33
33
34
34
How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
35
-
Answer: 10
35
+
Answer: 10 (Actual answer: 10, but you'd have 23 spare values, so you can actually store between 0 and 1023 with 10 bits.)
36
36
37
37
How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
38
-
Answer: A binary number is a power of two if it has exactly one 1 bit, or equivalently if n & (n - 1) == 0 (for n > 0)
38
+
Answer: A binary number is a power of two if it has exactly one 1 bit, or equivalently if n & (n - 1) == 0 (for n > 0) (Actual answer: Test that it has exactly one 1.)
39
39
40
40
Convert the decimal number 14 to hex.
41
41
Answer: E
@@ -56,10 +56,10 @@ If reading the byte 0x21 as an ASCII character, what character would it mean?
56
56
Answer: !
57
57
58
58
If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
59
-
Answer: black
59
+
Answer: ~~black~~ Dark grey
60
60
61
61
If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
62
-
Answer: Red + (No Green) + (Blue) ≈ A bright purple
62
+
Answer: Red + (No Green) + (Blue) ≈ A bright purple (Actual answer: Purple)
63
63
64
64
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
0 commit comments