![Page 1: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/1.jpg)
Computer Programming 12
Mr. Jean
February 11th, 2014
![Page 2: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/2.jpg)
The plan:
• Video clip of the day
• Review of Binary
• Review of Decimal
• Hexadecimal to Decimal
• Hexadecimal to Binary
![Page 3: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/3.jpg)
12510 => 5 x 100 = 52 x 101 = 201 x 102 = 100
125
Base
Weight
Example in Decimal:
![Page 4: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/4.jpg)
Example in Binary:
1010112 => 1 x 20 = 11 x 21 = 20 x 22 = 01 x 23 = 80 x 24 = 01 x 25 = 32
4310
Bit “0”
![Page 5: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/5.jpg)
Hexadecimal to Decimal
Hexadecimal
Decimal Octal
Binary
![Page 6: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/6.jpg)
Hexadecimal to Decimal
• Technique– Multiply each bit by 16n, where n is the
“weight” of the bit– The weight is the position of the bit, starting
from 0 on the right– Add the results
![Page 7: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/7.jpg)
Example
ABC16 => C x 160 = 12 x 1 = 12 B x 161 = 11 x 16 = 176 A x 162 = 10 x 256 = 2560
274810
![Page 8: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/8.jpg)
Hexadecimal to Binary
Hexadecimal
Decimal Octal
Binary
![Page 9: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/9.jpg)
Hexadecimal to Binary
• Technique– Convert each hexadecimal digit to a 4-bit
equivalent binary representation
![Page 10: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/10.jpg)
Example10AF16 = ?2
1 0 A F
0001 0000 1010 1111
10AF16 = 00010000101011112
![Page 11: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/11.jpg)
Decimal to Hexadecimal
Hexadecimal
Decimal Octal
Binary
![Page 12: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/12.jpg)
Decimal to Hexadecimal
• Technique– Divide by 16– Keep track of the remainder
![Page 13: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/13.jpg)
Example123410 = ?16
123410 = 4D216
16 1234 77 216 4 13 = D16 0 4
![Page 14: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/14.jpg)
Try this exercise
Don’t use a calculator!
Decimal Binary
Hexa-decimal
33
1110101
1AF
![Page 15: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/15.jpg)
Exercise – Convert …
Decimal Binary
Hexa-decimal
33 100001 21
117 1110101 75
451 111000011
1C3
431 110101111
1AF
Answer
![Page 16: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/16.jpg)
To do:
• Complete #1 & #2 on worksheet #2 (the backside of the page we were working on)
![Page 17: Computer Programming 12 Mr. Jean February 11 th, 2014](https://reader036.vdocument.in/reader036/viewer/2022083009/5697bff31a28abf838cbc873/html5/thumbnails/17.jpg)
Moodle Login