Upcoming SlideShare
×

# Class 3 Binary & Hexadecimal

2,142 views

Published on

In this third class we will continue our exploration of positional number systems, switching gears to examine binary and hexadecimal systems. We will also examine a problem-solving approach that is used by programmers - the IPO method.

Published in: Education
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

### Class 3 Binary & Hexadecimal

1. 1. Binary & Hexadecimal<br />Class 3 – Number Systems II<br />
2. 2. Introduction<br />Positional Number Systems<br />Decimal<br />Binary<br />Hexadecimal<br />The Power of Two<br />
3. 3. Agenda<br />Review from Week 2<br />Binary<br />Translating between Binary & Decimal<br />Binary Math<br />Hexadecimal Numbers<br />Converting between Binary & Hex<br />Converting between Decimal & Hex<br />IPO Approach to Problem-Solving<br />Ruby on Flash<br />
4. 4. Positional Number Systems<br />Decimal positioning (fingers and toes)<br />123,456<br />
5. 5. Positional Number Systems<br />Binary Number System<br />10101110<br />
6. 6. Binary-Decimal Conversion<br />Notation<br />10110112 (base 2 – or binary)<br />Convert Binary to Decimal<br />Use positional grid and add up values<br />e.g. 11012 ? 10012? 01102? 10002?<br />Convert Decimal to Binary<br />Divide into largest position, then use modulus<br />e.g. 34510? 79110? 23310 ?<br />Practice Exercises<br />
7. 7. Binary Mathematical Operations<br />Adding and Multiplying Binary<br />Subtracting and Dividing Binary102-12=12<br />Practice Exercises<br />10011101 1000 110111101101+101+111+101x100x111x101<br />1001 11011000110001 ÷ 111 111111 ÷ 1001-101-111-101<br />
8. 8. Positional Number Systems<br />Hexadecimal<br />A60F<br />
9. 9. Hex-Binary-Decimal Conversion<br />Notation<br />101101116 (base 16 – or hexadecimal)<br />Convert Binary to Hex<br />Nibbles & Tribbles<br />101111010001 = 1011 1101 0001 = BD1<br />Handout: Conversion Chart (also on site)<br />Convert Decimal to Hex<br />Divide into largest position, then use modulus<br />Practice Exercises<br />
10. 10. A Functional Example<br />
11. 11. Quest: Problem-Solving Approaches<br />Various Approaches<br />Step-by-step<br />Algorithmic<br />Heuristic<br />Programmatic<br />IPO – input, processing, output<br />Refer to handout<br />Group Exercise: Confusion at the restaurant<br />Debrief<br />
12. 12. Quest II: Ruby on a Flash Drive<br />Ruby on Flash – downloading and unpacking<br />http://rubyinstaller.org/downloads<br />Unpack to root of drive<br />Setting Path<br />Path command?<br />Rubyset.bat commands<br />Testing the installation with command prompt<br />C: ruby -v<br />
13. 13. Summary<br />Binary Number System, Operations and Conversion<br />Hexadecimal Number System and Conversion<br />Practical use of Hexadecimal<br />Quest 1: IPO Approach<br />Quest II: Ruby on Flash<br />Next Class: Intro to Ruby Programming<br />
14. 14. Assignment<br />Assignment 1: Math Review I<br />Due start of next class<br />Hand-in<br />