London | 25-SDC-July | Andrei Filippov | Sprint 1 | Number systems exercises#69
London | 25-SDC-July | Andrei Filippov | Sprint 1 | Number systems exercises#69Droid-An wants to merge 6 commits intoCodeYourFuture:mainfrom
Conversation
chinar-amrutkar
left a comment
There was a problem hiding this comment.
Well done! There are a few errors which you need to correct, hopefully the hints help!
number-systems/README.md
Outdated
|
|
||
| How many bits would you need in order to store the numbers between 0 and 255 inclusive? | ||
| Answer: | ||
| Answer: 7 |
There was a problem hiding this comment.
Think about what 255 looks like in binary form. How many bits does it have?
There was a problem hiding this comment.
It will be 11111111, so I’ll need 8 bits for this. I completely forgot that the last digit in a binary number represents 2 to the power of 0, not 1.
number-systems/README.md
Outdated
|
|
||
| How many bits would you need in order to store the numbers between 0 and 1000 inclusive? | ||
| Answer: | ||
| Answer: 9 |
There was a problem hiding this comment.
Think about what 1000 looks like in binary form. How many bits does it have?
There was a problem hiding this comment.
1111101000 has 10 bits, so I need 10 bits. I made the same mistake again - I forgot that the rightmost digit represents 2 to the power of 0.
number-systems/README.md
Outdated
|
|
||
| Convert the decimal number 14 to hex. | ||
| Answer: | ||
| Answer: F |
There was a problem hiding this comment.
Think again!
Hint - you start counting the alphabets from 10, not 11
|
|
||
| If reading the byte 0x21 as a greyscale colour, as described in "Approaches for Representing Colors and Images", what colour would it mean? | ||
| Answer: | ||
| Answer: Gray colour with light intensity equals 33 |
There was a problem hiding this comment.
I'm not sure I understand the question clearly. Are you asking why the colour is grey, or why it's light instead of dark
|
Hi Andrei, I think the only question left here is when the reviewer was asking about the grey colour. When you say "light intensity equals 33" - what would this look like if displayed on a screen? Can you describe that colour in general terms |
|
Hi. Since grayscale images are commonly represented with 8 bits per pixel, allowing for 256 shades of grey, where 0 corresponds to black (no light intensity) and 255 to white (full intensity), I would describe the colour 0x21 as a dark grey. |
|
Great - you are done with this sprint now |
Learners, PR Template
Self checklist
Changelist
done exercises
Questions
no questions