1 / 19

Computer science

Computer science. ADDING BINARY NUMBERS CONVERT DECIMAL TO BINARY CONVERTING HEX TO BINARY CONVERTING BINARY TO HEX. REMEMBER TO PLAY THE CHANGING HEXADECIMAL TO DECIMAL VIDEO. objectives. MUST: be able to add two 4 bit binary numbers together

iris-morris
Download Presentation

Computer science

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer science ADDING BINARY NUMBERS CONVERT DECIMAL TO BINARY CONVERTING HEX TO BINARY CONVERTING BINARY TO HEX REMEMBER TO PLAY THE CHANGING HEXADECIMAL TO DECIMAL VIDEO

  2. objectives MUST: be able to add two 4 bit binary numbers together Understand that binary numbers are held in 8 bit fixed strings on computers Be able to explain how to convert binary to decimal in plenary SHOULD: be able to add tow 8 bit binary numbers together Be able to add and convert binary numbers into 8 bit fixed strings Be able to explain how to add two binary numbers together COULD: Be able to recognise and explain binary overflow when adding tow 8 bit binary numbers

  3. Starter task refresh binary numbers CONVERT DECIMAL TO BINARY In your exercise book write down the following decimal numbers Convert them to binary You have 5 minutes Nb show your workings

  4. DECIMAL TO BINARY 10 100 1000 10000 11232 34 7001

  5. CONVERT DECIMAL TO BINARY In your exercise book write down the following BINARY numbers You have 5 minutes Nb show your workings

  6. REFRESH TWO CONVERT BINARY TO DECIMAL 1001 11010111 00000001 30000300 00100100 00000001

  7. ADDING BINARY NUMBERS Adding binary numbers is very similar to the way we add base 10 numbers For example lets add 367 to 284 To explain the above: 7+4 =11,so we write down 1 and carry the 1 6+8+1=15,so we write down 5 and carry the 1 3+2+1=6 These are then carried over values from the previous column

  8. Adding binary continued when adding binary numbers we follow the same process ,but 1+1 =2 which is written as 10 in Binary: The first few numbers in Binary are

  9. Binary addition Lets look at binary addition 1011+1101 answer Carried over 1+1 =10(in binary) So we write down 0 and carry the 1 1+0+1=10(in binary) So we write down 0 and carry the 1 0+1+1=10(in Binary) So we write down 0 and carry the 1 1+1+1=11(in binary) So we write down 1 and carry the 1 0+0+1=1 so we write down the 1 These are carried over values from the previous column

  10. Another example of adding binary Add 101 and 1001 in binary answer Carry over To explain: 1+1 in binary is 10 so carry 1 and place zero In next column we carried 1 so it will be 0+0+1=1 In next column 1+0 no carry over so 1 In next column 1 so 1 is displayed

  11. Last binary addition Add 11000010 and 10111010 In this case when we add these numbers together we find that we need a ninth column.If our computer only had 8 bits to store numbers this would mean that the carry over from the 8th column would be lost. THIS IS CALLED THE OVERFLOW. The calculation has overflowed the available space. In 8 bits the largest number we can store is 255

  12. Hexamdecimal The reason for using hexadecimal is that large binary numbers are difficult to remember and when programmers work with these values they need something that is easier to recognise and appreciate. Since a byte has 8 bits each it easily splits into 2 sections known as nibbles that are 4 bits If we look at our column headings for base 2 you will note that the first 4 are = 0 =15

  13. Hexadecimal continued…. If you recall in base 10 we have the 10 symbols 0-9 If we use the 16 sybols for 0-15 we can use a system based upon place values of 16 rather than 2 or 10.This is called hexdecimal(hex) Thre is a need though for symbols for the numbers 10,11,12,13,14,15 because in base 16, 12 would mean 1 lot of 16 and 2 lots of 1(or 18)

  14. Hexadecimal

  15. Converting binary to hexadecimal: 11110011 into hex: NIBBLE 1(4 BITS) NIBBLE 2(4 BITS) Split the 8 bits into two nibbles: 1111 0011 Put into the column headings: Add the column headings together: 15 3 In hexadecimal this becomes: 3F

  16. ANSWER FIND 3 ON HEX SCALE THEN FIND 15 ON HEX SCALE THEN ADD

  17. Converting denary to hexadecimal: 45 denary into hex: Divide the number by 16 repeatedly and note the remainder: The number is placed before the letter so 45 is converted to 2D

  18. Converting hexadecimal into binary: NB:TO WORK THIS OUT YOU NEED TO FIRST WORK OUT THE BINARY EQUIVALENT OF EACH PART OF THE HEX NUMBER –IE TRANSLATE 3 IN HEX TO BINARY THEN B IN HEX TO BINARY USING TABEL THEN FIND B IN BINARY • 3B hex into binary: • 3 in binary = 0011 NIBBLE 1 • HEX B = 11 = 1011 NIBBLE 2 HALF THE 8 BITS INTO 4 BITS Put the two nibbles together to get a byte and this gives 111011 NB: you do not need to include any 0s at the beginning so00111011is the same as 111011

  19. NOW YOUR TURN !!! Convert 28, 72, 131, 235 and 255 from denary to binary Convert 1011, 11011, 10001010 and 11001000 to denary How many kilobytes are there in a gigabyte? Add the following numbers in binary and show your working: 1010 + 101 10001 + 11001 111001 + 100011 Convert the following binary numbers into hexadecimal: 10010011 b) 10101000 c) 111011 Convert the following hexadecimal numbers into binary AND denary: 1A b) 35 c) BC REMEMBER REFER BACK TO THE HEXADECIMAL TABLE TO WORK OUT THE

More Related