Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lesson Objectives Aims You should be able to: Convert Denary to Binary

Similar presentations


Presentation on theme: "Lesson Objectives Aims You should be able to: Convert Denary to Binary"— Presentation transcript:

1 Lesson Objectives Aims You should be able to: Convert Denary to Binary
Add binary numbers Explain the term “overflow” Convert binary to hexadecimal Explain the use of hexadecimal numbers

2 A lot to do This will take more than 1 lesson We’re going to jump straight in and look at converting between different number systems You will need to practise these conversions – there are exam questions along the way.

3 Denary to Binary Rules Write out the column values
Start with the highest column value Does it fit into your number? Yes – put a 1 in that column, take the value away No – put a 0 in that column Move to the next column, repeat step 3 for each column

4 Step 1 – write out the values:
Denary to Binary Convert 217 to binary Step 1 – write out the values: 128 64 32 16 8 4 2 1

5 Denary to Binary – Convert 217
128 is less than 217. Put a 1 in that column Take 128 away from our target number : 217 – 128 = 89 Next column is worth 64, 64 is less than 89 so put a 1 in that column Take 64 away from our remaining total : 89 – 64 = 25 left over Next column is worth is more than 25 so we put a zero Move to the next column – is less than 25 so put a 1 in that column 25 – 16 = 9 8 is less than 9 so put a 1 in that column. 9-8 = 1…. 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1

6 Denary to binary – another example
Convert 187 to Binary Write out your table (just keep doubling each number from 1) Working from LEFT to RIGHT, put a 1 under each number that is nearest to your remaining total 187 – 128 = 59 59 – 32 = 27 27 – 16 = 11 11 – 8 = 3 3 – 2 = 1 1-1 = 0 187 = 128 64 32 16 8 4 2 1

7 Binary to Denary Covnersion Rules
Too easy! Put the column values on… Each column that contains a 1 – add up its value.

8 Convert the following binary number to Denary
Binary to Denary Convert the following binary number to Denary Step 1 – add values Step 2 – add the value of any column with a 1 in it. = = 159 1 128 64 32 16 8 4 2 1

9 June 2013 Q5 a

10 Hexadecimal Hexadecimal: Base 16 16 digits:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F The letters are NOT letters, they are digits!

11 Reasons for Hex Computers DO NOT understand Hexadecimal, it is purely for us. Hexadecimal is used because: Binary produces long strings / Hex is shorter Binary is difficult to work with / Hex easier to work with Hex can be easily converted to/from binary Convenience of 1 hex digit per nybble Hex is less susceptible to error than long binary numbers

12 Hex A useful table…

13 Rules – Hex Conversions
Each hex digit is perfectly represented by 4 BITS – this is important. You convert in the following order: Hex – Binary – Denary Denary – Binary – Hex Do NOT try to jump directly from Hex to Denary and vice versa.

14 Method Denary to Hex Convert to binary as normal
Split the binary number in to two 4 bit nybbles Convert each nybble in to a hex digit Put the two digits together Hex to Denary Split the hex digits into individual digits Convert each to a 4 bit nybble Put the two nybbles together to form a byte Convert the byte to Denary as normal

15 Denary to Binary to Hexadecimal
Convert 175 in to Hexadecimal Step 1 – Binary Step 2 – Split in to Nybbles Step 3 – Hex Digits 1010 = A 1111 = F Step 4 – Combine 175 Denary = AF Hexadecimal 128 64 32 16 8 4 2 1 Note the column values! 8 4 2 1 8 4 2 1

16 Hexadecimal to Binary to Denary
Convert C4 in to Denary Step 1 – Split and convert to Nybbles C = = Step 2 – Combine Step 3 – Convert = = 196 8 4 2 1 8 4 2 1 Note the column values! 128 64 32 16 8 4 2 1

17 June 2014 Q9 a

18 June 2014 Q9 b

19

20 June 2013 Q5 b

21

22 Sum Equals 0 + 0 0 + 1 1 1 + 0 1 + 1 0 CARRY 1 1 + 1 + 1 1 CARRY 1
Binary Addition Rules: Sum Equals 0 + 0 0 + 1 1 1 + 0 1 + 1 0 CARRY 1 1 CARRY 1

23 Now do some sums.. Sum Equals 0 + 0 0 + 1 1 1 + 0 1 + 1 0 CARRY 1 1 CARRY 1 + + +

24 Overflow The biggest number we can have in an 8 bit byte is 255 If our computer is 8 bit, this is the highest number we can handle What happens if you add 1 to 255??? You get zero… (and an error, or it crashes)

25 Explanation of Overflow
Try it out. What happens? Why might this be bad?! +

26 June 2014 Q3

27

28 Past Questions Jun-15 Binary 8b Jan-13 8a May-12 10a Jun-14
Binary - Addition 3a 1a Jan-11 3b Jun-13 Binary - Conversion 5a - i 5a - ii 6a May-11 6c Binary - Overflow 1b Jun-14 Hexadecimal 9a 9b Jun-13 5b May-12 6b May-11 6a 6d


Download ppt "Lesson Objectives Aims You should be able to: Convert Denary to Binary"

Similar presentations


Ads by Google