# 1 Binary and Hexadecimal Numbers. 2 A binary number (base 2) is a sequence using the digits 0 and 1, such as 1101001. The base of a number system is equal.

## Presentation on theme: "1 Binary and Hexadecimal Numbers. 2 A binary number (base 2) is a sequence using the digits 0 and 1, such as 1101001. The base of a number system is equal."— Presentation transcript:

2 A binary number (base 2) is a sequence using the digits 0 and 1, such as 1101001. The base of a number system is equal to the number of digits in that system. Each of the digits is called a bit (from the words binary digit.) A ______________ is a group of 4 bits A ______________ is a group of 8 bits Binary Numbers

3 Writing Binary Numbers A binary number is sometimes written with the subscript 2 when there is a chance that the binary number might be mistaken for a decimal number. Long binary numbers are often written with their bits separated in groups of four. The leftmost bit is called the most significant bit (MSB) and the bit at the extreme right is the least significant bit (LSB).

4 Place Value binary point

5 Expanded Notation A number in expanded form is expressed as the sum of the products of each digit and its place value. Example The decimal number 8,156 can be expressed as The binary number 11001 can be expressed as

6 Converting Binary Numbers to Decimal To convert a binary number to decimal, simply write the binary number in expanded notation (omitting those where the bit is 0), and add the resulting values. Example Convert the binary number 1001.011 to decimal.

7 Converting Decimal Integers to Binary METHOD 1: To convert a decimal integer to binary, you find the largest power of two that will divide into the number; put a 1 in this place. Subtract that power from the number and find the next largest power of two that divides the number; put a 1 in that place. Keep subtracting the decreasing powers of two until you get to the ones place. Example Convert decimal integer 59 to binary.

8 Converting Decimal Integers to Binary: METHOD 1 Example Convert decimal integer 423 to binary.

9 Converting Decimal Integers to Binary: METHOD 1 METHOD 1 works well if the given decimal number is relatively small, but becomes more difficult with large decimal numbers. The next slide shows an alternative algorithmic method for converting decimal integers to binary.

10 Converting Decimal Integers to Binary: METHOD 2 METHOD 2: To convert a decimal integer to binary, divide repeatedly by 2. The remainders form the binary number, with those at the top of the column appearing at the right of the binary number (write right to left). ie. The last remainder is the Most Significant Digit (leftmost digit). Example Convert decimal integer 59 to binary.

11 Converting Decimal Integers to Binary Example Convert decimal integer 8375 to binary.

12 A Brief Look at Hexadecimal Numbers Hexadecimal (hex) numbers are obtained by grouping the bits in a binary number into sets of four (nibbles) and representing each set by a single number or letter. The base of hexadecimal numbers is 16. DecimalBinaryHexadecimal 000000 100011 200102 300113 401004 501015 601106 701117 810008 910019 101010A 111011B 121100C 131101D 141110E 151111F

13 Converting Binary Numbers to Hexadecimal Group the bits into sets of four starting at the binary point, adding zeros as needed to flesh out the groups. Rewrite each nibble using the equivalent hex digit (hexit?). Example Convert the binary number 101111.0011111 into hexadecimal.

14 Converting Hexadecimal Numbers to Binary Convert each hex digit into its equivalent binary nibble (group of 4 bits). Example Convert the hex number 7B2.D0E into binary.

15 Converting Hexadecimal Numbers to Decimal Use expanded notation and place value with a base of 16. Example Convert 4C.F to decimal.

16 Converting Decimal Numbers to Hexadecimal Repeatedly divide the given decimal number by 16 and convert each remainder to hex. The remainders form our hex number, the last remainder being the most significant digit. Example Convert 83759 to hexadecimal.

Similar presentations