Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LONDON \ DONARA BLANC | MODULE TOOLS | SPRINT 1 | Number systems #28

Closed
wants to merge 0 commits into from

Conversation

donarbl
Copy link

@donarbl donarbl commented Mar 6, 2025

Self checklist

  • [ x] I have committed my files one by one, on purpose, and for a reason
  • [x ] I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • [ x] I have tested my changes
  • [x ] My changes follow the style guide
  • [ x] My changes meet the requirements of this task

Changelist

Completed exercises on converting decimals into binary and hexadecimal and vice-versa.

Questions

Ask any questions you have for your reviewer.

@donarbl donarbl added Needs Review Participant to add when requesting review 📅 Sprint 1 Assigned during Sprint 1 of this module labels Mar 6, 2025
Copy link

@mjpeet mjpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great to see you working through these exercises and putting in the effort to understand binary and hexadecimal number systems. Mistakes are a natural part of the learning process, and it's important to learn from them and keep moving forward.

Keep pushing, and remember that every step, even the missteps, are part of your journey to becoming a proficient developer. You're doing great, and with continued effort and attention to detail, you'll keep improving.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi, it looks like this file was included in the wrong pull request. Please be more careful with your Git operations, as we hold trainees accountable for their Git knowledge at this level. Please ensure that each PR contains only the relevant changes for the specific task or feature you are working on. (i can see that this file also appears in your PR for individual shell tools)

hint: when you create a PR, it's always a good idea to check which file changes will actually be included in the PR, when you click the create PR button

How many bits would you need in order to store the numbers between 0 and 1000 inclusive?
Answer:

10
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would be the largest decimal number you can store on 10 bits?

How can you test if a binary number is a power of two (e.g. 1, 2, 4, 8, 16, ...)?
Answer:

n(n-1) =0
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you please explain to me what do you mean here? (what operation is between "n" and "(n-1)" in this expression?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a power of two has only 1 in its representation. 0001- 1, 0010- 2, 0011-3 is not power of 2, 0100-4, 0101-5 -is not power of 2. but there is a faster formula we can apply the formula n(n-1) =0, that is a bisewise operation.

Convert the hex number 386 to decimal.
Answer:

3*16(2) +8*16(1)+ 6*16(0) =902
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done, and thanks for sharing how you got to the result! (i'll be a nitpicky (and i can see you used "*" to signal multiplication), but i think it's worth 'signaling' if you try to use exponentiation/power of in plain text eg. with ^ - so your expression would look like this: 3 * 16^2 + 8 * 16^1 + 6 * 16^0 = 902 )

regardless, the solution is correct

If reading the byte 0x21 as an ASCII character, what character would it mean?
Answer:

"!!
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please clarify this? (is it 3 characters, two or just one at the end?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"!" i meant exclamation mark

@mjpeet mjpeet added Reviewed Volunteer to add when completing a review Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review labels Mar 6, 2025
@donarbl donarbl closed this Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed Reviewed Volunteer to add when completing a review 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants