Download presentation
1
Binary, Decimal, & Hexadecimal Numbers
Binary Numbers Digital electronic circuitry using logic gates Base-2 number system using two symbols: 0 & 1 A positional notation system with base (radix) of 2
2
Different Number Systems
Positional number systems The value of the number depends on the position of the digits. The value of each digit is determined by which place it appears in the full number. Our decimal number is know as a positional number system. For example, the number 123 has a very different value than the number 321, although the same digits are used in both numbers. Is binary number system a positional number system? NOT all number systems are positional number system. The Egyptian number system were not positional, but rather used many additional symbols to represent larger values.
3
Different Number Systems
Positional number systems The values of each position correspond to powers of the base of the number system. Our decimal number system, which uses base 10, the place values correspond to powers of 10: 10^3 10^2 10^1 10^0
4
Number Representation System
Representation of base 10, decimal, numbers Each digit is in , and its position determines which power of 10. In general, we represent the whole numbers in our base 10 system in the following way: Generalizing even further, we can represent numbers in the base, b, as follows:
5
Basic Concepts Behind the Binary
The binary system works under the exact same principles. 10^2 | 10^1 | 10^0 2^2 | 2^1 | 2^0 What would the binary number 1011 be in the decimal notation? Convert these numbers from binary to decimal. 10 111 10101 11110
6
Basic Concepts Behind the Binary
In the decimal system H | T | O 1 | 9 | 3 (H: Hundreds column; T:Tenscolumn; O:Ones column(unit)) 10^2 | 10^1 | 10^0 (1*10^2)+(9*10^1)+(3*10^0)
7
Unsigned Binary Integers to Decimal
2^4| 2^3| 2^2| 2^1| 2^0 | | | | 0 (2) | | 1 | | 1 (7) 1 | 0 | | | 1 (21) 1 | 1 | | | 0 (30)
8
Decimal Addition 33 +78
9
Binary Addition 0 0 1 +0 +1 +0 ---- ---- ---- 0 1 1
In decimal form, 1+1=2. In binary, any digit higher than 1 puts us a column to the left (as would 10 in decimal notation). Record the 0 in the ones column, and carry the 1 to the twos column to get an answer of "10." The decimal number "2" is written in binary notation as "10" (1*2^1)+(0*2^0). 1 +1 ---- 10
10
The process is the same for multiple-bit binary numbers:
1010 +1111 ______ Step one: Column 2^0: 0+1=1. Record the 1. Temporary Result: 1; Carry: 0 Step two: Column 2^1: 1+1=10. Record the 0, carry the 1. Temporary Result: 01; Carry: 1 Step three: Column 2^2: 1+0=1 Add 1 from carry: 1+1=10. Temporary Result: 001; Carry: 1 Step four: Column 2^3: 1+1=10. Add 1 from carry: 10+1=11. Record the 11. Final result: 11001
11
1+1=10 (1+1=0, and carry 1 to the next more significant bit)
The process is the same for multiple-bit binary numbers: 1010 +1111 ______ Alternately: 11 (carry) 11001 Rules of Binary Addition 0+0=0 0+1=1 1+0=1 1+1=10 (1+1=0, and carry 1 to the next more significant bit)
12
Try a few examples of binary addition:
Rules of Binary Addition 0+0=0 0+1=1 1+0=1 1+1=10 (1+1=0, and carry 1 to the next more significant bit)
13
Binary Addition 00011010 + 00001100 = 00100110 1 1 carries
= 26(base 10) = 12(base 10) = 38(base 10) Rules of Binary Addition 0+0=0 0+1=1 1+0=1 1+1=10 (1+1=0, and carry 1 to the next more significant bit)
14
Binary Addition 00010011 + 00111110 = 01010001 1 1 1 1 1 1 carries
= 19(base 10) = 62(base 10) = 81(base 10) Rules of Binary Addition 0+0=0 0+1=1 1+0=1 1+1=10 (1+1=0, and carry 1 to the next more significant bit)
15
Binary Addition Note: The rules of binary addition (without carries) are the same as the truths of the XOR gate
16
Binary Subtraction A B A-B One digit cases 0 0 0 1 0 1 1 1 0
The One case of Borrow original = and result = 1
17
Binary Subtraction Unsigned 0 1 0 0 1 0 1 0 74 (base 10)
0 (STEP THROUGH) 1 (base 10)
18
Binary Multiplication
Multiplication in the binary system works the same way as in the decimal system: 1*1=1 1*0=0 0*1=0 101 * 11 ____ _____ 1111
19
Binary Division Follow the same rules as in decimal division. For the sake of simplicity, throw away the remainder. For Example: /11 10011 r 10 _______ 11)111011 -11 ______ 101 11 10
20
Unsigned Decimal Integer to Binary
Division Quotient Remainder 156 / 2 78 78 / 2 39 39 / 2 19 1 19 / 2 9 9 / 2 4 4 / 2 2 2 / 2 1 / 2 Decimal Binary 156
21
Hexadecimal Integers A positional numeral system with a radix, or base, of 16 Sixteen distinct symbols, 0-9, A-F (or a-f) Each hexadecimal digit represents four binary digits (bits). One hexadecimal digit represents a nibble, which is half of an octet (8 bits). For example, byte values can range from 0 to 255 (decimal), but may be more conveniently represented as two hexadecimal digits in the range 00 to FF. (Two hexadecimal digits together represents a byte.) Hexadecimal is also commonly used to represent computer memory addresses. A human-friendly representation of binary-coded values in computing and digital electronics.
22
Binary to Hexadecimal Binary 0001.0110.1010.0111.1001.0100
Hexadecimal 16A794 Binary 0001 0110 1010 0111 1001 0100 Hexadecimal 1 6 A 7 9 4
23
Hexadecimal Integers 1hex = 1dec = 1oct 0 0 0 1
Ahex = 10dec = 12oct Bhex = 11dec = 13oct Chex = 12dec = 14oct Dhex = 13dec = 15oct Ehex = 14dec = 16oct Fhex = 15dec = 17oct
24
Binary Decimal Hexadecimal 00 16 10 1 01 17 11 2 02 18 12 3 03 19 13 4 04 20 14 5 05 21 15 6 06 22 7 07 23 8 08 24 9 09 25 0A 26 1A 0B 27 1B 0C 28 1C 0D 29 1D 0E 30 1E 0F 31 1F
25
Number Representation System
Representation of base 10, decimal, numbers Each digit is in , and its position determines which power of 10. In general, we represent the whole numbers in our base 10 system in the following way: Generalizing even further, we can represent numbers in the base, b, as follows:
26
Hexadecimal Integers For example, the hexadecimal number 2AF3 is equal, in decimal, to (2 × 163) + (10 × 162) + (15 × 161) + (3 × 160), or 10995(decimal).
27
Unsigned Hexadecimal to Decimal
Multiply each digit by its corresponding power of 16: dec = (D3 163) + (D2 162) + (D1 161) + (D0 160) Convert the number 1128 (Hexdecimal) to Decimal 4392 = (1 x 16^3) + (1 x 16^2) + (2 x 16^1) + (8 x 16^0) Convert the number 589 (Hexdecimal) to Decimal 1417 = (1 x 16^3) + (4 x 16^2) + (1 x 16^1) + (7 x 16^0) Convert the number 1531 (Hexdecimal) to Decimal 5425 = (1 x 16^3) + (5 x 16^2) + (3 x 16^1) + (1 x 16^0) Convert the number FA8 (Hexdecimal) to Decimal 4008 = (0 x 16^3) + (F x 16^2) + (A x 16^1) + (8 x 16^0)
28
Power of 16 in Decimal 16^0 1 16^1 16 16^2 256 16^3 4,096 16^4 65,536
Decimal Value 16^0 1 16^1 16 16^2 256 16^3 4,096 16^4 65,536 16^5 1,048,576 16^6 16,777,216 16^7 268,435,456
29
Unsigned Decimal Integer to Hexadecimal
Division Quotient Remainder 1128 / 16 70 8 70 / 16 4 6 4 / 16 Decimal Hexadecimal 1128 468
30
Two’s Complement As an action: (Assume the starting value is 1011)
Flip the bits from the starting value. 1011 => 0100 Add one to get the answer. => 0101
31
MSB indicates sign: 0 is positive; 1is negative
Signed Integer MSB indicates sign: 0 is positive; 1is negative 1XXX XXXX 0XXX XXXX Two’s-Complement A – B = A + ( -B ) 1 – 1 = 1 + ( -1 ) Starting Value (+1 in decimal) Step 1: Reverse the bits Step 2: Add 1 to the value from step 1 Sum:Two’s-complement representation (-1 in decimal) 1 -1 1 + ( -1 ) (1)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.