150 likes | 218 Vues
What you should be able to do:. Convert a binary number to hex and back Convert a decimal number to hex (via binary) and back Hex:Add, Subtract, Multiply/Divide by 2 Perform logical operations (AND,OR,XOR,NOT) Make truth table for any logic equation.
E N D
What you should be able to do: • Convert a binary number to hex and back • Convert a decimal number to hex (via binary) and back • Hex:Add, Subtract, Multiply/Divide by 2 • Perform logical operations (AND,OR,XOR,NOT) • Make truth table for any logic equation
CMOS: Transistors, the building blocks of hardware • Electronic Switches • 3 Inputs: Gate, Source and Drain • The signal on the gate determines whether there is a connection between source and ground • 2 CMOS Types: N-MOS, P-MOS
2 Types of Transistors • P-MOS • Connected (D = S) if gate has 0Volt • Disconnected if gate has 2.9 Volt • Symbol • Ground Symbol • N-MOS • Connected (D = S) if gate has 2.9 Volt • Disconnected if gate has 0 Volt • Symbol • Source Symbol
Example of a CMOS circuit • Note the dual nature: The top of the circuit does the opposite from the bottom • You can never have a connection from source to ground for any input combination! • There is a delay until the correct value “arrives” at output • y = NOR(a,b)
Notation of Logic gates • OR • NOR • Inverter (NOT) • AND • NAND • Multiple AND
Simplification of Logic • DeMorgan: • NOT(A AND B) = (NOT A) OR (NOT B) • NOT(A OR B) = (NOT A) AND (NOT B) • x AND 1 = x • x AND 0 = 0 • x OR 1 = 1 • x OR 0 = x
Creating a circuit from an equation • Y= (a AND b) OR (NOT a AND c) OR c • Alternative: y= (a•b) + (ā•c) + c • Not has a stronger binding than any other operation, AND binds stronger than OR • Draw inputs (a,b,c) vertically to the left, output (y) to the right • Connect inputs to the inner gates (AND and NOT) according to the binding of the operators
Circuit a b c y
Creating an equation from a truth table • Every 1 in the output column corresponds to a conjunction (AND) of the inputs in the particular row • Each input that was 1 for this row is positive, every input that was 0 is negated • The entire equation is a OR of all the AND’s (of all 1’s) • You have to have as many AND terms as you have 1’s in the output variable • Example: See Full Adder
Common Logic Building Blocks • Typical Control Elements • Decoder • Multiplexer • Typical Analytical Elements • Adder • Typical Storage Elements • Latch
ai bi ci + si Full Adder ci+1
a0 a1 a2 a3 b1 b0 b2 b3 ci3 c0 c1 c2 + + + + s2 s3 s1 s0 Ripple Carry Adder • Use One bit full adder • n bit adder can be build from n one bit ripple carry • Why is this in praxis not such a good idea? • Alternative: Use truth table for 3n input to build complex circuit directly
Decoder • Decoder: k inputs (binary unsigned), 2k outputs of which only one is on ( the one that corresponds to the binary unsigned number) • Example: s1s0 = 01 • Output y1 is 1 • y0,y2,y3 is 0 (picture) • Example k=3: • Input to a 3 to 8 decoder is 101 • The output line 5 will be 1, all other 0 y0 y1 y2 y3
Multiplexer • Inverse function from a decoder • Selects one input and connects it to the output • k selection lines (s0,s1) and 2k data input lines (a,b,c,d)
What you should be able to do • Find the truth table from a CMOS circuit • Find the truth table from a logic circuit • Draw a logic circuit from a truce table or a logic equation