Telematics group
University of Göttingen, Germany
Computer Science II
(Summer Semester 2003)
- Prof. Dr. Dieter Hogrefe
- Dr. Xiaoming Fu
Computer Science II (Summer Semester 2003) Prof. Dr. Dieter Hogrefe - - PowerPoint PPT Presentation
Computer Science II (Summer Semester 2003) Prof. Dr. Dieter Hogrefe Dr. Xiaoming Fu Kevin Scott, M.A. Telematics group University of Gttingen, Germany Computer Science II Part I: Digital Logic and Boolean Algebra Telematics group
3
SS 2003 Computer Science II
4
SS 2003 Computer Science II
Decimal point . Least Significant Digit Most Significant Digit =0.01 =0.1 =1 =10 =100 =1000 10-2 10-1 100 101 102 103
5
SS 2003 Computer Science II
Binary point . Least Significant Bit Most Significant Bit =1/4 =1/2 =1 =2 =4 =8 2-2 2-1 20 21 22 23
6
SS 2003 Computer Science II
The Binary counting sequence is shown in the following table:
7
SS 2003 Computer Science II
can be represented by any device that has only two operating states or possible conditions.
(closed), we can represent any binary number by using series of switches.
– Binary 1: Any voltage between 2V to 5V – Binary 0: Any voltage between 0V to 0.8V – Not used: Voltage between 0.8V to 2V, this may cause error in a digital circuit.
8
SS 2003 Computer Science II
9
SS 2003 Computer Science II
10
SS 2003 Computer Science II
11
SS 2003 Computer Science II
Octal point . Least Significant Digit Most Significant Digit =1/512 =1/8 =1 =8 =64 =512 8-2 8-1 80 81 82 83
12
SS 2003 Computer Science II
Г
Г
13
SS 2003 Computer Science II
Hexa- decimal point . Least Significant Digit Most Significant Digit =1/4096 =1/16 =1 =16 =256 =4096 16-2 16-1 160 161 162 163
14
SS 2003 Computer Science II
15
SS 2003 Computer Science II
Hexadecimal Digit 0 1 2 3 4 5 6 7 Binary Equivalent 0000 0001 0010 0011 0100 0101 0110 0111 Hexadecimal Digit 8 9 A B C D E F Binary Equivalent 1000 1001 1010 1011 1100 1101 1110 1111 Each Hexadecimal digit is represented by four bits of binary digit.
1) Convert Octal (Hexadecimal) to Binary first. 2a) Regroup the binary number in 3 bits a group starts from the LSB if Octal is required. 2b) Regroup the binary number in 4 bits a group from the LSB if Hexadecimal is required.
5A816 = 0101 1010 1000 (Binary) = 2 6 5 0 (Octal)
16
SS 2003 Computer Science II
17
SS 2003 Computer Science II
Close switch Open switch Yes No High Low On Off True False Logic 1 Logic 0
18
SS 2003 Computer Science II
19
SS 2003 Computer Science II
20
SS 2003 Computer Science II
The + sign stands for the OR operation, not for ordinary addition.
21
SS 2003 Computer Science II
22
SS 2003 Computer Science II
x equals NOT A x equals the inverse of A x equals the complement of A
terms are used interchangeably.
23
SS 2003 Computer Science II
24
SS 2003 Computer Science II
25
SS 2003 Computer Science II
26
SS 2003 Computer Science II
27
SS 2003 Computer Science II
28
SS 2003 Computer Science II
29
SS 2003 Computer Science II
30
SS 2003 Computer Science II
31
SS 2003 Computer Science II
X= [(A'+C) * (B+D')]' = (A'+C)' + (B+D')' [by theorem(17)] = (A''*C') + (B'+D'') [by theorem (16)] = AC' + B'D
32
SS 2003 Computer Science II
33
SS 2003 Computer Science II
34
SS 2003 Computer Science II
35
SS 2003 Computer Science II
Hey! This looks like a t rut h t able!
36
SS 2003 Computer Science II
x y z f (x,y,z) f ’(x,y,z) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 f = m0 + m1 + m2 + m3 + m6 = Σm(0,1,2,3,6) = x’y’z’ + x’y’z + x’yz’ + x’yz + xyz’ f ’ = m4 + m5 + m7 = Σm(4,5,7) = xy’z’ + xy’z + xyz f ’ cont ains all t he mint erms not in f .
37
SS 2003 Computer Science II
38
SS 2003 Computer Science II
39
SS 2003 Computer Science II
40
SS 2003 Computer Science II
41
SS 2003 Computer Science II
xyz‘ xyz xy‘z xy‘z‘ x‘yz‘ x‘yz x‘y‘z x‘y‘z‘ m6 m7 m5 m4 m2 m3 m1 m0
42
SS 2003 Computer Science II
xyz‘ xyz xy‘z xy‘z‘ x‘yz‘ x‘yz x‘y‘z x‘y‘z‘ xyz‘ xyz xy‘z xy‘z‘ x‘yz‘ x‘yz x‘y‘z x‘y‘z‘ xyz‘ xyz xy‘z xy‘z‘ x‘yz‘ x‘yz x‘y‘z x‘y‘z‘
43
SS 2003 Computer Science II
44
SS 2003 Computer Science II
45
SS 2003 Computer Science II
46
SS 2003 Computer Science II
47
SS 2003 Computer Science II
48
SS 2003 Computer Science II
49
SS 2003 Computer Science II
50
SS 2003 Computer Science II
51
SS 2003 Computer Science II
52
SS 2003 Computer Science II
53
SS 2003 Computer Science II
54
SS 2003 Computer Science II
55
SS 2003 Computer Science II
56
SS 2003 Computer Science II
57
SS 2003 Computer Science II
58
SS 2003 Computer Science II
Command (at time t) Q(t) Q(t+1) Set X 1 Reset X Memorise / No Change 1 1
command Memory element stored value Q
Q(t): current state Q(t+1) or Q+: next state
59
SS 2003 Computer Science II
command Memory element stored value Q clock Positive edges Negative edges Positive pulses
60
SS 2003 Computer Science II
61
SS 2003 Computer Science II
Qnext = (R+Q‘current)‘ Qnext = (S+Q‘current)‘
62
SS 2003 Computer Science II
Qnext = (R+Q‘current)‘ Qnext = (S+Q‘current)‘
– If S = 1, R = 0. Q‘next = 0 Qnext = 1
– This is how you set the latch to 1, S means "Set“ – Notice it can take up to two steps (two gate delays) from the time S becomes 1 to the time Qnext = 1. – But once Qnext becomes 1, the outputs will stop
– If S = 0, R = 1. Qnext = 1 Qnext = 0
– This is how you reset or clear the latch to 0, R means "Reset“ – Again it can take up to two steps (two gate delays) from the time R becomes 1 to the time Qnext = 0. – But once Qnext becomes 0, the outputs will stop changing. This is also a stable state.
– Assume initially Q=0, Q‘=1. Input SR=10. – As S=1, Q‘ will change from 1 to 0 after one NOR-gate delay (vertical lines in the figure) – This change in Q‘, along with R=0, causes Q to become 1 after another gate delay – The latch then stablizes until S or R changes again – You have to think about time-critical issue in computing: e.g., signals arrive at some time, while the logic takes some time to reactDifficult to control timing in a large circuit.
63
SS 2003 Computer Science II
S C R Q Q'
64
SS 2003 Computer Science II
D C Q Q'
65
SS 2003 Computer Science II
66
SS 2003 Computer Science II
Positive edges Negative edges
67
SS 2003 Computer Science II
S C R Q Q' S C R Q Q' D C Q Q' D C Q Q' J C K Q Q' J C K Q Q'
68
SS 2003 Computer Science II
X = irrelevant (“don’t care”) ↑ ↑ ↑ ↑ = clock transition LOW to HIGH
S R CLK Q(t+1) Comments X Q(t) No change 1 ↑ ↑ ↑ ↑ Reset 1 ↑ ↑ ↑ ↑ 1 Set 1 1 ↑ ↑ ↑ ↑ ? Invalid
69
SS 2003 Computer Science II
70
SS 2003 Computer Science II
S Q Q' CLK Pulse transition detector R
CLK CLK' CLK* CLK' CLK CLK*
CLK' CLK CLK* CLK CLK' CLK*
71
SS 2003 Computer Science II
A positive edge-triggered D flip-flop formed with an S-R flip-flop.
S C R Q Q' CLK D D CLK Q(t+1) Comments 1 ↑ ↑ ↑ ↑ 1 Set ↑ ↑ ↑ ↑ Reset
↑ ↑ ↑ ↑ = clock transition LOW to HIGH
72
SS 2003 Computer Science II
* After occurrence of negative-going transition Q1 = X* D CLK Q Q' Q2 = Y* D CLK Q Q' Q3 = Z* D CLK Q Q'
Combinational logic circuit
Transfer X Y Z
73
SS 2003 Computer Science II
74
SS 2003 Computer Science II
J Q Q' CLK Pulse transition detector K
J K CLK Q(t+1) Comments ↑ ↑ ↑ ↑ Q(t) No change 1 ↑ ↑ ↑ ↑ Reset 1 ↑ ↑ ↑ ↑ 1 Set 1 1 ↑ ↑ ↑ ↑ Q(t)' Toggle Q J K Q(t+1) 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Q(t+1) = J.Q' + K'.Q
75
SS 2003 Computer Science II
76
SS 2003 Computer Science II
J Q Q' CLK Pulse transition detector K PRE CLR
J C K Q Q'
PRE CLR PRE CLR CLK Q Preset Toggle Clear
J = K = HIGH
77
SS 2003 Computer Science II
S R Q(t+1) Comments Q(t) No change 1 Reset 1 1 Set 1 1 ? Unpredictable J K Q(t+1) Comments Q(t) No change 1 Reset 1 1 Set 1 1 Q(t)' Toggle T Q(t+1) Q(t) No change 1 Q(t)' Toggle D Q(t+1) Reset 1 1 Set
78
SS 2003 Computer Science II
79
SS 2003 Computer Science II
A A' B B' y x CP D Q Q' D Q Q'
80
SS 2003 Computer Science II
81
SS 2003 Computer Science II
Present Next State Input State Output A B x A+ B+ y 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
82
SS 2003 Computer Science II
Present Next State Input State Output A B x A+ B+ y 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Present Next State Output State x=0 x=1 x=0 x=1 AB A+B+ A+B+ y y 00 00 01 01 00 11 1 10 00 10 1 11 00 10 1
83
SS 2003 Computer Science II
84
SS 2003 Computer Science II
Present Next State Output State x=0 x=1 x=0 x=1 AB A+B+ A+B+ y y 00 00 01 01 00 11 1 10 00 10 1 11 00 10 1
85
SS 2003 Computer Science II
86
SS 2003 Computer Science II
A B C' x B y CP J Q Q' K B' C x'
87
SS 2003 Computer Science II
A A' B B' y x CP D Q Q' D Q Q'
Figure 1.
88
SS 2003 Computer Science II
A B x CP J Q Q' K J Q Q' K
Figure 2.
89
SS 2003 Computer Science II
Present Next state Input state Flip-flop inputs A B x A+ B+ JA KA JB KB 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1
J K Q(t+1) Comments Q(t) No change 1 Reset 1 1 Set 1 1 Q(t)' Toggle
90
SS 2003 Computer Science II
Present Next state Input state Flip-flop inputs A B x A+ B+ JA KA JB KB 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
91
SS 2003 Computer Science II
92
SS 2003 Computer Science II
93
SS 2003 Computer Science II
00 10 11
1 1 1 1
01
Present Next State State x=0 x=1 AB A+B+ A+B+ 00 00 01 01 10 01 10 10 11 11 11 00
Present Next state Input state Flip-flop inputs A B x A+ B+ JA KA JB KB 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
0 X 0 X 1 X 0 X X 0 X 0 X 0 X 1 0 X 1 X X 1 X 0 0 X 1 X X 0 X 1
94
SS 2003 Computer Science II
Present Next state Input state Flip-flop inputs A B x A+ B+ JA KA JB KB X X 1 1 X 1 X 1 1 1 X X 1 1 1 1 X X 1 1 X X 1 1 1 1 X 1 X 1 1 1 1 X X 1 1 1 X 1 X 1
A B 1 00 01 11 10 x A Bx X X X X 1
JA = B.x' JB = x
A B 1 00 01 11 10 x A Bx X 1 X X X 1
KA = B.x
A B 1 00 01 11 10 x A Bx X 1 X X X
KB = (A ⊕ ⊕ ⊕ ⊕ x)'
A B 1 00 01 11 10 x A Bx X 1 X 1 X X
95
SS 2003 Computer Science II
x B A CP
J Q Q' K J Q Q' K
96
SS 2003 Computer Science II