Skip to content

Commit b9af78a

Browse files
committed
part 2 complete
1 parent b596b45 commit b9af78a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

number-systems/Part-2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ The goal of these exercises is for you to gain an intuition for binary numbers.
77
The answers to these questions will require a bit of explanation, not just a simple answer.
88

99
Q16: How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
10-
Answer:
10+
Answer: It can be written where only one bit is represented as a 1. E.g. 1000000 or 0010000
1111

1212
Q17: If reading the byte 0x21 as an ASCII character, what character would it mean?
13-
Answer:
13+
Answer: 0x21 is a hexadecimal number which is 33 in decimal, which corresponds to "!" as an ASCII character
1414

1515
Q18: If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
16-
Answer:
16+
Answer: In greyscale we represent the light intensity (whiteness) by a number between 0 - 255 in decimal (00 and FF in hexadecimal). A value of 0x21 would equal 33 in decimal which is close to black (approx. 1/8 of the way from black to white)
1717

1818
Q19: If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
19-
Answer:
19+
Answer: 170, 0, 255
2020

2121
Q20: If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
22-
Answer:
22+
Answer: This colour would be 10/15 saturated with red, no green and fully saturated with blue. This would likely be an purple colour.

0 commit comments

Comments
 (0)