Skip to content

Commit 71d77e6

Browse files
committed
answer all question
1 parent 4350f48 commit 71d77e6

1 file changed

Lines changed: 65 additions & 0 deletions

File tree

number-systems/README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,54 @@ Do not convert any binary numbers to decimal when solving a question unless the
44

55
The goal of these exercises is for you to gain an intuition for binary numbers. Using tools to solve the problems defeats the point.
66

7+
Convert the decimal number 14 to binary.
8+
Answer: 1110
9+
10+
Convert the binary number 101101 to decimal:
11+
Answer: 45
12+
13+
Which is larger: 1000 or 0111?
14+
Answer: 1000
15+
16+
Which is larger: 00100 or 01011?
17+
Answer: 01011
18+
19+
What is 10101 + 01010?
20+
Answer: 100000
21+
22+
What is 10001 + 10001?
23+
Answer: 100010
24+
25+
What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
26+
Answer: 15
27+
28+
How many bits would you need in order to store the numbers between 0 and 255 inclusive?
29+
Answer: 9 bits
30+
31+
How many bits would you need in order to store the numbers between 0 and 3 inclusive?
32+
Answer: 2 bits
33+
34+
How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
35+
Answer: 10 bits
36+
37+
How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
38+
Answer: n & n-1 == 0
39+
40+
Convert the decimal number 14 to hex.
41+
Answer: E
42+
43+
Convert the decimal number 386 to hex.
44+
Answer: 11E
45+
46+
Convert the hex number 386 to decimal.
47+
Answer: 902
48+
49+
Convert the hex number B to decimal.Do not use any tools or programming to solve these problems. Work it out yourself by hand, and fill in the answers.
50+
51+
Do not convert any binary numbers to decimal when solving a question unless the question explicitly tells you to.
52+
53+
The goal of these exercises is for you to gain an intuition for binary numbers. Using tools to solve the problems defeats the point.
54+
755
Convert the decimal number 14 to binary.
856
Answer:
957

@@ -63,3 +111,20 @@ Answer:
63111

64112
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
65113
Answer:
114+
115+
Answer: 11
116+
117+
If reading the byte 0x21 as a number, what decimal number would it mean?
118+
Answer: 33
119+
120+
If reading the byte 0x21 as an ASCII character, what character would it mean?
121+
Answer: !
122+
123+
If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
124+
Answer:
125+
126+
If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
127+
Answer: purple but I found the answer on google not from the PDF.
128+
129+
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
130+
Answer:170 0 255

0 commit comments

Comments
 (0)