Skip to content

Commit 3a23ee7

Browse files
committed
Revert "Answering all the questions"
This reverts commit 3dc3b9f.
1 parent c032875 commit 3a23ee7

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

number-systems/README.md

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

77
Convert the decimal number 14 to binary.
88
Answer:
9-
1110
109

1110
Convert the binary number 101101 to decimal:
1211
Answer:
13-
45
1412

1513
Which is larger: 1000 or 0111?
1614
Answer:
17-
1000 > 0111 as 1000 represents 8 and 0111 is 7.
1815

1916
Which is larger: 00100 or 01011?
2017
Answer:
21-
01011 > 00100
2218

2319
What is 10101 + 01010?
2420
Answer:
25-
11111
2621

2722
What is 10001 + 10001?
2823
Answer:
29-
1 00010 (carrying out 1)
3024

3125
What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
3226
Answer:
33-
1111 in Binary and 15 in Decimal
3427

3528
How many bits would you need in order to store the numbers between 0 and 255 inclusive?
3629
Answer:
37-
8 bits
30+
31+
How many bits would you need in order to store the numbers between 0 and 3 inclusive?
32+
Answer:
3833

3934
How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
4035
Answer:
41-
2 bits
4236

4337
How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
4438
Answer:
45-
Every binary number is made from sums of powers of 2, but a number is a power of 2 itself if its binary representation has exactly one "1" and all the other bits are 0.
4639

4740
Convert the decimal number 14 to hex.
48-
Answer: 0xE
41+
Answer:
4942

5043
Convert the decimal number 386 to hex.
5144
Answer:
52-
182
5345

5446
Convert the hex number 386 to decimal.
5547
Answer:
56-
902
5748

5849
Convert the hex number B to decimal.
5950
Answer:
60-
11
6151

6252
If reading the byte 0x21 as a number, what decimal number would it mean?
6353
Answer:
64-
33
6554

6655
If reading the byte 0x21 as an ASCII character, what character would it mean?
6756
Answer:
68-
! - exclamation mark
6957

7058
If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
7159
Answer:
72-
A very Dark shade of Grey.
7360

7461
If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
7562
Answer:
76-
A bright purple ( Red=170 Strong Red, Green is 0 and Blue =255 is maximum value for Blue so Blue and Red make purple)
7763

7864
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
7965
Answer:
80-
170,0,255

0 commit comments

Comments
 (0)