Lecture 02
Lecture 02
www.qatar.cmu.edu
+5 +5
1 0 1
V V
Time T ime
–5 –5
Digital: Analog:
only assumes discrete values values vary over a range continuously
° Implement L4:
Normally Open when the control signal is 0 (false), the switch is open
False False
Normally Open Normally Closed
Switch Switch
Open Closed
Switch Switch
Computer Architecture Fall 2008 ©
Switch Representations
Examples: routing inputs to outputs through a maze
EXAMPLE:
Car in Garage Car
IF car in garage garage door open running
AND garage door open
AND car running Car can
True
THEN back out car back out
Gate
Logic 1 on gate,
Source Drain Source and Drain connected
nMOS Transistor
Gate
Logic 0 on gate,
Source and Drain connected
Source Drain
pMOS Transistor
Inverter Operation
+5V +5V
Input is 1 Input is 0
Pull-up does not conduct Pull-up conducts
Pull-down conducts Pull-down does not conduct
Output connected to GND Output connected to VDD
"0" "1"
A = 1, B = 1 A = 0, B = 1
Pull-up network does not conduct Pull-up network has path to VDD
Pull-down network conducts Pull-down network path broken
Output node connected to GND Output node connected to VDD
"1" "0"
A = 0, B = 0 A = 1, B = 0
Pull-up network conducts Pull-up network broken
Pull-down network broken Pull-down network conducts
Output node at VDD Output node at GND
A B A B
False False
output output
True True
Truth Tables
tabulate all possible input combinations and their associated
output values
NOT X is written as X
X AND Y is written as X & Y, or sometimes X Y
X OR Y is written as X + Y
Sum = A B + A B
A B Sum Carry
OR'd together product terms
0 0 0 0 for each truth table
0 1 1 0 row where the function is 1
1 0 1 0
1 1 0 1 if input variable is 0, it appears in
complemented form;
if 1, it appears uncomplemented
Carry = A B
Computer Architecture Fall 2008 ©
Representing Digital Logic: Boolean
Algebra
Another example:
0 0 0 0 0
0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
1 1 1 1 1
AND
SUM
B
OR
CARR Y
SUM
Cin
A
B
Cout B Cout
Cin
A
Cin
sum sum
propagation propagation
delay delay
circuit hazard: 1 plus 0 is 1, not 0!
A0 A1 B0 B1
Multiple input sources
Sa MUX MUX Sb
A B
Sum
S0 S1
° Two questions:
•How do we design memory elements?
- How do we create logic that remembers?
•How do we design sequential logic
Computer Architecture Fall 2008 ©
Memory
Elements
° The trick is to use feedback
Cascaded Inverters: Static Memory Cell
"1"
"0" D Q
Clk
° Example: D-Latch D
Clk