Download presentation
Presentation is loading. Please wait.
Published byHarriet Powell Modified over 9 years ago
1
© Maths Support Service 2007 Binary and Hexadecimal Numbers Next Slide 111000 AE98FD 111000 AE98FD
2
© Maths Support Service 2007 Decimal Number System Ten Digits, so it is said to be base 10 0,1, 2, 3, 4, 5, 6, 7, 8, 9 Ten fingers Each position in the decimal system represents 10 n 4567 = 7 X 10 0 + 6 X 10 1 + 5 X 10 2 + 4 X 10 3 Previous Slide Next Slide
3
© Maths Support Service 2007 Base 5 0,1, 2, 3, 4, 10,11,12,13,14, 20, 21, 22, 23, 24, 30, 31, 32,33, 34, 40, 41,42,43, 44, 100, 101 etc Previous Slide Next Slide
4
© Maths Support Service 2007 Binary System Two digits, so it is base 2 0 and 1 0,1,10,11,100,101 etc Each position in a binary number represents 2 n Thus 10101= 1 X 2 0 + 0 X 2 1 + 1 X 2 2 +0 X 2 3 + 1 X 2 4 Previous Slide Next Slide Fancy a class game of Binary or Buzz
5
© Maths Support Service 2007 Activities 4, 5,6, 7 Base 10 = decimal Base 2 =binary 2356= 6 X 10 0 + 5 X 10 1 + 3 X 10 2 + 2 X 10 3 101101 = 1 X 10 0 + 0 X 10 1 + 1 X 10 2 + 1 X 10 3 +0 X 10 4 + 1 X 10 5 101101 = 1 X 2 0 + 0 X 2 1 + 1 X 2 2 + 1 X 2 3 +0 X 2 4 + 1 X 2 5 Previous Slide Next Slide
6
© Maths Support Service 2007 Adding Binary Numbers 10011 1111 ------------------- 100010 Previous Slide Next Slide
7
© Maths Support Service 2007 Subtraction Binary Numbers 101100 1111 ------------------------------------------------------- 11101 Previous Slide Next Slide
8
© Maths Support Service 2007 Activities 8 and 9 11110 1111 ---------------------- 101101 11011 ---------------------- 1001000 11100 111 ----------------------- 10101 11100 1011 --------------------- 10001 Add Subtract Previous Slide Next Slide
9
© Maths Support Service 2007 Convert 47 in Decimal to Binary 47 / 2 = 23 rem 1 23 / 2 = 11 rem 1 11 / 2 = 5 rem 1 5 / 2 = 2 rem 1 2 / 2 = 1 rem 0 Hence 47 in decimal format equals 101111 in binary format. Previous Slide Next Slide
10
© Maths Support Service 2007 Alternative Method to convert from Decimal to Binary Look for the highest power of 2 that divides into 47, subtract it from 47, then look for the highest power of 2 that goes into the remainder and subtract it from the remainder, repeat until you arrive at one or zero. 47 = 1 (32) + 0(16) + 1(8) +1(4) + 1(2) +1(1) So 47 equals 101111 in binary 29= 1 (16) + 1(8) + 1(4) + 0(2) + 1(1) So 29 = 11101 in binary Previous Slide Next Slide
11
© Maths Support Service 2007 Convert Binary to Decimal 10111 1 X 160 X 81 x 41 x 21 X 1 16 + 0 + 4 + 2 + 1 = 23 Previous Slide Next Slide
12
© Maths Support Service 2007 Activities 10,11,12,13 100100 1100011 11 23 Previous Slide Next Slide
13
© Maths Support Service 2007 11 Digits instead of 10 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A So numbers go 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, 10,11,12,13,14,15,16,17,18,19,1A, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 30 Previous Slide Next Slide
14
© Maths Support Service 2007 Hexadecimal 16 DIGITS 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Numbers go 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20 etc Previous Slide Next Slide
15
© Maths Support Service 2007 Uses of Hexadecimal Computer operations are done by binary systems. One and Zero or on and off or yes and no. Because of the large nature of binary numbers, when talking computer code, they are normally represented in hexadecimal format. These can be addresses of RAM. The hexadecimal notation is often used in error messages. Sometimes it is used in obscure web addresses. Also used in HTML code to convey the background colour required. Previous Slide Next Slide
16
© Maths Support Service 2007 HTML Color The background colour of a webpage is made up of a combination of three colours, red, green and blue. Note the background can also be a picture. Each colour is allowed to be represented by two hexadecimal digits in the order red, green and blue. This is known as the RGB color code. For each hexadecimal digit there is a choice of 16, so for 6 digits there is a choice of 16 x 16 x 16 x 16 x1 6 x 16. Over 1.6 million colours. Note mixing colours in HTML is not the same as mixing paint. Previous Slide Next Slide
17
© Maths Support Service 2007 To see HTML Color in action Go to START, All Programs, Accessories and Notepad. Type in the following code: Save as color.html in My Documents. Notice it has to have.html at the end. Go to My Documents and open. Click to see in action. Now change the hex colour codes in your Notepad program, save and refresh to see new colours. This could be done in a computer room or with a classroom computer and data projector. Previous Slide Next Slide
18
© Maths Support Service 2007 Special Color codes Black 000000 White FFFFFF Red FF0000 Green 00FF00 Blue 0000FF Gray 505050 or the same amount of each colour. Yellow F0F0000 Orange FF7000 Brown 905030 Previous Slide Next Slide
19
© Maths Support Service 2007 Convert Binary to Hexadecimal Any combination of 4 binary digits together will always represent the decimal numbers 0 to 15. Divide the binary number into groups of 4, from right to left. To convert 10001101 binary to hexadecimal, 1101 equals 13, which is D and 1000 equals 8. So 10001101 in binary equals 8D in hexadecimal. If there are less than 4 digits on the left add zeros to the left. For example 100111, is divided into 0111 and 0010 and hence equals 27 in hexadecimal. Previous Slide Next Slide
20
© Maths Support Service 2007 Convert Hexadecimal to Binary For example 2D4F 2=0010 D=1101 4=0100 F=1111 Then 2D4F=10110101001111 Previous Slide Next Slide
21
© Maths Support Service 2007 Convert Hexadecimal to decimal For example D67F D67F=13 X 16 3 + 6 X16 2 +7 X 16 1 + 15 Previous Slide Next Slide
22
© Maths Support Service 2007 Convert Decimal to Hexadecimal Best way is to go decimal to binary and then binary to hexadecimal. Previous Slide Next Slide
23
© Maths Support Service 2007 Conversion table http://www.dewassoc.com/support/msdos/ decimal_hexadecimal.htmhttp://www.dewassoc.com/support/msdos/ decimal_hexadecimal.htm Previous Slide Next Slide
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.