370 likes | 605 Views
מבנה מחשב. תרגול 1 מבוא, אריתמטיקה בסיסית – ייצוג גרפי. Logical Operators. Boolean AND Operation. Truth Table. Equivalent Gate. Different notations:. Boolean OR Operation. Truth Table. Equivalent Gate. Different notations:. Boolean NOT Operation. Truth Table. Equivalent Gate.
E N D
מבנה מחשב תרגול 1מבוא, אריתמטיקה בסיסית – ייצוג גרפי
Boolean AND Operation Truth Table Equivalent Gate Different notations: תירגול 1 - מבנה מחשב
Boolean OR Operation Truth Table Equivalent Gate Different notations: תירגול 1 - מבנה מחשב
Boolean NOT Operation Truth Table Equivalent Gate Different notations: תירגול 1 - מבנה מחשב
Boolean NAND Operation Equivalent Gate Truth Table תירגול 1 - מבנה מחשב
Boolean NOR Operation Equivalent Gate Truth Table תירגול 1 - מבנה מחשב
Boolean XOR Operation Truth Table Equivalent Gate Different notations: תירגול 1 - מבנה מחשב
How to implement XOR? Which is Better? תירגול 1 - מבנה מחשב
Boolean Equalities (1) • Rules of Associativity, Commutation. • Other rules: תירגול 1 - מבנה מחשב
Boolean Equalities (2) • Distribution • deMorgan תירגול 1 - מבנה מחשב
Example (1):Simplify the expression Compare number of gates תירגול 1 - מבנה מחשב
Example (2):Simplify the expression תירגול 1 - מבנה מחשב
1 1 Evaluating an Expression (1) • Let’s look at the first expression: 1 1 1 תירגול 1 - מבנה מחשב
1 1 1 Evaluating an Expression (2) • Let’s look at the first expression: 1 =1 תירגול 1 - מבנה מחשב
We get Different Notation for Truth Table 0 0 0 0 1 0 1 0 1 1 1 2 0 0 0 3 1 1 0 0 1 4 0 1 0 1 1 0 1 5 1 6 1 0 0 1 7 1 1 1 תירגול 1 - מבנה מחשב
Disjunctive Normal Form 0 0 0 0 1 It’s easy to transform a DNF formula to its equivalent gates’ representation 0 1 0 1 1 1 4 0 1 0 1 1 0 1 5 1 1 7 1 1 תירגול 1 - מבנה מחשב
Disjunctive Normal Form תירגול 1 - מבנה מחשב
Back to the Truth Table 0 0 0 0 1 0 1 0 1 1 Can we make the simplification process more simple? 1 2 0 0 0 3 1 1 0 0 Yes, using Karnaugh Maps 1 4 0 1 0 1 1 0 1 5 1 6 1 0 0 1 7 1 1 1 תירגול 1 - מבנה מחשב
Karnaugh Maps (1) • We’ll arrange the truth table in a different manner. 00 01 11 10 0 1 תירגול 1 - מבנה מחשב
Karnaugh Maps (2) • We’ll arrange the truth table in a different manner. How about The areas? 00 01 11 10 0 1 תירגול 1 - מבנה מחשב
Karnaugh Maps (3) • Step 1:We’ll assign the values in the new table. 00 01 11 10 0 1 1 0 0 1 1 1 1 0 תירגול 1 - מבנה מחשב
Karnaugh Maps (4) • Step 2:We’ll try to catch all the 1’s with the largest, fewest rectangles. 00 01 11 10 0 1 1 0 0 1 1 1 1 0 תירגול 1 - מבנה מחשב
Karnaugh Maps (5) • Step 3:Every rectangle gives us a clause in the simplified formula. 00 01 11 10 0 1 1 0 0 1 1 1 1 0 תירגול 1 - מבנה מחשב
00 01 11 10 0 0 0 0 00 0 0 1 1 01 1 1 1 1 11 1 0 1 0 10 Karnaugh Maps (6) • Back to example 2: • We’ll use a 4-variable Karnaugh Map: תירגול 1 - מבנה מחשב
“Don’t Cares” • Sometimes not all inputs are possible (can actually happen) in a sub-part of a function designed from logical gates. • So it really doesn’t matter what we’ll write in its truth table at the corresponding line. תירגול 1 - מבנה מחשב
“Don’t Cares” example 0 0 0 0 1 Assume a (1,1,0) input can’t really occur. We can mark this situation as “Don’t Care” 0 1 0 1 0 1 2 0 0 1 3 1 1 0 0 1 4 0 1 0 1 1 0 0 5 1 6 1 X 0 0 7 1 1 1 תירגול 1 - מבנה מחשב
Karnaugh Maps with Don’t Cares • We can choose the Don’t Care location to be considered as 1 or 0, depending what will be more efficient to us. What is more Efficient here? 00 01 11 10 0 1 0 0 1 1 1 0 0 X תירגול 1 - מבנה מחשב
Flip-Flops • What happens if we create a circle in the logic gates diagram? • Consider the following diagram: This is a S-R Flip-Flop תירגול 1 - מבנה מחשב
S-R Flip-Flop • S-R Flip Flop truth table: תירגול 1 - מבנה מחשב
S-R Flip-Flop With a Clock • The CPU is timed by the pulses of a clock. • Maintaining the FF contents when the clock is between pulses (i.e. outputting 0)using the S-R FF: תירגול 1 - מבנה מחשב
D-Flip-Flop (1) • On each clock pulse the FF should be meaningful • Therefore the R and S lines should be opposite • If so do we still need both of them? תירגול 1 - מבנה מחשב
D Flip-Flop (2) • D Flip-Flop when the clock is pulsing: תירגול 1 - מבנה מחשב
J-K Flip-Flop (with Clock) • Back to S-R Flip-Flop… • How can we solve the 1-1 problem ? תירגול 1 - מבנה מחשב
J-K Flip-Flop (2) • J-K Flip-Flop truth table when clock is pulsing: Save Toggle Save Toggle תירגול 1 - מבנה מחשב
T Flip-Flop (Based on J-K) • But since we have the “toggle” attribute, do we really need the rest? תירגול 1 - מבנה מחשב
T Flip-Flop (2) • T Flip-Flop when the clock is pulsing: תירגול 1 - מבנה מחשב