spiral 2 4
play

Spiral 2-4 Function synthesis with: Muxes (Shannon's Theorem) - PowerPoint PPT Presentation

2-4.1 Spiral 2-4 Function synthesis with: Muxes (Shannon's Theorem) Memories 2-4.2 Learning Outcomes I can implement logic for any truth table by using Shannon's theorem to decompose the function to create two smaller functions and a


  1. 2-4.1 Spiral 2-4 Function synthesis with: Muxes (Shannon's Theorem) Memories

  2. 2-4.2 Learning Outcomes • I can implement logic for any truth table by using Shannon's theorem to decompose the function to create two smaller functions and a 2-to-1 mux – I can recursively apply Shannon's theorem k times to decompose any size truth table to arrive at 2 k smaller functions and a 2 k -to-1 mux • I can implement logic for any truth table by using a memory as a look-up table – I understand how to determine the necessary dimensions of the memory – I understand how to reinterpret input combinations as address inputs to determine the correct row to place the desired output

  3. 2-4.3 Function Synthesis Techniques • Given a combination function (i.e. X Y Z P truth table or other description) 0 0 0 0 0 0 1 0 what methods can we use to arrive 0 1 0 1 0 1 1 1 at a circuit? 1 0 0 0 – Karnaugh maps 1 0 1 1 1 1 0 0 – Sum of minterms / Produce of 1 1 1 1 maxterms Primes between 0-7 – Neither of these scale well to larger number of inputs • Now we will see a few others

  4. 2-4.4 Implementing functions with muxes SHANNON'S THEOREM

  5. 2-4.5 Simplify This • Given F(x,y,z) = x’yz + y’z’, simplify F(0,y,z) = then simplify F(1,y,z) = • Given G(a,b,c,d) = bd’ + ab’cd + ac’d’ G(1,1,c,d) =

  6. 2-4.6 2-to-1 Mux: Another View Old Views: IN0 1 I 0 if(s==0) Y Y 1 Y = IN0 S I 1 0 S (I 0 ) else Y = IN1 1-bit wide 2-to-1 IN1 mux New View: Y We can show the function of a 2-to-1 mux as a splitter where s the variable 's' decides which input passes upwards I0 I1

  7. 2-4.7 3-bit Prime Number Function X Y Z P X Y Z P F 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 x OFF-set 0 1 0 1 0 1 0 1 0 1 y 0 1 1 1 0 1 0 1 1 1 1 0 0 0 1 0 0 0 ON-set z 0 1 1 0 1 1 1 0 1 1 1 1 0 0 0 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 1 1 1 Truth Table Primes between 0-7 if(z==0) S z z output 0 I 0 I 1 else output 1 0 1 0 1

  8. 2-4.8 Function Implementation w/ Muxes • Implementing a function using muxes relies is based on Shannon’s expansion theorem which states: – F(X 1 ,X 2 ,…, X n ) = X 1 ’ • F(0,X 2 ,…, X n ) + X 1 •F( 1,X 2 ,…, X n ) – X 1 can be pulled out of F if we substitute an appropriate constant and qualify it with X 1 ’ or X 1 • Now recall a 2-to-1 mux can be built as: – F = S’•I 0 + S•I 1 – Comparing the two equations, Shannon’s theorem says we can use X 1 as our select bit to a 2-to-1 mux with F(0,X 2 ,… X n ) as input 0 of our mux and F(1,X 2 ,…, X n ) as input 1

  9. 2-4.9 Binary Decision Trees & Muxes F(x,y,z) Z F 0 0 x 0 1 Y Z F 1 0 X X Y Y Z Z F F F(0,y,z) 0 0 0 F(0,0,z) F(1,y,z) 0 0 0 0 0 0 0 y 0 1 0 0 1 0 0 0 1 1 0 0 Z F 0 1 0 1 0 1 1 0 0 1 1 0 1 F(1,1,z) F(1,0,z) F(0,1,z) F(0,0,z) 1 1 1 0 1 1 1 1 1 1 1 1 z 0 1 F(0,y,z) 1 0 0 0 0 0 0 F(0,1,z) 1 0 0 1 1 1 1 Y Z F 0 0 1 1 0 1 0 1 1 Z F 1 1 1 0 0 0 0 0 0 0 0 0 F(x,y,z) 1 1 1 1 1 1 1 0 1 1 x 1 1 0 1 F(x,y,z) 1 0 0 F(1,0,z) y F(1,y,z) F(0,y,z) 1 1 1 0 1 0 1 Z F F(1,y,z) F(0,0,z) F(0,1,z) F(1,0,z) F(1,1,z) 0 0 z 0 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 0 F(1,1,z) 1

  10. 2-4.10 Splitting on X • We can use smaller X Y Z F muxes by breaking the 0 0 0 truth table into fewer disjoint sets 0 1 1 0 – This increases the 1 0 1 amount of logic at the I 0 F inputs though 1 1 0 Y • Break the truth table I 1 S 0 0 1 into groups based on X 0 1 1 some number (k) of 1 Put the k MSB’s MSB’s 1 0 0 on the selects • For each group, 1 1 1 describe F as a function of the n- k LSB’s

  11. 2-4.11 Splitting on X • We can use smaller X Y Z F muxes by breaking the 0 0 0 truth table into fewer y xor z disjoint sets 0 1 1 0 (y’z + yz’) – This increases the 1 0 1 Y amount of logic at the I 0 Z F inputs though 1 1 0 Y Y • Break the truth table I 1 S 0 0 1 Z into groups based on X 0 1 1 some number (k) of (y’ + z) 1 Put the k MSB’s MSB’s 1 0 0 on the selects • For each group, 1 1 1 describe F as a function of the n- k LSB’s

  12. 2-4.12 Implement G X Y Z G 0 0 0 0 1 0 0 1 0 1 y I 0 G 1 1 1 Y I 1 y xor z S 0 0 0 X 0 1 1 1 1 0 1 1 1 0

  13. 2-4.13 Shannon’s Theorem • F(X 1 ,X 2 ,…, X n ) = X 1 ’ • F(0,X 2 ,…, X n ) + X 1 •F( 1,X 2 ,…, X n ) • Now recall a 2-to-1 mux can be built as: – F = S ’ •I 0 + S •I 1 – Comparing the two equations, Shannon’s theorem says we can use X 1 as our select bit to a 2-to-1 mux with F(0,X 2 ,… X n ) as input 0 of our mux and F(1,X 2 ,…, X n ) as input 1 • We can recursively apply Shannon’s theorem to pull out more variables: – F(X 1 ,X 2 ,…, X n ) = X 1 ’ X 2 ’ •F(0,0,…, X n ) + X 1 ’ X 2 •F(0,1,…, X n ) + X 1 X 2 ’ •F(1,0,…, X n ) + X 1 X 2 •F(1,1,…, X n ) +

  14. 2-4.14 Additional Logic F(x,y,z) can be broken into several • Muxes allow us to break a disjoint functions X Y Z F function into some number of F 0 (z) 0 0 smaller, disjoint functions 0 0 z • Use MSB’s to choose which 1 1 z F 1 (z) D 0 small function we want 0 1 z’ 0 1 • By including the use of z’ D 1 1 0 F Y inverters we can use a mux D 2 1 F 2 (z) 0 1 with n-1 select bits (given a 1 0 1 D 3 z S 0 function of n- var’s ) S 1 1 1 • Break the truth table into F 3 (z) 0 0 x y groups of 2 rows 1 1 z 1 1 Put the n-1 • For each group, put F in terms MSB’s on the of: z, z’, 0, or 1 selects

  15. 2-4.15 More Practice X Y Z G 0 0 0 0 0 D 0 1 0 1 D 1 0 1 G 0 1 Y z D 2 1 1 D 3 z' S 0 0 0 S 1 1 0 1 1 x y 0 1 1 1 1 0

  16. 2-4.16 As Far as We like • We can take this tactic all X Y Z F the way down and use ONLY D 0 0 0 0 0 0 a mux to implement any D 1 1 0 0 1 1 function D 2 1 • Connect the input variables 0 1 0 1 to the select bits of the mux D 3 0 0 1 1 0 • The output of the mux is F Y D 4 1 1 0 0 1 the output of the function D 5 1 1 0 1 1 • Whatever the output S 0 D 6 0 should be for each input S 1 1 1 0 0 S 2 value, attach that to the D 7 1 1 1 1 1 input of the mux x y z

  17. 2-4.17 Splitting on Z F x 0 1 • We can always rearrange our y 0 1 variables if it helps make the function simpler to implement z 0 1 0 1 0 1 0 1 0 1 Z X Y F F X Y Z F 0 0 0 0 0 0 z 1 0 0 1 0 0 1 1 x 0 0 1 0 1 0 0 1 0 0 0 1 y 1 1 0 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0 0 0 1 1 F 0 1 1 1 1 1 0 1 1 0 0 z 1 0 1 1 1 1 1 1 0 1

  18. 2-4.18 Implementing Logic Functions • We can use muxes to implement any arbitrary logic function – Choose one variable to split the large function into two smaller functions: f(0,x2,x3,…) and f(1,x2,x3,…) – A 2-to-1 mux will produce the output bit and the chosen "split" variable will be the select – Implement f(0,x2,x3,…) using any known method and connect it to input 0 of the 2-to-1 mux – Implement f(1,x2,x3,…) using any known method and connect it to input 1 of the 2-to-1 mux

  19. 2-4.19 Implementing an Initial State • Since the NSL is just a combinational function of the current state and inputs, we can use Shannon's theorem (i.e. muxes)to find an implementation rather than K-Maps NSL (Next State Logic) S D 0 OFL Q 0 (t) SM (Output Function Logic) (State Memory) Q 1 (t) D 1 0 Q 0 (t) PRE D Q CLK CLR A RESET 0 Q 1 (t) PRE D Q CLK CLK CLR RESET Current State Feedback

  20. 2-4.20 Example 1 • Implement D1 & D0 using 2-to-1 muxes with S as the select Next State Current State Output S = 0 S = 1 Q1*= Q0*= Q1* Q0* State Q 1 Q 0 State State A D1 D0 =D1 =D0 G01 0 0 G00 1 1 G10 0 1 1 G10 0 1 G01 0 0 G11 1 0 1 G00 1 1 G00 1 1 G10 0 1 0 G11 1 0 G01 0 0 G11 1 0 0 Q1 xnor Q0 Q1 xnor Q0 D0 D1 I 0 I 0 D0 = Q1 xnor Q0 Y Y Q1 xnor Q0 (Since both inputs are Q1 xor Q0 I 1 I 1 S S xnor, we don't need the mux) S S

  21. 2-4.21 Example 2 • Implement D1 and D0 using (2) 4-to-1 muxes with Q1,Q0 as the selects Next State Current Output State S = 0 S = 1 State Q 1 Q 0 State Q 1 * Q 0 * State Q 1 * Q 0 * SSG MTG MSG SS 0 0 MS 1 0 MT 1 1 1 0 0 N/A 0 1 X d d X d d d d d MT 1 1 MS 1 0 MS 1 0 0 1 0 MS 1 0 SS 0 0 SS 0 0 0 0 1 1 S D 0 D 0 D1 anything D 1 D1 anything D 1 Y Y 1 D 2 0 D 2 0 D 3 0 D 3 S 0 S 0 S 1 S 1 Q1 Q0 Q1 Q0

  22. 2-4.22 Example 3 L’ OFF ON P=0 P=1 • Implement D using a mux H’ L H Current State Next State H L = 0 0 H L = 0 1 H L = 1 1 H L = 1 0 Symbol Q Sym. Q* Sym. Q* Sym. Q* Sym. Q* OFF 0 ON 1 OFF 0 OFF 0 X d ON 1 ON 1 ON 1 OFF 0 X d Note: The State Value, Q forms the Pump output (i.e. 1 when we want the pump to be on and 0 othewise) Due to don't care: Option 1: H'L' D Option 2: L' I 0 Y I 1 Option 1: H' S Option 2: H'+L' Q

Recommend


More recommend