Skip to content

Commit fd1db73

Browse files
committed
answers
1 parent 4350f48 commit fd1db73

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

number-systems/README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,38 @@ Do not convert any binary numbers to decimal when solving a question unless the
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

77
Convert the decimal number 14 to binary.
8-
Answer:
8+
Answer:
9+
1100
910

1011
Convert the binary number 101101 to decimal:
11-
Answer:
12+
Answer:
13+
45
1214

1315
Which is larger: 1000 or 0111?
1416
Answer:
17+
1000 because its equal to 8 in decimal and 8 is larger than 7 (0111)
1518

1619
Which is larger: 00100 or 01011?
1720
Answer:
21+
01011 is larger
1822

1923
What is 10101 + 01010?
2024
Answer:
25+
11111
2126

2227
What is 10001 + 10001?
2328
Answer:
29+
100010
2430

2531
What's the largest number you can store with 4 bits, if you want to be able to represent the number 0?
2632
Answer:
33+
largest number is 1111 = 15 in decimal
2734

2835
How many bits would you need in order to store the numbers between 0 and 255 inclusive?
29-
Answer:
36+
Answer: 8 bits
3037

3138
How many bits would you need in order to store the numbers between 0 and 3 inclusive?
32-
Answer:
39+
Answer: 2 bits
3340

3441
How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
3542
Answer:
@@ -38,28 +45,39 @@ How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)
3845
Answer:
3946

4047
Convert the decimal number 14 to hex.
41-
Answer:
48+
Answer: E
4249

4350
Convert the decimal number 386 to hex.
44-
Answer:
51+
Answer:
52+
1- decimal to binary = 110000010
53+
2- then to hex = 182
4554

4655
Convert the hex number 386 to decimal.
4756
Answer:
57+
using power of 16 method
58+
= (3*256)+(8*16)+6 = 768 + 128 + 6 = 902
4859

4960
Convert the hex number B to decimal.
5061
Answer:
62+
11
5163

5264
If reading the byte 0x21 as a number, what decimal number would it mean?
5365
Answer:
66+
33
5467

5568
If reading the byte 0x21 as an ASCII character, what character would it mean?
5669
Answer:
70+
!
5771

5872
If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
5973
Answer:
74+
dark grey
6075

6176
If reading the bytes 0xAA00FF as an RGB colour, as described in "Approaches for Representing Colors and Images", what colour would it mean?
6277
Answer:
78+
Mix of blue and red
6379

6480
If reading the bytes 0xAA00FF as a sequence of three one-byte decimal numbers, what decimal numbers would they be?
6581
Answer:
82+
10101010, 00000000, 11111111
83+
170, 0, 255

0 commit comments

Comments
 (0)