Computer Programming 12 Mr. Jean February 11 th, 2014
The plan: Video clip of the day Review of Binary Review of Decimal Hexadecimal to Decimal Hexadecimal to Binary
=>5 x 10 0 = 5 2 x 10 1 = 20 1 x 10 2 = Base Weight Example in Decimal:
Example in Binary: => 1 x 2 0 = 1 1 x 2 1 = 2 0 x 2 2 = 0 1 x 2 3 = 8 0 x 2 4 = 0 1 x 2 5 = Bit “0”
Hexadecimal to Decimal Hexadecimal DecimalOctal Binary
Hexadecimal to Decimal Technique –Multiply each bit by 16 n, 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
Example ABC 16 =>C x 16 0 = 12 x 1 = 12 B x 16 1 = 11 x 16 = 176 A x 16 2 = 10 x 256 =
Hexadecimal to Binary Hexadecimal DecimalOctal Binary
Hexadecimal to Binary Technique –Convert each hexadecimal digit to a 4-bit equivalent binary representation
Example 10AF 16 = ? A F AF 16 =
Decimal to Hexadecimal Hexadecimal DecimalOctal Binary
Decimal to Hexadecimal Technique –Divide by 16 –Keep track of the remainder
Example = ? = 4D = D
Try this exercise Don’t use a calculator! DecimalBinary Hexa- decimal AF
Exercise – Convert … DecimalBinary Hexa- decimal C AF Answer
To do: Complete #1 & #2 on worksheet #2 (the backside of the page we were working on)
Moodle Login