Professional Documents
Culture Documents
Chapter 6
Chapter 6
Chapter 6
Reference books
Reference books
1
15-Sep-20
Example
Typical analog
system
2
15-Sep-20
3
15-Sep-20
Easy to design
Easy to store
High precision and less affected by noise
Can be programmed
Fast response speed
Many digital circuits can be made into chips
4
15-Sep-20
Analog - digital
CD drive
5
15-Sep-20
6
15-Sep-20
7
15-Sep-20
8
15-Sep-20
Technical description
by diagram, flow chart
Design
Simulation
Re-design
The design works properly?
9
15-Sep-20
Testing
Finished products
10
15-Sep-20
11
15-Sep-20
12
15-Sep-20
Arithmetic function
13
15-Sep-20
14
15-Sep-20
15
15-Sep-20
2745.21410 =
2 * 103 + 7 * 102 + 4 * 101 + 5 * 100 +
2 * 10-1 + 1 * 10-2 + 4 * 10-3
Binary system
Binary point
Transfer
1011.1012 = 1 * 23 + 0 * 22 + 1 * 21 + 1 * 20 +
1 * 2-1 + 0 * 2-2 + 1 * 2-3
16
15-Sep-20
Octadecimal (O)
Example: 3728 = 372O
Represent
372O = 3*82 + 7*81 + 2*80
Hexadecimal (H)
Represent
3BAH = 3*162 + B*161 + A*160
17
15-Sep-20
Radix conversion
Convert from any S-system to decimal
Multiply each digit by the weight
Conversion formula
18
15-Sep-20
Examples
From B to D
Example : 10012
10012 = 1x23 + 0x22 + 0x21 + 1x20 = 9
From O to D
Example : 162.438
162.438 = 1x82+6x81+2x80+4x8-1+3x8-2
From H to D
Example : 1E4A.6B16
1x163+Ex162+4x161+Ax160+6x16-1+Bx16-2
1x163+14x162+4x161+10x160+6x16-1+11x16-2
19
15-Sep-20
Example 2 : 13.125
Convert the whole part : 13=11012
Convert the fraction part : 0.125
result whole part fraction part
0.125 x 2 = 0.250 0 0.25
0.25 x 2 = 0.50 0 0.5
0.5 x 2 = 1.0 1 0 (finish)
Result : 0012
Combine whole-fraction : 1101.001
20
15-Sep-20
Convert: B – O
Convert: B – H
Convert: O – B
Convert: H – B
Method 1 : using D as intermediaries
B–D–O
B–D–H
O–D–B
H–D–B
Example : 1011111011111110 : differcult
21
15-Sep-20
Relation tables 1
STT H B STT H B
0 0 0000 8 8 1000
1 1 0001 9 9 1001
2 2 0010 10 A 1010
3 3 0011 11 B 1011
4 4 0100 12 C 1100
5 5 0101 13 D 1101
6 6 0110 14 E 1110
7 7 0111 15 F 1111
22
15-Sep-20
Relation table 2
STT O B
0 0 000
1 1 001
2 2 010
3 3 011
4 4 100
5 5 101
6 6 110
7 7 111
23
15-Sep-20
Arithmetic Operations
1Byte = 8 bit
1KB = 210 Byte = 1024 Byte
1MB = 210 KB = 1024 KB.
1GB = 210 MB = 1024 MB
47
Arithmetic operations
24
15-Sep-20
Arithmetic Operations
49
Arithmetic operation
50
25
15-Sep-20
Notes:
0 number has 2 results : 000000(+0) and 100000 (-0)
Some calculations gave wrong results
Example: assume 5-bit number, we consider :
0 1 0 0 0 (+ 8) 0 1 0 0 0 (+8)
+ 0 1 0 1 0 (+ 10) + 1 0 0 1 0 (-2)
1 0 0 1 0 ( - 2) false 1 1 0 1 0 (-10) false
Therefore, the signed numbers must be expressed
26
15-Sep-20
27
15-Sep-20
56
28
15-Sep-20
57
1 11 1
12 001100 -12 110100
+ 9 + 001001 + -9 +110111
21 010101 -21 1101011
29
15-Sep-20
59
BCD code
BCD (Binary Coded Decimal): Represent each
decimal digit using a 4-bit combination. In the
following table: STT D BCD code
0 0 0000
Other combination 1 1 0001
not use: 2 2 0010
3 3 0011
1010, 1011, 1100,
4 4 0100
1101, 1110, 1111
5 5 0101
Are called invalid. 6 6 0110
7 7 0111
8 8 1000
9 9 1001
30
15-Sep-20
Example:
1941D = 11110010101 (use 11 bits–normal convert)
1941D = 0001 1001 0100 0001BCD (use 16 bits)
Operations on BCD numbers
A+B = S :
Rules
The number of memories in the low Decade is up to a high
decade and edit low decade
If any decade of the total is> 9, it must be edited
The editing is done by adding up to 6
Example:
18 0001 1000
+ 26 + 0010 0110
44 0011 1110
+ 0110 Edit S0 (decade S0)
0100 0100
31
15-Sep-20
Example:
1 (carry from decade S0)
28 0010 1000
+ 19 0001 1001
47 0100 0001
+ 0110 Edit S0
0100 0111
Logic arithmetic
X Y X+Y X.Y X XY
0 0 0 0 1 0
0 1 1 0 1 1
1 0 1 0 0 1
1 1 1 1 0 0
+ is called OR
. Is called AND
_ is called NOT
is called XOR
32
15-Sep-20
Logic gates
True table:
Relatioship
A out
Input – output relation : 0 1
Out A 1 0
65
Logic gates
True table:
Input-output relation :
out = A . B
66
33
15-Sep-20
Logic gates
NAND gate
Complement of AND logic
Logic gates
OR gate
Perform OR operation logic
Symbol:
A B out
0 0 0
0 1 1
True table:
1 0 1
Input-ouput relation :
out = A + B 1 1 1
68
34
15-Sep-20
Logic gates
NOR gate
Complement of OR logic operation
Symbol :
A B out
0 0 1
0 1 0
True table: 1 0 0
Input-output relation : 1 1 0
out = A + B
69
Logic gates
The output is only zero when all the inputs are the same
Symbol :
A B out
True table: 0 0 0
Input-output relation: 0 1 1
1 0 1
out A B A.B A.B 1 1 0
70
35
15-Sep-20
Logic gates
EXNOR gate
Complement of XOR logic operation
the same
Symbol :
A B out
0 0 1
0 1 0
True table: 1 0 0
Input-output relation : 1 1 1
out A B A.B A.B 71
36