Skip to content

Commit b6324e4

Browse files
Boshra MahmoudiBoshra Mahmoudi
authored andcommitted
remove changes on main branch
1 parent ad6bc8e commit b6324e4

2 files changed

Lines changed: 21 additions & 23 deletions

File tree

number-systems/Part-1.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,49 +6,49 @@ The goal of these exercises is for you to gain an intuition for binary numbers.
66

77
The answers to these questions should be a number, either in binary, hex, or decimal.
88

9-
Q1: Convert the decimal number 14 to binary. 0,2,4,8,16,32,64,128,256
10-
Answer: 1110
9+
Q1: Convert the decimal number 14 to binary.
10+
Answer:
1111

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

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

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

2121
Q5: What is 10101 + 01010?
22-
Answer: 11111
22+
Answer:
2323

2424
Q6: What is 10001 + 10001?
25-
Answer: 100010
25+
Answer:
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: 15
28+
Answer:
2929

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

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

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

3939
Q11: Convert the decimal number 14 to hex.
40-
Answer: E
40+
Answer:
4141

4242
Q12: Convert the decimal number 386 to hex.
43-
Answer: 182
43+
Answer:
4444

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

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

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

5454
Q16: Continues in Part-2

number-systems/Part-2.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +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: If there is just one 1 in a binary number, then it is a power of 2. This is because each bit represents a power of 2, so if there is just one 1 bit in a binary number, the value represents a power of 2.
10+
Answer:
1111

1212
Q17: If reading the byte 0x21 as an ASCII character, what character would it mean?
13-
Answer: !
13+
Answer:
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: It represents 33, which is in the range of 0–255 from dark to light. This value represents a very dark grey.
16+
Answer:
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: three one-byte =>
20-
AA | 00 | FF ==> AA : 10 * 16 + 10 * 1 = 170 | 00 : 0 * 16 + 0 * 1 = 0 | FF : 15 * 16 + 15 * 1 = 255
21-
so it reperesnt 170, 0, 255
19+
Answer:
2220

2321
Q20: If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
24-
Answer: AA => 170 Red, 00 => 0 green , FF : 255 is blue
22+
Answer:

0 commit comments

Comments
 (0)