CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1
Announcements If this is your first class: –print a syllabus from the course website –hand in signature form next class Recitations start this week Cell phones off 2
Today’s lessons A computer is a very simple machine. A computer manipulates voltages Gates are used to control voltage flow Circuits are combinations of gates A flip-flop is a circuit that remembers But first… 3
Name sign competition Put your signs out! 9:00 AM – Jeff 1:00 PM – Nina 3:00 PM – Alicia 4
physical vs. logical perspectives Physical reality: Logical view: WIRE Carries a HIGH voltage or a LOW voltage WIRE Carries a 1 or a 0 5
Idea 6
Controlling flow 0 7
1 8
Two in a row? 0 9
0 10
Two in a row? 0 11
Two in a row? 1 12
AND gate For which input values is output 1? For which input values is output 0? inputs are on left output is on right 13 0 or 1
Truth table for AND Input 1Input 2Output
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
Truth table for OR Input 1Input 2Output
NOT gate For which input value is output 1? For which input value is output 0? input is on left output is on right 17
Truth table for NOT InputOutput
Flip-flop (a bit of memory!) S (set) R (reset) remembered value 19
Setting the flip-flop The normal value of R and S is zero. S (set) = 0 R (reset) = 0 remembered value 20
Setting the flip-flop To store 1 in the flip-flop, we “raise” S to 1… S (set) = 1 R (reset) = 0 remembered value 21
Setting the flip-flop …which makes the output of the OR gate 1. S (set) = 1 R (reset) = 0 remembered value 22 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! 26 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
Questions? 27