Download presentation
Presentation is loading. Please wait.
Published byAbel McCoy Modified over 9 years ago
1
Logic Design CS221 1 st Term 2009-2010 sequential circuits Cairo University Faculty of Computers and Information
2
24/10/2009 cs221 – sherif khattab 2 Administrivia GA: Makeup lecture tomorrow 11:15 in 260 homework #2 due next Saturday in lecture mid-term: Nov. 17 th in lecture similar questions to section, homework, and game covers lectures until today's lecture course web site: http://www.fci-cu.edu.eg/~skhattab/cs221/
3
24/10/2009 cs221 – sherif khattab 3 sequential-circuit design state diagram state table K-maps logic circuit
4
24/10/2009 cs221 – sherif khattab 4 D flip-flop
5
24/10/2009 cs221 – sherif khattab 5 Example 1: rotating lights
6
24/10/2009 cs221 – sherif khattab 6 state diagram left ON middl e ON space right ON space
7
24/10/2009 cs221 – sherif khattab 7 binary coding of inputs and state three states => 2 bits A, B 00, 01, 10 one input: S three outputs: X, Y, Z
8
24/10/2009 cs221 – sherif khattab 8 state diagram 00/10 0 01/01 0 S 10/00 1 S S
9
24/10/2009 cs221 – sherif khattab 9 state table A BS A B X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 x x x x x
10
24/10/2009 cs221 – sherif khattab 10 K-map A(t+1) = BS + AS'
11
24/10/2009 cs221 – sherif khattab 11 state table A BS A B X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 x x x x x
12
24/10/2009 cs221 – sherif khattab 12 K-map B(t+1) = BS' + A'B'S
13
24/10/2009 cs221 – sherif khattab 13 state table A BS A B X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 x x x x x
14
24/10/2009 cs221 – sherif khattab 14 K-map X(t+1) = A'B'
15
24/10/2009 cs221 – sherif khattab 15 state table A BS A B X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 x x x x x
16
24/10/2009 cs221 – sherif khattab 16 state table Y = B
17
24/10/2009 cs221 – sherif khattab 17 state table A BS A B X Y Z 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 1 0 1 0 0 1 0 1 0 0 0 1 0 0 0 0 1 x x x x x
18
24/10/2009 cs221 – sherif khattab 18 state table Z = A
19
24/10/2009 cs221 – sherif khattab 19 D flip-flop next statepresent state
20
24/10/2009 cs221 – sherif khattab 20 logic diagram
21
24/10/2009 cs221 – sherif khattab 21 Logic Diagram
22
24/10/2009 cs221 – sherif khattab 22 example 2: 4x4 LED matrix
23
24/10/2009 cs221 – sherif khattab 23 binary coding of inputs and state 16 states => 4 bits A, B, C, D 0000, 0001,...., 1111 4 inputs: U, D, R, L 16 outputs: L0, L1,...., L15
24
24/10/2009 cs221 – sherif khattab 24 state diagram 00 00 / L0 =1 00 01 00 10 00 11 RRR LLL R 01 0001 01 10 01 11 10 00 10 0110 10 11 11 00 11 01 11 1011 U U U U D D D D L R
25
24/10/2009 cs221 – sherif khattab 25 state table A B C DU D R L A B C D L0 L1 L2 L3... 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0.... 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0.... 0 0 0 0 0 0 1 0 0 0 0 1 1 0 0 0.... 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0.... 256 rows 8 variables! cannot use K-map!
26
24/10/2009 cs221 – sherif khattab 26 outputs logic-equations present state 0000 => L0 = 1 present state 0001 => L1 = 1 present state 0010 => L2 = 1 outputs L0–L15 depend only on present state 4 variables => can use K-map for the outputs
27
24/10/2009 cs221 – sherif khattab 27 n-to-m-line decoder A binary code of n bits can represent up to 2 n distinct items decoder circuit: converts a binary number to corresponding item e.g., 0000 => item # 0 0001 => item # 1 n-to-m-line decoder m <= 2 n
28
24/10/2009 cs221 – sherif khattab 28 3-to-8-line decoder truth table
29
24/10/2009 cs221 – sherif khattab 29 3-to-8-line decoder logic diagram
30
24/10/2009 cs221 – sherif khattab 30 back to our LED circuit 4-to-16- line decoder A B C D L0 L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11 L12 L14 L15 L13 present state
31
24/10/2009 cs221 – sherif khattab 31 next-state logic equations next state = present state + something if no button pressed: add 0000 if R button pressed: add 0001 if D button pressed: add 0100 if L button pressed: subtract 1 => add 1111 if U button pressed: subtract 0100 => add 1100 if R and D buttons pressed => add 0000 if more than one button pressed => add 0000
32
24/10/2009 cs221 – sherif khattab 32 next-state 4-bit adder present state something next state carry combinational circuit UD LR combinationa l circuit (C) s0s1s2s3
33
24/10/2009 cs221 – sherif khattab 33 truth table for circuit C
34
24/10/2009 cs221 – sherif khattab 34 logic equations S0 = U'D'R'L + UD'R'L' S1 = U'D'R'L + U'DR'L' + UD'R'L' S2 = U'D'R'L S3 = U'D'R'L + U'D'RL'
35
24/10/2009 cs221 – sherif khattab 35 whole circuit 4-bit adder present state something next state carry combinational circuit UD LR combinationa l circuit (C) s0s1s2s3
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.