Basic Digital Logic Basic Gates
Digital Signals Digital Signals have two basic states: 1 (logic “high”, or H, or “on”) 0 (logic “low”, or L, or “off”) Digital values are in a binary format. Binary means 2 states. A good example of binary is a light (only on or off)
Digital Logic Hardware consists of a few simple building blocks These are called logic gates AND, OR, NOT, … NAND, NOR, XOR, … Logic gates are built using transistors NOT gate can be implemented by a single transistor AND gate requires 3 transistors Transistors are the fundamental devices Pentium consists of 3 million transistors Compaq Alpha consists of 9 million transistors Now we can build chips with more than 100 million transistors Functionality can be expressed by a truth table A truth table lists output for each possible input combination
Basic Gates Basic Digital logic is based on 3 primary functions (the basic gates): NOT Gate AND Gate OR Gate Other gates XOR Gate NAND Gate NOR Gate XNOR Gate
The AND function Usually represented by dot (.) Ex: x.y Logics: If all the inputs are high is the output is high If any input is low, the output is low
AND Logic Symbol Output Inputs If both inputs are 1, the output is 1 If any input is 0, the output is 0
AND Logic Symbol Inputs Output Determine the output
AND Logic Symbol Inputs Output 1 Determine the output
AND Logic Symbol 1 1 Inputs Output 1 Determine the output
AND Truth Table To help understand the function of a digital device, a Truth Table is used: Input Output 1 Every possible input combination Truth Table for 3 inputs AND Gate
AND Gates It is possible to have AND gates with more than 2 inputs. The same logic rules apply – “if any input…”
AND Different Symbols X & Y X and Y X Y X * Y XY (textbook) and(Z,X,Y) V U
The OR Gate Usually represented by dot (+) Ex: x+y The OR function: if any input is high, the output is high if all inputs are low, the output is low
OR Logic Symbol Output Inputs If any input is 1, the output is 1 If all inputs are 0, the output is 0
OR Logic Symbol Inputs Output Determine the output
OR Logic Symbol 1 Inputs Output 1 Determine the output
OR Logic Symbol 1 1 Inputs Output 1 Determine the output
OR Truth Table Truth Table Input Output 1 Truth Table for 3 inputs 1 Truth Table for 3 inputs OR Gate
NOT Y = ~X Y = !X Y = not X Y = X’ Y = X Y = X (textook) not(Y,X)
The NOT function The NOT function: If any input is high, the output is low If any input is low, the output is high “The output is the opposite state of the input” The NOT function is often called INVERTER
NOT Logic Symbol Input Output If the input is 1, the output is 0
NOT Logic Symbol Output Input 1 Determine the output
NOT Logic Symbol 1 Output Input Determine the output
NOT Truth Table Truth Table Input Output 1 NOT Function
Exercise 1 1. Least Challenging Complete the sentences: If all inputs of an OR gate are low, the output is_________ If any input of an AND gate is low, the output is _________ The output of a NOT gate is always the ___________ of the input.
Chips
The XOR [Exclusive OR] function Usually represented by Ex: x y Logics: If all inputs are high or low then the output will be low Y X + = Å
XOR Logic Symbol X Z Output Inputs Y B A + = Å
XOR Logic Symbol Inputs Output Determine the output
XOR Logic Symbol 1 Inputs Output 1 Determine the output
XOR Logic Symbol 1 1 Inputs Output Determine the output
XOR Logic Symbol 1 Inputs Output 1 Determine the output
XOR Truth Table Truth Table for 3 inputs XOR Gate
The XNOR [Exclusive NOR] function Usually represented by Ex: X Y or (x y)′ Logics: If all inputs are high or low then the output will be high
XNOR Logic Symbol X Z Output Inputs Y X Y =XY+X′Y′
XNOR Logic Symbol 1 Inputs Output Determine the output
XNOR Logic Symbol Inputs Output 1 Determine the output
XNOR Logic Symbol 1 Inputs Output Determine the output
XNOR Logic Symbol 1 1 Inputs Output 1 Determine the output
XNOR Truth Table Truth Table for 3 inputs XNOR Gate
The NAND [NOT-AND] function Usually represented by ′ or ‾ Ex: (XY)′ Logics: If all inputs are high output will be low
NAND Logic Symbol Output Inputs
NAND Logic Symbol 1 Inputs Output Determine the output
NAND Logic Symbol 1 Inputs Output 1 Determine the output
NAND Logic Symbol 1 1 Inputs Output Determine the output
NAND Logic Symbol 1 Inputs Output 1 Determine the output
NAND Truth Table Truth Table for 3 inputs NAND Gate
The NOR [NOT-OR] function Usually represented by ′ or ‾ Ex: (X+Y)′ Logics: If all inputs are low output will be high
NOR Logic Symbol Inputs Output
NOR Logic Symbol 1 Inputs Output Determine the output
NOR Logic Symbol Inputs Output 1 Determine the output
NOR Logic Symbol 1 Inputs Output Determine the output
NOR Logic Symbol 1 Inputs Output 1 Determine the output
NOR Truth Table NOR Gate Truth Table for 3 inputs
Draw a circuit diagram for = (xy' + x'y)z.
(A.B+C′)D