Download presentation
Presentation is loading. Please wait.
1
Positional Number Systems
2
Decimal Review 5049 = 5(1000) + 0(100) + 4(10) + 9(1)
5049 = 5· · · ·100 place digit
3
Binary Representation
27 = 27 = 1·24 + 1·23 + 0·22 + 1·21 + 1·20 27 = place digit
4
Some Binary Representations
010 ?2 110 210 310 410 510 610 710 810 910
5
Some Binary Representations
010 02 110 12 210 102 310 112 410 1002 510 1012 610 1102 710 1112 810 10002 910 10012
6
Powers of Two
7
Convert Binary to Decimal
8
Convert Binary to Decimal
= 53
9
Convert Decimal to Binary
20910 = smaller number = 1(128) + 81 = 1(128) smaller number = 1(128) + 1(64) + 17 = 1(128) + 1(64) + 0(32) + 1(16) + 1 1(128)+1(64)+0(32)+1(16)+0(8)+0(4)+0(2)+1(1) =
10
Binary Addition
11
Binary Addition carry
12
Binary Addition 12 + 12 1 02 12 12 + 12 1 12 1 1 carry
carry
13
Binary Addition 12 + 12 1 02 12 12 + 12 1 12 1 1 1 carry
carry
14
Binary Addition 12 + 12 1 02 12 12 + 12 1 12 1 1 1 carry
carry
15
Subtraction in Decimal System
16
Subtraction in Decimal System
borrowing
17
Subtraction in Decimal System
borrowing
18
Subtraction in Binary System
19
Subtraction in Binary System
borrowing
20
Subtraction in Binary System
borrowing
21
Two’s Complement Arithmetic
Computers often use 2’s complement arithmetic for working with signed numbers 2’s complement of a in n-bit arithmetic is the binary representation of 2n – a
22
Two’s Complement Example
The 8 bit representation of -27 is ( 28 – 27)10 = = Or flip the bits and add one -27 = = =
23
Two’s Complement Arithmetic
To subtract, take the two’s complement and then add. Otherwise just add the binary numbers and throw away any positions greater than 2n-1. If -2n-1 result < 2n-1 then everything is fine. Otherwise you have an overflow.
24
Hexadecimal Representations
Binary 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
25
Hexadecimal Representations
Binary 1 2 3 4 5 6 7 8 9 10 A 11 B 12 C 13 D 14 E 15 F
26
Hexadecimal Representations
Binary 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 8 1000 9 1001 10 A 1010 11 B 1011 12 C 1100 13 D 1101 14 E 1110 15 F 1111
27
Convert Hexadecimal to Decimal
3CF16 = 3(162) + 12(161) + 15(160) = 97510
28
Convert Hexadecimal to Binary
C50A16 C A
29
Convert Binary to Hexadecimal
D A
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.