Topic 1b
Binary and Hexadecimal Integer Representations
Prior to Class
By the end of this topic students should be able to:
- Convert a binary representation (unsigned integer) to its equivalent base ten value.
- Convert a base ten value to its binary equivalent (unsigned integer).
- Convert a length 4 binary representation (unsigned integer) to its equivalent hexadecimal value.
- Convert a hexadecimal value to its binary equivalent (unsigned integer).
- Calculate the sum of two bit-strings with the solution expressed as a bit string.
- Calculate how many unique values can be stored in N bits.
- Binary representation of non-negative integers - pp 51-54
- Hexadecimal - pp 32-33
In class
- Discussion
- Activity
- Some practice games I have coded up in Scratch
- Cisco has a fun Binary Game where you have to race against the timer
Checking for Understanding
Answer the following questions from your textbook. The answers to all Q&E questions are in the back of your book in Appendix F.
- p56, #1
- p56, #2
- p56, #5 a and c (b&d are covered in the next topic)
- p34, #5
- p34, #6
Extra Help
Extra Help Videos
- Dr. Schafer explains converting binary strings to integers
- Dr. Schafer explains converting integers to binary strings
- Dr. Schafer explains the idea (and calculation) of hexadecimal?
The answers to the CFU questions above are provided in the back of the book. The following videos explain how we would arrive at some of those answers.
- From binary strings to integers
- CFU p56, #1
- Note, we have a typo in the slides for 1e. There are only four 1s (which is 15) but the book has five 1s (which is 16+15 or 31).
- CFU p56, #1
- From integers to binary strings
- From binary strings to hexadecimal
Further Information
If you want to see someone else explain this material, you might use these resources. Again, this material is a supplement to this course and is completely optional.
- Crash Course Computing #4 - Representing Numbers and Letters with Binary
- Note, we are only going to be dealing with integers at this time. That ends at about 5:50 so you can stop at that point.
- https://www.youtube.com/watch?v=Xpk67YzOn5w
- Note, we are only dealing with part of this video from 0-3:45 and then 5:00-6:30