CSE111: Great Ideas in Computer Science Dr. Carl Alphonce 219 Bell Hall Office hours: M-F 11:00-11:
Announcements Recitations have started this week! You have this week and next to complete HW1. 2
COMMUNICATION students 3
cell phones off (please) 4
Agenda Review from last class –two’s complement –underlying hardware Today’s topics –various circuits 5
AND gate 6 ABY
OR gate 7 ABY
NOT gate 8 AY 01 10
physical vs. logical perspectives Physical reality: Logical view: WIRE Carries a HIGH voltage or a LOW voltage WIRE Carries a 1 or a 0 9
Idea 10
Controlling flow 0 11
Controlling flow 1 12
Two in a row? 0 13
AND gate For which input values is output 1? For which input values is output 0? Inputs are on left Output is on right 14
OR gate For which input values is output 1? For which input values is output 0? Inputs are on left Output is on right 15
NOT gate For which input value is output 1? For which input value is output 0? Input is on left Output is on right 16
Flip-flop (a bit of memory!) S (set) R (reset) remembered value 17
Setting the flip-flop The normal value of R and S is zero. S (set) = 0 R (reset) = 0 remembered value 18
Setting the flip-flop To store 1 in the flip-flop, we “raise” S to 1… S (set) = 1 R (reset) = 0 remembered value 19
Setting the flip-flop …which makes the output of the OR gate 1. S (set) = 1 R (reset) = 0 remembered value 20 1
Setting the flip-flop The NOT gate inverts this 1 value to 0, which becomes the second input to the upper OR gate. S (set) = 1 R (reset) = 0 remembered value
Setting the flip-flop Since both inputs of the upper OR gate are zero, its output is zero. S (set) = 1 R (reset) = 0 remembered value
Setting the flip-flop The NOT gate inverts this 0 to a 1; this value becomes the second input to the bottom OR. S (set) = 1 R (reset) = 0 remembered value
Setting the flip-flop Because the output of the bottom OR gate will now stay at 1, we can lower S to zero, and the circuit will stay in a stable state, with 1 as the remembered value! 24 Resetting the flip-flop Resetting the remembered value to zero is similar, except we raise, then lower, the value on R. S (set) = 0 R (reset) = 0 remembered value
One-bit Half Adder 25 A B S C
One-bit Full Adder 26 A B CoutCout S CinCin