Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary and Hexadecimal

Similar presentations


Presentation on theme: "Binary and Hexadecimal"— Presentation transcript:

1 Binary and Hexadecimal
Photocopiable/digital resources may only be copied by the purchasing institution on a single site and for their own use © ZigZag Education, 2016

2 456 Base 10 Normally numbers are written in base 10 (called decimal).
Each digit is worth 10 times more than the one to the right of it. 456 (4 × 100) (5 × 10) (6 × 1) 456 means four lots of 100, five lots of 10 and six lots of 1. (4 × 100) + (5 × 10) + (6 × 1) = 456 © ZigZag Education, 2016

3 111 Binary Computers work with a different number system.
Computers use binary which only has two numbers, one and zero. In binary each digit is worth twice as much as the one to the right of it. 111 (1 × 4) (1 × 2) (1 × 1) © ZigZag Education, 2016

4 Binary Examples Converting from binary (base 2) to decimal (base 10) is straightforward. 16s 8s 4s 2s 1s Working Total 1 (1x16)+(1x2)+(1x1) 19 (1x8)+(1x4)+(1x2) 14 Write out the value of each digit at the top of a column. Add together the value of the columns with a 1 in. © ZigZag Education, 2016 4

5 Denoting Bases As the digits look the same, subscripts are used to indicate which base a number has been written in. 111110 11112 The subscript 10 states this is a decimal number. The subscript 2 states this is a binary number. © ZigZag Education, 2016

6 Hexadecimal Numbers in binary can get rather long.
Hexadecimal (base 16) shortens the numbers. In hex, each column is worth 16 times the one to the right of it. 1016 = 1610 10016 = 25610 = Along with 0–9, hexadecimal also uses the letters A–F. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15. A016 = 16010 B0016 = C00016 = © ZigZag Education, 2016

7 Hexadecimal Examples Converting from hex to denary is also straightforward. 256s 16s 1s Working Total 1 2 3 (1×256)+(2×16)+(3×1) 291 A B C (10×256)+(11×16)+(12×1) 2748 Write out the value of each digit at the top of a column. Multiply the value of the column by the number in the column. Add together the totals to get the denary equivalent. © ZigZag Education, 2016 7

8 Hexadecimal to Binary BA = 01110110
Although computers work purely in binary, hex is used to save space on screen. Each hex digit has a value between 0 and 15. 89 = In binary, this is the same as 0000 to 1111. To convert a two-digit hex number, start by converting each number individually. A0 = Once each individual number has been converted, join the batches of 4 binary digits together to form 8 binary digits. © ZigZag Education, 2016

9 Binary to Hexadecimal 01100101 =
Binary to hex is also a straightforward process. Group the binary number into batches of four digits (starting at the right-hand end). = 0110 0101 6 5 Convert each batch of four digits to a single hex character. Then just join the hex digits back together. © ZigZag Education, 2016

10 Denary to Binary Converting from denary to binary uses subtraction rather than addition. Example: 230 in decimal to binary Start with the number line showing the values of the digits. 128 64 32 16 8 4 2 1 1 1 1 1 1 230 – 128 = 102 102 – 64 = 38 38 – 32 = 6 6 – 4 = 2 2 – 2 = 0 Locate the largest number you’ll need and put a 1 in that column. Subtract that number from the denary you’re converting and move along the number line. Repeat the process for each column, putting a 0 if the digit isn’t needed and a 1 if it is. © ZigZag Education, 2016

11 Decimal to Hexadecimal
Example: 2468 Divide the denary number by 16. 2400 ÷ 16 = 154 remainder 4 Write down the answer and also write down the remainder as a hex number. 154 ÷ 16 = 9 remainder A Repeat the process, i.e. divide the answer by 16 and write down the remainder. Keep going until the answer is 0 and you have the final remainder. 9 ÷ 16 = 0 remainder 9 The final remainder is the leftmost digit of the hex number, the second digit is the penultimate remainder and the other digits are the remainders in reverse order. 2468 in denary is 9A4 in hex Remember you can always convert to binary first before converting to hexadecimal if you find it easier. © ZigZag Education, 2016

12 END


Download ppt "Binary and Hexadecimal"

Similar presentations


Ads by Google