Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Week 5 - Number Systems.pdf
1. Number Systems
Decimal (base 10) {0 1 2 3 4 5 6 7 8 9}
o Place value gives a logarithmic representation
of the number
o Ex. 4378 means
4 X 103 = 4000
3 X 102 = 300
7 X 101 = 70
8 X 100 = 8
o The place also gives the exponent of the base
5. Decimal Equivalent
1101 1001
1 X 27 = 128
+ 1 X 26 = 64
+ 0 X 25 = 0
+ 1 X 24 = 16
+ 1 X 23 = 8
+ 0 X 22 = 0
+ 0 X 21 = 0
+ 1 X 20 = 1
217
Notice how powers of two
stand out:
20 = 1
21 = 10
22 = 100
23 = 1000
6. Decimal to Binary Conversion
Ex. 575
o Find the largest power of two less than the number
o 29 = 512
o Subtract that power of two from the number
o 575 – 512 = 63
o Repeat steps 1 and 2 for the new result until you reach zero.
o 25 = 32 63 – 32 = 31
o 24 = 16 31 – 16 = 15
o 23 = 8 15 – 8 = 7
o 22 = 4 7 – 4 = 3
o 21 = 2 3 – 2 = 1
o 20 = 1 1 – 1 = 0
o Construct the number
o 1000111111
8. Hexadecimal (base 16)
{0 1 2 3 4 5 6 7 8 9 A B C D E F}
Assignments Dec Hex Dec Hex
0 0 8 8
1 1 9 9
2 2 10 A
3 3 11 B
4 4 12 C
5 5 13 D
6 6 14 E
7 7 15 F
10. Hexadecimal is Convenient for
Binary Conversion
Binary Hex Binary Hex
0 0 1001 9
1 1 1010 A
10 2 1011 B
11 3 1100 C
100 4 1101 D
101 5 1110 E
110 6 1111 F
111 7 1 0000 10
1000 8 Nibble
11. Binary to Hex Conversion
Group binary number by fours (nibbles)
o 1101 1001 0110
Convert each nibble into hex equivalent
o 1101 1001 0110
D 9 6
12. Decimal to Hex Conversion
Ex. 284
o 162 = 256 284 – 256 = 28
o 161 = 16 28 - 16 = 12 (Hex C)
o Result 1 1 C
13. Another Example with an Extension
1054
o 162 = 256
But we have several multiples of 256 in 1054
o 1054/256 = 4.12 take integer part
o This eliminates 4*256 = 1024
1054 – 1024 = 30
o 161 = 16 30 – 16 = 14 (Hex E)
o Result 4 1 E
27. Properties of AND and OR
Associative Property
A + (B + C) = (A + B) + C
A (B C) = (A B) C
=
28. Properties of AND and OR
Distributive Property
A + B C = (A + B) (A + C)
A + B C
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
29. Distributive Property
(A + B) (A + C)
A B C Q
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
30. Binary Addition
A B S C(arry)
0 0 0 0
1 0 1 0
0 1 1 0
1 1 0 1
Notice that the carry results are the same as AND
C = A B
32. Exclusive OR (XOR)
Either A or B, but not both
This is sometimes called the
inequality detector, because the
result will be 0 when the inputs are the
same and 1 when they are different.
The truth table is the same as for
S on Binary Addition. S = A B
A B S
0 0 0
1 0 1
0 1 1
1 1 0
33. Getting the XOR
A B S
0 0 0
1 0 1
0 1 1
1 1 0
Two ways of getting S = 1
B
A
or
B
A
35. Half Adder
Called a half adder because we haven’t allowed for any carry bit
on input. In elementary addition of numbers, we always need to
allow for a carry from one column to the next.
18
25
4
3 (plus a carry)