fundamentals of engineering supplied-reference handbook - Ventech!
fundamentals of engineering supplied-reference handbook - Ventech!
fundamentals of engineering supplied-reference handbook - Ventech!
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
NUMBER SYSTEMS AND CODES<br />
An unsigned number <strong>of</strong> base-r has a decimal equivalent D<br />
defined by<br />
n<br />
D = ∑ a r<br />
k<br />
k = 0<br />
k<br />
m<br />
−i<br />
i<br />
i=<br />
1<br />
+ ∑ a r<br />
, where<br />
ak = the (k+1) digit to the left <strong>of</strong> the radix point and<br />
ai = the ith digit to the right <strong>of</strong> the radix point.<br />
Binary Number System<br />
In digital computers, the base-2, or binary, number system is<br />
normally used. Thus the decimal equivalent, D, <strong>of</strong> a binary<br />
number is given by<br />
D = ak 2 k + ak–12 k–1 + …+ a0 + a–1 2 –1 + …<br />
Since this number system is so widely used in the design <strong>of</strong><br />
digital systems, we use a short-hand notation for some<br />
powers <strong>of</strong> two:<br />
2 10 = 1,024 is abbreviated "K" or "kilo"<br />
2 20 = 1,048,576 is abbreviated "M" or "mega"<br />
Signed numbers <strong>of</strong> base-r are <strong>of</strong>ten represented by the radix<br />
complement operation. If M is an N-digit value <strong>of</strong> base-r,<br />
the radix complement R(M) is defined by<br />
R(M) = r N – M<br />
The 2's complement <strong>of</strong> an N-bit binary integer can be<br />
written<br />
2's Complement (M) = 2 N – M<br />
This operation is equivalent to taking the 1's complement<br />
(inverting each bit <strong>of</strong> M) and adding one.<br />
The following table contains equivalent codes for a four-bit<br />
binary value.<br />
Binary<br />
Base-2<br />
0000<br />
0001<br />
0010<br />
0011<br />
0100<br />
0101<br />
0110<br />
0111<br />
1000<br />
1001<br />
1010<br />
1011<br />
1100<br />
1101<br />
1110<br />
1111<br />
Decimal<br />
Base-10<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
10<br />
11<br />
12<br />
13<br />
14<br />
15<br />
Hexadecimal<br />
Base-16<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
A<br />
B<br />
C<br />
D<br />
E<br />
F<br />
Octal<br />
Base-8<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
10<br />
11<br />
12<br />
13<br />
14<br />
15<br />
16<br />
17<br />
BCD<br />
Code<br />
0<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
---<br />
---<br />
---<br />
---<br />
---<br />
---<br />
Gray<br />
Code<br />
0000<br />
0001<br />
0011<br />
0010<br />
0110<br />
0111<br />
0101<br />
0100<br />
1100<br />
1101<br />
1111<br />
1110<br />
1010<br />
1011<br />
1001<br />
1000<br />
187<br />
ELECTRICAL AND COMPUTER ENGINEERING (continued)<br />
LOGIC OPERATIONS AND BOOLEAN ALGEBRA<br />
Three basic logic operations are the "AND ( · )," "OR (+),"<br />
and "Exclusive-OR ⊕" functions. The definition <strong>of</strong> each<br />
function, its logic symbol, and its Boolean expression are<br />
given in the following table.<br />
Function<br />
Inputs<br />
A B C = A·B C = A + B C = A ⊕ B<br />
0 0 0<br />
0<br />
0<br />
0 1 0<br />
1<br />
1<br />
1 0 0<br />
1<br />
1<br />
1 1 1<br />
1<br />
0<br />
As commonly used, A AND B is <strong>of</strong>ten written AB or A⋅B.<br />
The not operator inverts the sense <strong>of</strong> a binary value<br />
(0 → 1, 1 → 0)<br />
NOT OPERATOR<br />
Input Output<br />
A C = Ā<br />
0 1<br />
1 0<br />
DeMorgan's Theorems<br />
first theorem:<br />
A + B = A ⋅ B<br />
second theorem:<br />
A⋅<br />
B = A + B<br />
These theorems define the NAND gate and the NOR gate.<br />
Logic symbols for these gates are shown below.<br />
NAND Gates: A ⋅ B = A + B<br />
NOR Gates: A +<br />
B = A ⋅ B