Presentation is loading. Please wait.

Presentation is loading. Please wait.

Binary and Hexadecimal Numbers

Similar presentations


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

1 Binary and Hexadecimal Numbers
MAT 105 FALL 2009 Binary and Hexadecimal Numbers

2 MAT 105 FALL 2009 Binary Numbers A binary number (base 2) is a sequence using the digits 0 and 1, such as 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 byte is a group of 8 bits

3 Writing Binary Numbers
A binary number is sometimes written with a subscript 2 when there is a chance that the binary number might be mistaken for a decimal number. Long binary numbers are sometimes written with their bits 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 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 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. Subtract that power from the number and find the next largest power of two that divides the number. 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
MAT 105 FALL 2009 Converting Decimal Integers to Binary: METHOD 1 Example Convert decimal integer 423 to binary.

9 Converting Decimal Integers to Binary: METHOD 1
MAT 105 FALL 2009 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
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
MAT 105 FALL 2009 Converting Decimal Integers to Binary Example Convert decimal integer 8375 to binary.

12 A Brief Look at Hexadecimal Numbers
MAT 105 FALL 2009 A Brief Look at Hexadecimal Numbers Hexadecimal (hex) numbers are obtained by grouping the bits in a binary number into sets of four and representing each set by a single number or letter. The base of hexadecimal numbers is 16. Decimal Binary Hexadecimal 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 1010 A 11 1011 B 12 1100 C 13 1101 D 14 1110 E 15 1111 F

13 Converting Binary Numbers to Hexadecimal
Group the bits into sets of four starting at the binary point, adding zeros as need to fill out the groups. Rewrite each group of 4 using the equivalent hexadecimal number. Example Convert to hexadecimal.

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

15 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 to hexadecimal.


Download ppt "Binary and Hexadecimal Numbers"

Similar presentations


Ads by Google