Skip to content

Commit 8d93eda

Browse files
committed
Number system task is done
1 parent 3f26722 commit 8d93eda

2 files changed

Lines changed: 20 additions & 20 deletions

File tree

number-systems/Part-1.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,48 @@ The goal of these exercises is for you to gain an intuition for binary numbers.
77
The answers to these questions should be a number, either in binary, hex, or decimal.
88

99
Q1: Convert the decimal number 14 to binary.
10-
Answer:
10+
Answer: 1110
1111

1212
Q2: Convert the binary number 101101 to decimal:
13-
Answer:
13+
Answer: 45
1414

1515
Q3: Which is larger: 1000 or 0111?
16-
Answer:
16+
Answer: 1000
1717

1818
Q4: Which is larger: 00100 or 01011?
19-
Answer:
19+
Answer: 01011
2020

2121
Q5: What is 10101 + 01010?
2222
Answer:
2323

2424
Q6: What is 10001 + 10001?
25-
Answer:
25+
Answer: 11111
2626

2727
Q7: What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
28-
Answer:
28+
Answer: 15
2929

3030
Q8: How many bits would you need in order to store the numbers between 0 and 255 inclusive?
31-
Answer:
31+
Answer: 8
3232

3333
Q9: How many bits would you need in order to store the numbers between 0 and 3 inclusive?
34-
Answer:
34+
Answer: 2
3535

3636
Q10: How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
37-
Answer:
37+
Answer: 10
3838

3939
Q11: Convert the decimal number 14 to hex.
40-
Answer:
41-
40+
Answer: E
41+
4242
Q12: Convert the decimal number 386 to hex.
43-
Answer:
43+
Answer: 182
4444

4545
Q13: Convert the hex number 386 to decimal.
46-
Answer:
46+
Answer: 902
4747

4848
Q14: Convert the hex number B to decimal.
49-
Answer:
49+
Answer: 11
5050

5151
Q15: If reading the byte 0x21 as a number, what decimal number would it mean?
52-
Answer:
52+
Answer: 33
5353

5454
Q16: Continues in Part-2

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: A number is a power of two if it has only one “1” in its binary form.
1111

1212
Q17: If reading the byte 0x21 as an ASCII character, what character would it mean?
13-
Answer:
13+
Answer:It is !
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: It is a very dark grey
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: AA = 170 00 = 0 FF= 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 is a purple colour

0 commit comments

Comments
 (0)