1 / 16

Binary and Hexadecimal Numbers

Binary and Hexadecimal Numbers. Binary Numbers. 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 .)

phuc
Download Presentation

Binary and Hexadecimal Numbers

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. Binary and Hexadecimal Numbers

  2. Binary Numbers • 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 binarydigit.) • A ______________ is a group of 4 bits • A ______________ is a group of 8 bits

  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 methodfor 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. Decimal Binary Hexadecimal 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 8 1000 8 9 1001 9 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F 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.

  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.

More Related